# HG changeset patch # User Jeremy Thurgood # Date 1378581197 -7200 # Node ID e5ad08f5e2681110b4cbeb06c969196c7f1b8b1a # Parent 35e3c5ca99fda5479f27403ea7e93ae0a1a7ff2d More prohibited action warnings. diff -r 35e3c5ca99fd -r e5ad08f5e268 nagslang/protagonist.py --- 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))