From db2d56a0ea2ac661367084276a74ff45ca247520 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 22:44:47 +0200 Subject: [PATCH] Ludicrously generic bits. --- naja/actions.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/naja/actions.py b/naja/actions.py index 5701109..4d4a0f0 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -155,6 +155,7 @@ class GenericBits(LocationAction): self.once = self.data.get('once', False) self.acquire_win = self.data.get('acquire_win', False) self.lose_health = self.data.get('lose_health', False) + self.gain_health = self.data.get('gain_health', False) def sanity_check(self, location): missing_bits = set() @@ -177,6 +178,9 @@ class GenericBits(LocationAction): if self.lose_health: sound.play_sound('awwww.ogg') board.lose_health() + if self.gain_health: + sound.play_sound('aha.ogg') + board.gain_health() if self.once: location.actions.remove(self) @@ -186,6 +190,8 @@ class GenericBits(LocationAction): glyphs.append(ACTION_GLYPHS.WINTOKEN) if self.lose_health: glyphs.append(ACTION_GLYPHS.DAMAGE) + if self.gain_health: + glyphs.append(ACTION_GLYPHS.HEAL) if self.set_bits: glyphs.append(ACTION_GLYPHS.SET_BITS) if self.clear_bits: @@ -199,9 +205,11 @@ class GenericBits(LocationAction): return super(GenericBits, self).get_text() parts = [] if self.acquire_win: - parts.append("Gain a {WINTOKEN}.") + parts.append("Gain {WINTOKEN}.") if self.lose_health: parts.append("Lose {HEALTH}.") + if self.gain_health: + parts.append("Gain {HEALTH}.") for template, bits in [ ('Set %s.', self.set_bits), ('Clear %s.', self.clear_bits), ('Toggle %s.', self.toggle_bits)]: -- 2.34.1