comparison gamelib/equipment.py @ 200:67d10f7e0159

selected chickens are selected
author Adrianna Pińska <adrianna.pinska@gmail.com>
date Fri, 04 Sep 2009 19:51:19 +0000
parents 355eaae40b1f
children 3074784c93f4
comparison
equal deleted inserted replaced
199:696936621a93 200:67d10f7e0159
126 CHICKEN_IMAGE_FILE = 'sprites/kevlar.png' 126 CHICKEN_IMAGE_FILE = 'sprites/kevlar.png'
127 127
128 class Accoutrement(Equipment): 128 class Accoutrement(Equipment):
129 """Things which are not equipment, but are displayed in the same way""" 129 """Things which are not equipment, but are displayed in the same way"""
130 IS_EQUIPMENT = False 130 IS_EQUIPMENT = False
131 IS_ACCOUTREMENT = True
131 BUY_PRICE = 0 132 BUY_PRICE = 0
132 SELL_PRICE = 0 133 SELL_PRICE = 0
133 134
134 def place(self, animal): 135 def place(self, animal):
135 for eq in animal.accoutrements: 136 for eq in animal.accoutrements:
155 return is_equipment(obj) and getattr(obj, 'IS_WEAPON', False) 156 return is_equipment(obj) and getattr(obj, 'IS_WEAPON', False)
156 157
157 def is_armour(obj): 158 def is_armour(obj):
158 return is_equipment(obj) and getattr(obj, 'IS_ARMOUR', False) 159 return is_equipment(obj) and getattr(obj, 'IS_ARMOUR', False)
159 160
161 def is_accoutrement(obj):
162 return not getattr(obj, "IS_EQUIPMENT", False) and hasattr(obj, "NAME") and getattr(obj, 'IS_ACCOUTREMENT', False)
163
160 EQUIPMENT = [] 164 EQUIPMENT = []
161 for name in dir(): 165 for name in dir():
162 obj = eval(name) 166 obj = eval(name)
163 try: 167 try:
164 if is_equipment(obj): 168 if is_equipment(obj):