diff --git a/battleman.py b/battleman.py index 562b8d1..7ee64b0 100755 --- a/battleman.py +++ b/battleman.py @@ -135,11 +135,10 @@ class Combatant(): self.hp -= amount - # fixme - should we change this output? if self.is_down(): - print('{} ({}) is down!'.format(self.name, self.index)) + print('{} is down!'.format(self)) elif self.is_bloodied() and not was_bloodied: - print('{} ({}) is bloodied! Remaining hp: {}'.format(self.name, self.index, self.hp)) + print('{} is bloodied!'.format(self)) def heal(self, amount): @@ -149,25 +148,35 @@ class Combatant(): if self.hp < 0: self.hp = 0 - self.hp = min(self.hp + amount, self.max_hp + self.temp_hp) + amount_healed = amount + if self.hp + amount_healed > self.max_hp: + amount_healed = self.max_hp - self.hp + + self.hp += amount_healed - # fixme - should we change this output? if was_down: - print('{} ({}) is conscious.'.format(self.name, self.index)) + print('{} regains consciousness.'.format(self)) + + print('{} regained {} hit points.'.format(self, amount_healed)) + if was_bloodied and not self.is_bloodied(): - print('{} ({}) is no longer bloodied.'.format(self.name, self.index)) + print('{} is no longer bloodied.'.format(self)) elif was_bloodied and self.is_bloodied(): - print('{} ({}) is still bloodied.'.format(self.name, self.index)) + print('{} is still bloodied.'.format(self)) def use_surge(self, heal=True): if self.surges <= 0: - print 'Error: {} has no healing surges'.format(self.name) + print 'Error: {} has no healing surges.'.format(self.name) return self.surges -= 1 - print '{} spent a healing surge'.format(self) - if (heal): + noheal = '' + if not heal: + noheal = " (but didn't regain hit points)" + print '{} spent a healing surge{}.'.format(self, noheal) + + if heal: self.heal(self.max_hp / 4) @@ -281,7 +290,7 @@ class Battle(): print '\nInitiative Roster:\n' for g in self.groups: - print '{} ({})'.format(g.name, g.init) # fixme - should we change this output? + print '{} ({})'.format(g.name, g.init) print '' self.next_round()