battleman.py: Change list_ function names to format_, since they return strings instead of printing
This commit is contained in:
parent
fde1f34b30
commit
2bd533b27d
14
battleman.py
14
battleman.py
|
@ -214,7 +214,7 @@ class Battle():
|
||||||
ret = 'Battle not yet started\n\n'
|
ret = 'Battle not yet started\n\n'
|
||||||
|
|
||||||
ret = ret + 'Combatants\n==========\n'
|
ret = ret + 'Combatants\n==========\n'
|
||||||
ret = ret + self.list_combatants()
|
ret = ret + self.format_combatants()
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ class Battle():
|
||||||
|
|
||||||
|
|
||||||
# Returns a formatted string with all of the combatants
|
# Returns a formatted string with all of the combatants
|
||||||
def list_combatants(self):
|
def format_combatants(self):
|
||||||
ret = ''
|
ret = ''
|
||||||
|
|
||||||
for g in self.groups:
|
for g in self.groups:
|
||||||
|
@ -274,7 +274,7 @@ class Battle():
|
||||||
|
|
||||||
|
|
||||||
# Returns a formatted string with all of the combatants
|
# Returns a formatted string with all of the combatants
|
||||||
def list_current_group(self):
|
def format_current_group(self):
|
||||||
ret = ''
|
ret = ''
|
||||||
|
|
||||||
g = self.groups[current]
|
g = self.groups[current]
|
||||||
|
@ -364,9 +364,9 @@ def do_prompt():
|
||||||
elif comm == 'a':
|
elif comm == 'a':
|
||||||
print('Sorry, this is still a stub function.')
|
print('Sorry, this is still a stub function.')
|
||||||
elif comm == 'l':
|
elif comm == 'l':
|
||||||
print battle.list_combatants()
|
print battle.format_combatants()
|
||||||
elif comm == 'l':
|
elif comm == 'l':
|
||||||
print battle.list_current_group()
|
print battle.format_current_group()
|
||||||
elif comm == 'b':
|
elif comm == 'b':
|
||||||
battle.begin()
|
battle.begin()
|
||||||
elif comm == 'd':
|
elif comm == 'd':
|
||||||
|
@ -388,14 +388,14 @@ def do_prompt():
|
||||||
|
|
||||||
|
|
||||||
def do_damage():
|
def do_damage():
|
||||||
print battle.list_combatants()
|
print battle.format_combatants()
|
||||||
index = input_int('choose combatant')
|
index = input_int('choose combatant')
|
||||||
amount = input_int('damage')
|
amount = input_int('damage')
|
||||||
battle.deal_damage(index, amount)
|
battle.deal_damage(index, amount)
|
||||||
|
|
||||||
|
|
||||||
def do_heal():
|
def do_heal():
|
||||||
print battle.list_combatants()
|
print battle.format_combatants()
|
||||||
index = input_int('choose combatant')
|
index = input_int('choose combatant')
|
||||||
amount = input_int('amount')
|
amount = input_int('amount')
|
||||||
battle.heal_damage(index, amount)
|
battle.heal_damage(index, amount)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user