Browse code
added a comment for future reference as well as weapons.py which will be fleshed out later
Ed L authored on 27/07/2012 03:37:26
Showing 2 changed files
Showing 2 changed files
... | ... |
@@ -4,6 +4,7 @@ import libtcodpy as libtcod |
4 | 4 |
import maps |
5 | 5 |
|
6 | 6 |
class Object(object): |
7 |
+ # FIXME: map argument unused, remove |
|
7 | 8 |
def __init__(self, map, con, x,y, char, name, color, blocks=False, level=None, fighter=None, ai=None, item=None): |
8 | 9 |
self.name = name |
9 | 10 |
self.x, self.y = x,y |
10 | 11 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,26 @@ |
1 |
+ |
|
2 |
+class Weapon(object): |
|
3 |
+ def __init__(self, power_boost=0, chance_to_hit=100): |
|
4 |
+ self.power_boost = power_boost |
|
5 |
+ self.chance_to_hit = chance_to_hit |
|
6 |
+ |
|
7 |
+ self.ammo = [] |
|
8 |
+ self.mods = [] |
|
9 |
+ self.user = None |
|
10 |
+ |
|
11 |
+ def modify(self, mod): |
|
12 |
+ if mod.modify(self): |
|
13 |
+ self.mods.append(mod) |
|
14 |
+ def remove_mod(self, mod): |
|
15 |
+ if mod.undo(self): |
|
16 |
+ self.mods.remove(mod) |
|
17 |
+ |
|
18 |
+ def load(self, ammo): |
|
19 |
+ self.ammo.append(ammo) |
|
20 |
+ |
|
21 |
+ def equip(self, user): |
|
22 |
+ self.user = user |
|
23 |
+ |
|
24 |
+ def attack(self, target): |
|
25 |
+ pass |
|
26 |
+ |