# HG changeset patch # User Jeremy Thurgood # Date 1302363364 -7200 # Node ID 8ac5b3d619fe6a35f139062ec295286ffca1a930 # Parent a5f54ae9217e44239c2fa6f00ce05c107eea92c7 Signal fire. diff -r a5f54ae9217e -r 8ac5b3d619fe skaapsteker/sprites/base.py --- a/skaapsteker/sprites/base.py Sat Apr 09 17:35:11 2011 +0200 +++ b/skaapsteker/sprites/base.py Sat Apr 09 17:36:04 2011 +0200 @@ -346,7 +346,6 @@ def player_action(self, player): - print "Player touched %s" % self player.take_item(self) diff -r a5f54ae9217e -r 8ac5b3d619fe skaapsteker/sprites/items.py --- 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 ##################################################