Changeset 396:dc534c2c475c


Ignore:
Timestamp:
04/09/11 14:41:41 (12 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Phase:
public
Rebase:
33333732326666366264643733653664656461363165356364356132636338353662633431656337
Message:

Fix up various power activation checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/player.py

    r395 r396  
    3737        self.jumping = False
    3838        self.flying = False
     39        self.prep_flight = 0.0
    3940        self.shape = 'fox'  # Needed so load image does the right thing
    4041        self._load_images()
     
    206207
    207208    def action_double_left(self):
    208         # FIXME: Tie this to the tails
    209         if self.sprinting > 0 or self.flying > 0:
     209        if self.sprinting > 0 or self.flying > 0 or 'sprint' not in self._me.tails or self._me.shape != 'fox':
    210210            return
    211211        self.sprinting = 2
     
    214214
    215215    def action_double_right(self):
    216         if self.sprinting > 0 or self.flying > 0:
     216        if self.sprinting > 0 or self.flying > 0 or 'sprint' not in self._me.tails or self._me.shape != 'fox':
    217217            return
    218218        self.sprinting = 2
     
    222222    def action_double_up(self):
    223223        if self.flying > 0 or 'flight' not in self._me.tails or \
    224                self.prep_flight - time.time() > 2.5 * DOUBLE_TAP_TIME:
     224               self.prep_flight - time.time() > 2.5 * DOUBLE_TAP_TIME \
     225               or self._me.shape != 'fox':
    225226            return
    226227        self.flying = 1
     
    302303
    303304    def action_fire1(self):
    304         if not self.check_fire_rate():
     305        if self._me.shape != 'fox' or not self.check_fire_rate():
    305306            return
    306307        if "fireball" not in self._me.tails:
     
    310311
    311312    def action_fire2(self):
    312         if not self.check_fire_rate():
     313        if self._me.shape != 'fox' or not self.check_fire_rate():
    313314            return
    314315        if "lightning" not in self._me.tails:
Note: See TracChangeset for help on using the changeset viewer.