battleman.py: Refactored stub functions

This commit is contained in:
Anna Rose 2012-03-23 21:57:08 -04:00
parent efff42c306
commit cd2c915e87

View File

@ -511,7 +511,7 @@ def do_prompt():
elif comm == 't': elif comm == 't':
do_add_temp_hp(data) do_add_temp_hp(data)
elif comm == 'T': elif comm == 'T':
print('Sorry, this is still a stub function.') do_remove_temp_hp(data)
elif comm == 's': elif comm == 's':
do_surge(data) do_surge(data)
elif comm == 'so': elif comm == 'so':
@ -525,8 +525,9 @@ def do_prompt():
elif comm == 'n': elif comm == 'n':
battle.next_combatant() battle.next_combatant()
elif comm == 'w': elif comm == 'w':
print('Sorry, this is still a stub function.') do_wait(data)
elif comm == 'W': elif comm == 'W':
do_unwait(data)
print('Sorry, this is still a stub function.') print('Sorry, this is still a stub function.')
elif comm == 'q': elif comm == 'q':
sys.exit(0) sys.exit(0)
@ -612,6 +613,10 @@ def do_add_temp_hp(data):
c.add_temp_hp(amount) c.add_temp_hp(amount)
def do_remove_temp_hp(data):
do_stub()
def do_surge(data, heal=True): def do_surge(data, heal=True):
if len(data) >= 1: if len(data) >= 1:
c = battle.get_combatant(int(data[0])) c = battle.get_combatant(int(data[0]))
@ -680,6 +685,18 @@ def do_remove_condition(data):
c.remove_condition(index) c.remove_condition(index)
def do_wait(data):
do_stub()
def do_unwait(data):
do_stub()
def do_stub():
print("Sorry, this is a stub function")
def input_str(prompt, default=None, show_default=False, prompt_str=':'): def input_str(prompt, default=None, show_default=False, prompt_str=':'):
full_prompt = prompt full_prompt = prompt
if default != None and show_default: if default != None and show_default: