Changeset 412:8ac5b3d619fe


Ignore:
Timestamp:
04/09/11 15:36:04 (12 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Signal fire.

Location:
skaapsteker/sprites
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/base.py

    r410 r412  
    347347
    348348    def player_action(self, player):
    349         print "Player touched %s" % self
    350349        player.take_item(self)
    351350
  • skaapsteker/sprites/items.py

    r406 r412  
    113113    image_file = 'props/kindling.png'
    114114
     115    def player_action(self, player):
     116        if player.has_item('oil'):
     117            set_fire(player, self)
     118        else:
     119            player.take_item(self)
     120
    115121
    116122class Oil(Item):
    117123    image_file = 'props/oil.png'
    118124
     125    def player_action(self, player):
     126        if player.has_item('kindling'):
     127            set_fire(player, self)
     128        else:
     129            player.take_item(self)
     130
     131
     132
     133# TODO: Finish this thing's behaviour
     134class SignalFire(Item):
     135    image_file = 'dummy.png'
     136
     137    def setup(self, litness, **opts):
     138        super(SignalFire, self).setup(**opts)
     139
     140
     141    def player_action(self, player):
     142        if self._me.litness == 'set':
     143            if player.has_item('kindling'):
     144                notify('You put the kindling in the fire.')
     145            elif player.has_item('oil'):
     146                notify('You pour the oil on the fire.')
     147            else:
     148                return
     149            player.discard_item()
     150            self._me.litness = 'kindled'
     151        elif self._me.litness == 'kindled':
     152            if player.has_item('kindling'):
     153                notify('You put the kindling in the fire and light it.')
     154            elif player.has_item('oil'):
     155                notify('You pour the oil on the fire and light it.')
     156            else:
     157                return
     158            player.discard_item()
     159            self._me.litness = 'burning'
     160            self.world.missions.fire_started_on_road = True
    119161
    120162
Note: See TracChangeset for help on using the changeset viewer.