comparison pytouhou/games/eosd.py @ 545:bcff39c920ab

Set boss mode directly from the enemy.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 15 May 2014 20:14:54 +0200
parents 7c3c90468996
children e35bef07290d
comparison
equal deleted inserted replaced
544:b895ed2de71f 545:bcff39c920ab
223 223
224 224
225 def set_boss_life(self): 225 def set_boss_life(self):
226 if not self.game.boss: 226 if not self.game.boss:
227 return 227 return
228 self.boss_items[1].maximum = self.game.boss._enemy.life or 1 228 self.boss_items[1].maximum = self.game.boss.life or 1
229 self.boss_items[2].maximum = self.game.boss._enemy.life or 1 229 self.boss_items[2].maximum = self.game.boss.life or 1
230 230
231 231
232 def set_spell_life(self): 232 def set_spell_life(self):
233 self.boss_items[2].set_value(self.game.boss._enemy.low_life_trigger if self.game.boss else 0) 233 self.boss_items[2].set_value(self.game.boss.low_life_trigger if self.game.boss else 0)
234 234
235 235
236 def update(self): 236 def update(self):
237 for elem in self.items: 237 for elem in self.items:
238 elem.update() 238 elem.update()
252 self.labels['points'].set_text('%d' % player_state.points) 252 self.labels['points'].set_text('%d' % player_state.points)
253 self.labels['player'].set_value(player_state.lives) 253 self.labels['player'].set_value(player_state.lives)
254 self.labels['bombs'].set_value(player_state.bombs) 254 self.labels['bombs'].set_value(player_state.bombs)
255 255
256 if self.game.boss: 256 if self.game.boss:
257 boss = self.game.boss._enemy 257 boss = self.game.boss
258 258
259 life_gauge = self.boss_items[1] 259 life_gauge = self.boss_items[1]
260 life_gauge.set_value(boss.life) 260 life_gauge.set_value(boss.life)
261 261
262 spell_gauge = self.boss_items[2] 262 spell_gauge = self.boss_items[2]