battleman.py: Fixed a couple simple errors that cropped in with the switch to cmd
This commit is contained in:
parent
007b033bdd
commit
db5ceef1a8
36
battleman.py
36
battleman.py
|
@ -101,7 +101,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""add [N]
|
||||
Add the specified number of groups"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
if len(data) >= 1:
|
||||
num_groups = int(data[0])
|
||||
|
@ -126,7 +126,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""print [index]
|
||||
Print detailed info for combatant with index, or combatant or group with initiative"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
if len(data) >= 1:
|
||||
c = self.btl.get_combatant(int(data[0]))
|
||||
|
@ -151,7 +151,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""damage [index] [amount]
|
||||
Deals damage to the specified combatant"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
c = battle.do_combatant_select(self.btl, data)
|
||||
if not c:
|
||||
|
@ -162,7 +162,7 @@ class CommandParser(cmd.Cmd):
|
|||
else:
|
||||
amount = easyinput.input_int('damage')
|
||||
|
||||
c.damage(amount)
|
||||
c.damage(amount)
|
||||
|
||||
|
||||
# h
|
||||
|
@ -170,7 +170,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""heal [index] [amount]
|
||||
Heal hit points for the specified combatant"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
c = battle.do_combatant_select(self.btl, data)
|
||||
if not c:
|
||||
|
@ -189,7 +189,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""temp [index] [amount]
|
||||
Add temporary hit points to the specified combatant"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
c = battle.do_combatant_select(self.btl, data)
|
||||
if not c:
|
||||
|
@ -216,7 +216,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""surge [index] [heal]
|
||||
Combatant with index uses a healing surge. If heal is 0, don't heal the combatant"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
c = battle.do_combatant_select(self.btl, data)
|
||||
if not c:
|
||||
|
@ -233,7 +233,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""wind [index]
|
||||
Use Second Wind for combatant"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
c = battle.do_combatant_select(self.btl, data)
|
||||
if not c:
|
||||
|
@ -246,7 +246,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""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"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
duration = None
|
||||
end_type = 'e'
|
||||
|
@ -270,7 +270,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""rmcond [index] [condition_index]
|
||||
Remove a condition from a combatant early."""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
c = battle.do_combatant_select(self.btl, data)
|
||||
if not c:
|
||||
|
@ -293,7 +293,7 @@ class CommandParser(cmd.Cmd):
|
|||
"""recharge [index] [recharge_index]
|
||||
Use a rechargable power"""
|
||||
|
||||
data = line.split(' ')
|
||||
data = parse_data(line)
|
||||
|
||||
c = battle.do_combatant_select(self.btl, data)
|
||||
if not c:
|
||||
|
@ -347,6 +347,20 @@ 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(' ')
|
||||
if data == ['']:
|
||||
data = []
|
||||
return data
|
||||
|
||||
|
||||
def do_stub():
|
||||
print "Sorry, this is a stub function"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user