Mercurial > skaapsteker
diff skaapsteker/sprites/items.py @ 412:8ac5b3d619fe
Signal fire.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 17:36:04 +0200 |
parents | 9c043be746fa |
children | e289a111c743 |
line wrap: on
line diff
--- a/skaapsteker/sprites/items.py Sat Apr 09 17:35:11 2011 +0200 +++ b/skaapsteker/sprites/items.py Sat Apr 09 17:36:04 2011 +0200 @@ -112,10 +112,52 @@ class Kindling(Item): image_file = 'props/kindling.png' + def player_action(self, player): + if player.has_item('oil'): + set_fire(player, self) + else: + player.take_item(self) + class Oil(Item): image_file = 'props/oil.png' + def player_action(self, player): + if player.has_item('kindling'): + set_fire(player, self) + else: + player.take_item(self) + + + +# TODO: Finish this thing's behaviour +class SignalFire(Item): + image_file = 'dummy.png' + + def setup(self, litness, **opts): + super(SignalFire, self).setup(**opts) + + + def player_action(self, player): + if self._me.litness == 'set': + if player.has_item('kindling'): + notify('You put the kindling in the fire.') + elif player.has_item('oil'): + notify('You pour the oil on the fire.') + else: + return + player.discard_item() + self._me.litness = 'kindled' + elif self._me.litness == 'kindled': + if player.has_item('kindling'): + notify('You put the kindling in the fire and light it.') + elif player.has_item('oil'): + notify('You pour the oil on the fire and light it.') + else: + return + player.discard_item() + self._me.litness = 'burning' + self.world.missions.fire_started_on_road = True ##################################################