Changeset 357:d2c7e17299a7
- Timestamp:
- 09/06/13 17:14:04 (9 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
data/levels/level2
r352 r357 19 19 - [700, 150] 20 20 classname: AcidFloor 21 - args: 22 - [600, 250] 23 - - [600, 250] 24 - [600, 300] 25 - [700, 300] 26 - [700, 250] 27 classname: ForceWolfFloor 21 28 lines: [] 22 29 polygons: -
nagslang/game_object.py
r356 r357 511 511 # low, they shouldn't impact gameplay 512 512 if self._ticks == 0: 513 protagonist.lose_health(self.damage)513 self.apply_effect(protagonist) 514 514 self._ticks += 1 515 515 if self._ticks > self.rate: 516 516 self._ticks = 0 517 517 518 def apply_effect(self, protagonist): 519 protagonist.lose_health(self.damage) 520 518 521 @classmethod 519 522 def requires(cls): … … 525 528 damage = 1 526 529 tile = 'acid.png' 530 531 532 class ForceWolfFloor(HostileTerrain): 533 tile = 'moonlight.png' 534 rate = 0 535 536 def apply_effect(self, protagonist): 537 protagonist.force_wolf_form() -
nagslang/protagonist.py
r356 r357 77 77 self.is_moving = False 78 78 self.changing_sequence = [] 79 self.change_delay = 0 79 80 80 81 self.go_human() … … 253 254 254 255 def toggle_form(self): 256 if self.change_delay: 257 return 255 258 self.changing_sequence.extend(self.CHANGING_SEQUENCE[self.form]) 256 259 … … 344 347 345 348 def update(self, dt): 349 if self.change_delay > 0: 350 self.change_delay -= 1 346 351 if self.changing_sequence: 347 352 self._go_to_next_form() … … 350 355 self.gain_health(1) 351 356 super(Protagonist, self).update(dt) 357 358 def force_wolf_form(self): 359 if self.in_human_form() and not self.changing_sequence: 360 self.toggle_form() 361 self.change_delay = 2
Note:
See TracChangeset
for help on using the changeset viewer.