-
Notifications
You must be signed in to change notification settings - Fork 1
/
battle.py
59 lines (51 loc) · 1.57 KB
/
battle.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from character import Character
from classes import Warrior
from classes import Medic
from enemies import Goblin
from enemies import Shadow
from enemies import Zombie
from enemy_select import enemy_select
from orbs import Orbs
from orbs import Diamond_orb
from orbs import Golden_orb
from orbs import Silver_orb
from orbs import Bronze_orb
import random
# define title screen
def battle(hero):
enemy = enemy_select()
print(enemy.isalive)
while enemy.isalive == True and hero.isalive == True:
hero.print_status()
enemy.print_status()
print()
print("What do you want to do?")
print("1. fight")
print("2. do nothing")
print("3. use an item")
print("4. flee")
print("5. Steal")
user_input = input()
if user_input == "1":
hero.attack(enemy, hero, enemy, hero.bonus_damage_percent, hero.bonus_damage_multiplier)
elif user_input == "2":
pass
elif user_input == "3":
hero.use_item()
elif user_input == "4":
print("Goodbye.")
break
elif user_input == "5":
hero.steal(enemy)
else:
print("Invalid input %r" % user_input)
if enemy.isalive == True:
enemy.attack(hero, hero, enemy, enemy.bonus_damage_percent, enemy.bonus_damage_multiplier)
if enemy.isalive == False:
hero.pillage(enemy)
if hero.isalive == False:
print("Game Over")
return "dead"
else:
pass
print()