battleman.py: Did some code cleanup - removed unnecessary comments, 'implemented' do_sync()
This commit is contained in:
parent
22bb0255c1
commit
e3604bc7a8
35
battleman.py
35
battleman.py
|
@ -110,7 +110,6 @@ class CommandParser(cmd.Cmd):
|
|||
print 'Error: Unrecognized command {}'.format(cmd)
|
||||
|
||||
|
||||
# a
|
||||
def do_add(self, line):
|
||||
"""add [N]
|
||||
Add the specified number of groups"""
|
||||
|
@ -127,7 +126,6 @@ class CommandParser(cmd.Cmd):
|
|||
self.btl.add_group(CombatGroup.from_input())
|
||||
|
||||
|
||||
# b
|
||||
def do_begin(self, line):
|
||||
"""begin
|
||||
Begins the battle. Rolls initiative for NPCs and prompts for PCs"""
|
||||
|
@ -135,7 +133,6 @@ class CommandParser(cmd.Cmd):
|
|||
self.btl.begin()
|
||||
|
||||
|
||||
# p
|
||||
def do_print(self, line):
|
||||
"""print [index]
|
||||
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()
|
||||
|
||||
|
||||
# l
|
||||
def do_list(self, line):
|
||||
"""list
|
||||
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()
|
||||
|
||||
|
||||
# d
|
||||
def do_damage(self, line):
|
||||
"""damage [index] [amount]
|
||||
Deals damage to the specified combatant"""
|
||||
|
@ -179,7 +174,6 @@ class CommandParser(cmd.Cmd):
|
|||
c.damage(amount)
|
||||
|
||||
|
||||
# h
|
||||
def do_heal(self, line):
|
||||
"""heal [index] [amount]
|
||||
Heal hit points for the specified combatant"""
|
||||
|
@ -198,7 +192,6 @@ class CommandParser(cmd.Cmd):
|
|||
c.heal(amount)
|
||||
|
||||
|
||||
# t
|
||||
def do_temp(self, line):
|
||||
"""temp [index] [amount]
|
||||
Add temporary hit points to the specified combatant"""
|
||||
|
@ -217,7 +210,6 @@ class CommandParser(cmd.Cmd):
|
|||
c.add_temp_hp(amount)
|
||||
|
||||
|
||||
# T
|
||||
def do_rmtemp(self, line):
|
||||
"""rmtemp [index] [amount]
|
||||
Remove temporary hit points from the specified combatant"""
|
||||
|
@ -225,7 +217,6 @@ class CommandParser(cmd.Cmd):
|
|||
do_stub()
|
||||
|
||||
|
||||
# s, so
|
||||
def do_surge(self, line):
|
||||
"""surge [index] [heal]
|
||||
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)
|
||||
|
||||
|
||||
# sw
|
||||
def do_wind(self, line):
|
||||
"""wind [index]
|
||||
Use Second Wind for combatant"""
|
||||
|
@ -255,7 +245,6 @@ class CommandParser(cmd.Cmd):
|
|||
c.use_second_wind()
|
||||
|
||||
|
||||
# c
|
||||
def do_cond(self, line):
|
||||
"""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"""
|
||||
|
@ -279,7 +268,6 @@ class CommandParser(cmd.Cmd):
|
|||
c.add_condition(name, ctype, duration, end_type)
|
||||
|
||||
|
||||
# C
|
||||
def do_rmcond(self, line):
|
||||
"""rmcond [index] [condition_index]
|
||||
Remove a condition from a combatant early."""
|
||||
|
@ -302,7 +290,6 @@ class CommandParser(cmd.Cmd):
|
|||
c.remove_condition(index)
|
||||
|
||||
|
||||
# r
|
||||
def do_recharge(self, line):
|
||||
"""recharge [index] [recharge_index]
|
||||
Use a rechargable power"""
|
||||
|
@ -325,7 +312,6 @@ class CommandParser(cmd.Cmd):
|
|||
c.use_recharge_power(index)
|
||||
|
||||
|
||||
# w
|
||||
def do_wait(self, line):
|
||||
"""wait
|
||||
This function is still a stub"""
|
||||
|
@ -333,7 +319,6 @@ class CommandParser(cmd.Cmd):
|
|||
do_stub()
|
||||
|
||||
|
||||
# W
|
||||
def do_unwait(self, line):
|
||||
"""unwait
|
||||
This function is still a stub"""
|
||||
|
@ -341,19 +326,25 @@ class CommandParser(cmd.Cmd):
|
|||
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):
|
||||
"""sync
|
||||
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):
|
||||
self.do_quit(line)
|
||||
|
||||
|
||||
# q
|
||||
def do_quit(self, line):
|
||||
"""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."""
|
||||
|
@ -361,12 +352,6 @@ class CommandParser(cmd.Cmd):
|
|||
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):
|
||||
data = line.split(' ')
|
||||
|
|
Loading…
Reference in New Issue
Block a user