Mercurial > skaapsteker
comparison skaapsteker/sprites/player.py @ 431:b753ea36909e
Fix the bug Anna found.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 18:46:28 +0200 |
parents | 25efc74ac19c |
children | fe99a4e04b2b |
comparison
equal
deleted
inserted
replaced
430:25efc74ac19c | 431:b753ea36909e |
---|---|
288 | 288 |
289 def action_transform(self): | 289 def action_transform(self): |
290 """Transform the fox""" | 290 """Transform the fox""" |
291 if not self.on_solid: | 291 if not self.on_solid: |
292 return | 292 return |
293 if 'shapeshift' not in self.the_world.fox.tails: | 293 if 'shapeshift' not in self._me.tails: |
294 return | 294 return |
295 if self.shape == 'fox': | 295 if self.shape == 'fox': |
296 # Become human | 296 # Become human |
297 if self.the_world.fox.has_fan: | 297 if self._me.has_fan: |
298 self.shape = 'human_with_fan' | 298 self.shape = 'human_with_fan' |
299 else: | 299 else: |
300 self.shape = 'human' | 300 self.shape = 'human' |
301 else: | 301 else: |
302 self.shape = 'fox' | 302 self.shape = 'fox' |
303 # Check the transformation is feasible | 303 # Check the transformation is feasible |
304 if self.set_image(): | 304 if self.set_image(): |
305 # Transformation succeeded | 305 # Transformation succeeded |
306 self.the_world.fox.shape = self.shape | 306 self._me.shape = self.shape |
307 else: | 307 else: |
308 # Back out of transformation | 308 # Back out of transformation |
309 self.shape = self.the_world.fox.shape | 309 self.shape = self._me.shape |
310 | 310 |
311 def action_right(self): | 311 def action_right(self): |
312 if self.facing != 'right': | 312 if self.facing != 'right': |
313 self.facing = 'right' | 313 self.facing = 'right' |
314 self.set_image() | 314 self.set_image() |
562 OpenNotification.post("A fox cannot use a fan.") | 562 OpenNotification.post("A fox cannot use a fan.") |
563 return | 563 return |
564 fan.remove() | 564 fan.remove() |
565 self._me.has_fan = True | 565 self._me.has_fan = True |
566 self.shape = 'human_with_fan' | 566 self.shape = 'human_with_fan' |
567 self._me.shape = self.shape | |
567 self.set_image() | 568 self.set_image() |
568 | 569 |