Mercurial > nagslang
changeset 538:e5ad08f5e268
More prohibited action warnings.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 21:13:17 +0200 |
parents | 35e3c5ca99fd |
children | 37f018f70758 |
files | nagslang/protagonist.py |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/nagslang/protagonist.py Sat Sep 07 21:05:41 2013 +0200 +++ b/nagslang/protagonist.py Sat Sep 07 21:13:17 2013 +0200 @@ -189,7 +189,11 @@ return obj def handle_attack_key_down(self): - if self.changing_sequence or self.check_timer('attack_cooldown'): + if self.changing_sequence: + self.fire_note( + "You can't do anything until your form has stabilised.") + return + if self.check_timer('attack_cooldown'): return self.start_timer('attack_cooldown') self.world.attacks += 1 @@ -197,7 +201,8 @@ def handle_keypress(self, key_command): if self.changing_sequence: - return + self.fire_note( + "You can't do anything until your form has stabilised.") if key_command == CMD_TOGGLE_FORM: self.world.transformations += 1 self.toggle_form() @@ -301,7 +306,7 @@ def shoot(self): if not self.has_item('gun'): - AddDrawableEvent.post(EphemeralNote('You are not armed.', 1)) + self.fire_note('You are not armed.') return vec = vec_from_angle(self.angle, BULLET_SPEED) return Result(add=(Bullet(self.get_space(), self.physicser.position, @@ -374,3 +379,6 @@ if self.in_human_form() and not self.changing_sequence: self.toggle_form() self.start_timer('change_delay') + + def fire_note(self, msg, secs=1): + AddDrawableEvent.post(EphemeralNote(msg, secs))