Add code for printing full info for arbitrary combatants.
This commit is contained in:
parent
2cd5120ec0
commit
a2151557b1
13
battleman.py
13
battleman.py
|
@ -572,7 +572,7 @@ def do_prompt():
|
||||||
elif comm == 'a':
|
elif comm == 'a':
|
||||||
do_add_combatants(data)
|
do_add_combatants(data)
|
||||||
elif comm == 'p':
|
elif comm == 'p':
|
||||||
print battle.format_current_group()
|
do_print_combatant_info(data)
|
||||||
elif comm == 'l':
|
elif comm == 'l':
|
||||||
print battle.format_combatants()
|
print battle.format_combatants()
|
||||||
elif comm == 'b':
|
elif comm == 'b':
|
||||||
|
@ -635,6 +635,17 @@ def do_add_combatants(data):
|
||||||
battle.add_group(CombatGroup.from_input())
|
battle.add_group(CombatGroup.from_input())
|
||||||
|
|
||||||
|
|
||||||
|
def do_print_combatant_info(data):
|
||||||
|
if len(data) >= 1:
|
||||||
|
c = battle.get_combatant(int(data[0]))
|
||||||
|
if not c:
|
||||||
|
print('Error: Invalid combatant index.')
|
||||||
|
else:
|
||||||
|
print c.format_full_info()
|
||||||
|
else:
|
||||||
|
print battle.format_current_group()
|
||||||
|
|
||||||
|
|
||||||
def do_damage(data):
|
def do_damage(data):
|
||||||
if len(data) >= 1:
|
if len(data) >= 1:
|
||||||
c = battle.get_combatant(int(data[0]))
|
c = battle.get_combatant(int(data[0]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user