-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.py
145 lines (132 loc) · 4.18 KB
/
debug.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/usr/bin/python2
#~~debug.py~~
#This will allow you to call functions directly in order to test them out
import player
import monsters
import actions
from time import sleep
def menu(Player):
actions.clearscreen()
print ("\n1. monster methods\n"
"2. player methods\n"
"3. actions functions")
choice = raw_input("\nChoice: ").lower()
if choice == "1":
monster_methods(Player)
elif choice == "2":
player_methods(Player)
elif choice == "3":
actions_functions(Player)
else:
print "Not a valid choice"
sleep(2)
return
def monster_methods(Player):
print ("\n1. create()\n"
"2. take_damage()\n"
"3. deal_damage()\n"
"4. attack()\n"
"5. Monster object attributes")
choice = raw_input("\nWhich method? ")
if choice == '1':
Monster = monsters.CreateMonster(25,15,"Big Monster") #(HP,damage_dealt,name)
print "Created %s that deals %d damage and has %d health" % (Monster.name,Monster.damage_dealt,Monster.health)
sleep(2)
elif choice == '2':
Monster = monsters.CreateMonster(25,15,"Big Monster")
damage = int(raw_input("How much? "))
Monster.take_damage(damage,Player)
elif choice == '3':
Monster = monsters.CreateMonster(25,15,"Big Monster")
#damage = int(raw_input("How much? "))
Monster.deal_damage(Player)
elif choice == '4':
Monster = monsters.CreateMonster(25,15,"Big Monster")
Monster.attack(Player)
elif choice == '5':
Monster = monsters.CreateMonster(25,15,"Big Monster")
print Monster
sleep(3)
else:
print "Not a valid choice"
sleep(2)
return
def player_methods(Player):
print ("\n1. find_gold()\n"
"2. find_gold_debug()\n"
"3. find_potions()\n"
"4. find_weapon()\n"
"5. use_potion()\n"
"6. list_inventory()\n"
"7. low_health()\n"
"8. set_health()\n"
"9. take_damage()\n"
"10. deal_damage()\n"
"11. gain_xp()\n"
"12. add_weapon()\n"
"13. buy_weapon()\n"
"14. set_current_weapon()\n"
"15. set step count\n"
"16. Player object attributes\n"
"17. Turns Taken")
choice = raw_input("\nWhich method? ")
if choice == '1':
Player.find_gold()
elif choice == '2':
amount = int(raw_input("\nHow much? "))
Player.find_gold_debug(amount)
elif choice == '3':
Player.find_potions()
elif choice == '4':
Player.find_weapon()
elif choice == '6':
Player.list_inventory()
elif choice == '7':
Player.low_health()
elif choice == '8':
health = int(raw_input("\nTo what? "))
Player.set_health(health)
elif choice == '9':
damage = int(raw_input("\nHow much? "))
Player.take_damage(damage)
elif choice == '10':
damage = int(raw_input("\nHow much? "))
Player.deal_damage(damage)
elif choice == '11':
monster = raw_input("\nWhich monster did you kill? ")
Player.gain_xp(monster)
elif choice == '12':
name = raw_input("\nWeapon name? ")
damage = raw_input("Weapon damage? ")
Player.add_weapon(name,damage)
elif choice == '13':
Player.buy_weapon()
elif choice == '14':
Player.set_current_weapon(Weapon)
elif choice == '15':
steps = int(raw_input("\nTo what? "))
Player.steps = steps
print "Step count set to %d" % Player.steps
sleep(2)
elif choice == '16':
print Player
sleep(9)
elif choice == '17':
turn = int(raw_input("\nSet turn count to what? "))
Player.turns = turn
else:
print "\nNot a valid choice"
sleep(2)
return
def actions_functions(Player):
print ("\n1. roll_dice()\n"
"2. visit_shop()")
choice = raw_input("\nWhich function? ")
if choice == '1':
actions.roll_dice(Player)
elif choice == '2':
actions.visit_shop()
else:
print "Not a valid choice"
sleep(2)
return