-
Notifications
You must be signed in to change notification settings - Fork 0
/
items.py
175 lines (99 loc) · 3.45 KB
/
items.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import chara
class Items:
def __init__(self, name):
self.name = name
def use_item(self, pc, npc):
for i in pc.item_list:
if isinstance(self, Swap):
self.bonus(pc, npc)
pc.item_list.remove(self.name)
else:
self.bonus(pc)
pc.item_list.remove(self.name)
break
class SuperTonic(Items):
def __init__(self):
super().__init__('SuperTonic')
def bonus(self, pc):
if pc.health < 45 and isinstance(pc, chara.Hero):
if pc.health > 35:
pc.health = 45
else:
pc.health += 10
if pc.health < 55 and isinstance(pc, chara.Medic):
if pc.health > 45:
pc.health = 55
else:
pc.health += 10
if pc.health <= 35 and isinstance(pc, chara.Assassian):
if pc.health > 25:
pc.health = 35
else:
pc.health += 10
class Armorlv1(Items):
def __init__(self):
super().__init__('Old Leather Pads')
def bonus(self, pc):
pc.armor_rating += 2
def remove(self, pc):
pc.armor_rating -= 2
class Armorlv2(Items):
def __init__(self):
super().__init__('Used Chainmail Garb')
def bonus(self, pc):
pc.armor_rating += 5
def remove(self, pc):
pc.armor_rating -= 5
class Armorlv3(Items):
def __init__(self):
super().__init__('New Mastercrafted Knights Suit of Armor')
def bonus(self, pc):
pc.armor_rating += 10
def remove(self, pc):
pc.armor_rating -= 10
class Evade(Items):
def __init__(self):
super().__init__('Rune of Evasion')
def bonus(self, pc):
pc.evade += 1
class Root(Items):
def __init__(self):
super().__init__('Root of the Mutant Tree')
def bonus(self, pc):
pc.power += 2
def remove_root(self, pc):
pc.power -= 2
class Swap(Items):
def __init__(self):
super().__init__('Scroll of Reversal')
def bonus(self, pc, npc):
hold = pc.power
pc.power = npc.power
npc.power = hold
class Swordlv1(Items):
def __init__(self):
super().__init__('Dull Sabre')
def bonus(self, pc):
pc.power += 3
def remove(self, pc):
pc.power -= 3
class Swordlv2(Items):
def __init__(self):
super().__init__('Knight\'s Longsword')
def bonus(self, pc):
pc.power += 5
def remove(self, pc):
pc.power -= 5
class Swordlv3(Items):
def __init__(self):
super().__init__('Arch Bishop Igor\'s Legnedary Diamond Encrusted Two-handed Great Sword')
def bonus(self, pc):
pc.power += 8
def remove(self, pc):
pc.power -= 8
class Volatile_Powder(Items):
def __init__(self, used):
super().__init__('Volatile Powder')
self.used = used
def bonus(self, pc):
self.used = True