/
hero_game.py
31 lines (29 loc) · 1006 Bytes
/
hero_game.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Added a store. The hero can now buy a tonic or a sword. A tonic will add 2 to the hero's health wherease a sword will add 2 power.
"""
import random
import time
import math
from hero import Hero
from battle import Battle
from goblin import Goblin
from medic import Medic
from sayan import Sayan
from shadow import Shadow
from store import Store
from thief import Thief
from wizard import Wizard
from zombie import Zombie
from mimic import Mimic
hero = Hero('Oakley')
enemies = [Goblin('Bob'), Wizard('Jethro'), Medic('Mercy'), Thief('Barry'), Mimic('Harry'), Zombie('Rick'), Shadow('Matt'), Sayan('Goku')]
# enemies = [Thief('Barry')] Goblin('Bob'), Wizard('Jethro'), Medic('Mercy'), Thief('Barry'), Zombie('Rick'), Shadow('Matt'), Sayan('Goku'),
battle_engine = Battle()
shopping_engine = Store()
for enemy in enemies:
hero_won = battle_engine.do_battle(hero, enemy)
if not hero_won:
print("YOU LOSE!")
exit(0)
shopping_engine.do_shopping(hero, enemy)
print("YOU WIN!")