From 8437071d3c3660bd744f220a7e66e25a6594df12 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Fri, 23 Mar 2012 17:12:00 -0400 Subject: [PATCH] battleman.py: Added informative messages when taking damage or gaining temporary hit points. --- battleman.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/battleman.py b/battleman.py index b26d405..8b8e4e7 100755 --- a/battleman.py +++ b/battleman.py @@ -165,6 +165,8 @@ class Combatant(): self.hp -= amount + print '{} took {} points of damage.'.format(self, amount) + if self.is_down(): print('{} is down!'.format(self)) elif self.is_bloodied() and not was_bloodied: @@ -198,6 +200,8 @@ class Combatant(): def add_temp_hp(self, amount): self.temp_hp += amount + print '{} gained {} temporary hit points.'.format(self, amount) + def use_surge(self, heal=True): if self.surges <= 0: @@ -349,7 +353,7 @@ class Battle(): else: ret = ret + '{}:\n'.format(g.name) for c in g.members: - ret = ret + '\t{}\n'.format(c) + ret = ret + ' {}\n'.format(c) return ret.rstrip() @@ -367,7 +371,7 @@ class Battle(): else: ret = ret + '{}:\n'.format(g.name) for c in g.members: - ret = ret + '\t{}\n'.format(c) + ret = ret + ' {}\n'.format(c) return ret.rstrip()