battleman.py: Did some code cleanup - removed unnecessary comments, 'implemented' do_sync()
This commit is contained in:
parent
22bb0255c1
commit
e3604bc7a8
33
battleman.py
33
battleman.py
|
@ -110,7 +110,6 @@ class CommandParser(cmd.Cmd):
|
||||||
print 'Error: Unrecognized command {}'.format(cmd)
|
print 'Error: Unrecognized command {}'.format(cmd)
|
||||||
|
|
||||||
|
|
||||||
# a
|
|
||||||
def do_add(self, line):
|
def do_add(self, line):
|
||||||
"""add [N]
|
"""add [N]
|
||||||
Add the specified number of groups"""
|
Add the specified number of groups"""
|
||||||
|
@ -127,7 +126,6 @@ class CommandParser(cmd.Cmd):
|
||||||
self.btl.add_group(CombatGroup.from_input())
|
self.btl.add_group(CombatGroup.from_input())
|
||||||
|
|
||||||
|
|
||||||
# b
|
|
||||||
def do_begin(self, line):
|
def do_begin(self, line):
|
||||||
"""begin
|
"""begin
|
||||||
Begins the battle. Rolls initiative for NPCs and prompts for PCs"""
|
Begins the battle. Rolls initiative for NPCs and prompts for PCs"""
|
||||||
|
@ -135,7 +133,6 @@ class CommandParser(cmd.Cmd):
|
||||||
self.btl.begin()
|
self.btl.begin()
|
||||||
|
|
||||||
|
|
||||||
# p
|
|
||||||
def do_print(self, line):
|
def do_print(self, line):
|
||||||
"""print [index]
|
"""print [index]
|
||||||
Print detailed info for combatant with index, or combatant or group with initiative"""
|
Print detailed info for combatant with index, or combatant or group with initiative"""
|
||||||
|
@ -152,7 +149,6 @@ class CommandParser(cmd.Cmd):
|
||||||
print self.btl.format_current_group()
|
print self.btl.format_current_group()
|
||||||
|
|
||||||
|
|
||||||
# l
|
|
||||||
def do_list(self, line):
|
def do_list(self, line):
|
||||||
"""list
|
"""list
|
||||||
Lists a summary of all of the combat groups and their members"""
|
Lists a summary of all of the combat groups and their members"""
|
||||||
|
@ -160,7 +156,6 @@ class CommandParser(cmd.Cmd):
|
||||||
print self.btl.format_combatants()
|
print self.btl.format_combatants()
|
||||||
|
|
||||||
|
|
||||||
# d
|
|
||||||
def do_damage(self, line):
|
def do_damage(self, line):
|
||||||
"""damage [index] [amount]
|
"""damage [index] [amount]
|
||||||
Deals damage to the specified combatant"""
|
Deals damage to the specified combatant"""
|
||||||
|
@ -179,7 +174,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.damage(amount)
|
c.damage(amount)
|
||||||
|
|
||||||
|
|
||||||
# h
|
|
||||||
def do_heal(self, line):
|
def do_heal(self, line):
|
||||||
"""heal [index] [amount]
|
"""heal [index] [amount]
|
||||||
Heal hit points for the specified combatant"""
|
Heal hit points for the specified combatant"""
|
||||||
|
@ -198,7 +192,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.heal(amount)
|
c.heal(amount)
|
||||||
|
|
||||||
|
|
||||||
# t
|
|
||||||
def do_temp(self, line):
|
def do_temp(self, line):
|
||||||
"""temp [index] [amount]
|
"""temp [index] [amount]
|
||||||
Add temporary hit points to the specified combatant"""
|
Add temporary hit points to the specified combatant"""
|
||||||
|
@ -217,7 +210,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.add_temp_hp(amount)
|
c.add_temp_hp(amount)
|
||||||
|
|
||||||
|
|
||||||
# T
|
|
||||||
def do_rmtemp(self, line):
|
def do_rmtemp(self, line):
|
||||||
"""rmtemp [index] [amount]
|
"""rmtemp [index] [amount]
|
||||||
Remove temporary hit points from the specified combatant"""
|
Remove temporary hit points from the specified combatant"""
|
||||||
|
@ -225,7 +217,6 @@ class CommandParser(cmd.Cmd):
|
||||||
do_stub()
|
do_stub()
|
||||||
|
|
||||||
|
|
||||||
# s, so
|
|
||||||
def do_surge(self, line):
|
def do_surge(self, line):
|
||||||
"""surge [index] [heal]
|
"""surge [index] [heal]
|
||||||
Combatant with index uses a healing surge. If heal is 0, don't heal the combatant"""
|
Combatant with index uses a healing surge. If heal is 0, don't heal the combatant"""
|
||||||
|
@ -242,7 +233,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.use_surge(heal)
|
c.use_surge(heal)
|
||||||
|
|
||||||
|
|
||||||
# sw
|
|
||||||
def do_wind(self, line):
|
def do_wind(self, line):
|
||||||
"""wind [index]
|
"""wind [index]
|
||||||
Use Second Wind for combatant"""
|
Use Second Wind for combatant"""
|
||||||
|
@ -255,7 +245,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.use_second_wind()
|
c.use_second_wind()
|
||||||
|
|
||||||
|
|
||||||
# c
|
|
||||||
def do_cond(self, line):
|
def do_cond(self, line):
|
||||||
"""cond [index] [name] [type] [duration] [start|end]
|
"""cond [index] [name] [type] [duration] [start|end]
|
||||||
Add a temporary condition to a combatant, optionally specifying the condition name, type (s or t), duration and what phase of the combatant's turn it expires on"""
|
Add a temporary condition to a combatant, optionally specifying the condition name, type (s or t), duration and what phase of the combatant's turn it expires on"""
|
||||||
|
@ -279,7 +268,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.add_condition(name, ctype, duration, end_type)
|
c.add_condition(name, ctype, duration, end_type)
|
||||||
|
|
||||||
|
|
||||||
# C
|
|
||||||
def do_rmcond(self, line):
|
def do_rmcond(self, line):
|
||||||
"""rmcond [index] [condition_index]
|
"""rmcond [index] [condition_index]
|
||||||
Remove a condition from a combatant early."""
|
Remove a condition from a combatant early."""
|
||||||
|
@ -302,7 +290,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.remove_condition(index)
|
c.remove_condition(index)
|
||||||
|
|
||||||
|
|
||||||
# r
|
|
||||||
def do_recharge(self, line):
|
def do_recharge(self, line):
|
||||||
"""recharge [index] [recharge_index]
|
"""recharge [index] [recharge_index]
|
||||||
Use a rechargable power"""
|
Use a rechargable power"""
|
||||||
|
@ -325,7 +312,6 @@ class CommandParser(cmd.Cmd):
|
||||||
c.use_recharge_power(index)
|
c.use_recharge_power(index)
|
||||||
|
|
||||||
|
|
||||||
# w
|
|
||||||
def do_wait(self, line):
|
def do_wait(self, line):
|
||||||
"""wait
|
"""wait
|
||||||
This function is still a stub"""
|
This function is still a stub"""
|
||||||
|
@ -333,7 +319,6 @@ class CommandParser(cmd.Cmd):
|
||||||
do_stub()
|
do_stub()
|
||||||
|
|
||||||
|
|
||||||
# W
|
|
||||||
def do_unwait(self, line):
|
def do_unwait(self, line):
|
||||||
"""unwait
|
"""unwait
|
||||||
This function is still a stub"""
|
This function is still a stub"""
|
||||||
|
@ -341,19 +326,25 @@ class CommandParser(cmd.Cmd):
|
||||||
do_stub()
|
do_stub()
|
||||||
|
|
||||||
|
|
||||||
# x
|
def do_next(self, line):
|
||||||
|
"""next
|
||||||
|
Steps to the next combatant in initiative order. This handles saving throws, effects that end at beginning and ends of turns, and round incrementing."""
|
||||||
|
self.btl.next_combatant()
|
||||||
|
|
||||||
|
|
||||||
def do_sync(self, line):
|
def do_sync(self, line):
|
||||||
"""sync
|
"""sync
|
||||||
This function is still a stub"""
|
This function is still a stub"""
|
||||||
|
|
||||||
do_stub()
|
# Since the postloop pickles & writes, we don't actually need to
|
||||||
|
# do a damn thing here - just let it be an 'empty' command.
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def do_EOF(self, line):
|
def do_EOF(self, line):
|
||||||
self.do_quit(line)
|
self.do_quit(line)
|
||||||
|
|
||||||
|
|
||||||
# q
|
|
||||||
def do_quit(self, line):
|
def do_quit(self, line):
|
||||||
"""quit
|
"""quit
|
||||||
Exits the program. If a battle is in progress, it is temporarily saved and can be resumed by running the program with --resume next time."""
|
Exits the program. If a battle is in progress, it is temporarily saved and can be resumed by running the program with --resume next time."""
|
||||||
|
@ -361,12 +352,6 @@ class CommandParser(cmd.Cmd):
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
# n
|
|
||||||
def do_next(self, line):
|
|
||||||
"""next
|
|
||||||
Steps to the next combatant in initiative order. This handles saving throws, effects that end at beginning and ends of turns, and round incrementing."""
|
|
||||||
self.btl.next_combatant()
|
|
||||||
|
|
||||||
|
|
||||||
def parse_data(line):
|
def parse_data(line):
|
||||||
data = line.split(' ')
|
data = line.split(' ')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user