battleman.py: Added recharge power rerolling, improved recharge inputting.
This commit is contained in:
parent
1da238be5a
commit
fddb2bf8bb
22
battleman.py
22
battleman.py
|
@ -30,13 +30,17 @@ class CombatGroup():
|
|||
surges = input_int('healing surges', 0)
|
||||
|
||||
recharges = []
|
||||
recharge = ['']
|
||||
while True:
|
||||
recharge = input_str("recharge", default='').split(',')
|
||||
if recharge == ['']:
|
||||
break
|
||||
else:
|
||||
data = []
|
||||
data = input_str("recharge", default='').split(',')
|
||||
if len(data) == 2:
|
||||
recharge = {}
|
||||
recharge['name'] = data[0]
|
||||
recharge['value'] = int(data[1])
|
||||
recharge['used'] = False
|
||||
recharges.append(recharge)
|
||||
else:
|
||||
break
|
||||
|
||||
count = input_int('count', 1)
|
||||
|
||||
|
@ -188,7 +192,13 @@ class Combatant():
|
|||
else:
|
||||
print('{} is still affected by {} ({} round{} left).'.format(self, c['name'], c['duration'], 's'[c['duration']==1:]))
|
||||
|
||||
# fixme: still need to add recharges
|
||||
for r in self.recharges:
|
||||
if r['used']:
|
||||
# Roll to recharge
|
||||
d = Dice.from_str('1d6')
|
||||
n = d.roll()['total']
|
||||
if n >= r['value']:
|
||||
r['used'] = False
|
||||
|
||||
|
||||
def damage(self, amount):
|
||||
|
|
Loading…
Reference in New Issue
Block a user