From 14e5033c2d19c150cbaedd81cbc402a559449686 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Sun, 25 Mar 2012 13:56:55 -0400 Subject: [PATCH] battleman.py: Fixed recharge rolling, added message when roll succeeds --- battleman.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/battleman.py b/battleman.py index 39e722b..c8a09e9 100755 --- a/battleman.py +++ b/battleman.py @@ -198,14 +198,15 @@ class Combatant(): else: print('{} is still affected by {} ({} round{} left).'.format(self, c['name'], c['duration'], 's'[c['duration']==1:])) - # fixme: print message when this succeeds - for r in self.recharges: - if r['used']: # fixme: this line breaks + # fixme - this rolls on the same turn the power is used. Need a way to avoid that. + for r in self.recharges.values(): + if r['used']: # Roll to recharge d = Dice.from_str('1d6') n = d.roll()['total'] if n >= r['value']: r['used'] = False + print('{} can use {} again!'.format(self, r['name'])) def damage(self, amount): @@ -735,6 +736,7 @@ def do_add_condition(data): c.add_condition(name, ctype, duration, end_type) +# fixme: if you pick someone with no conditions, you get stuck in a loop def do_remove_condition(data): if len(data) >= 1: c = battle.get_combatant(int(data[0])) @@ -752,6 +754,7 @@ def do_remove_condition(data): c.remove_condition(index) +# fixme: if you pick someone with no recharges, you get stuck in a loop def do_use_recharge_power(data): if len(data) >= 1: c = battle.get_combatant(int(data[0]))