battleman.py: Factored next round code into a separate function

This commit is contained in:
Anna Rose 2012-03-22 18:09:09 -04:00
parent e6e22d775c
commit 84f66955a7

View File

@ -274,13 +274,20 @@ class Battle():
if self.current >= len(self.groups):
self.current = 0
self.round += 1
print('Beginning round {}'.format(self.round))
self.next_round()
g = self.get_current_group()
g.begin_turn()
def next_round(self):
if self.round == None:
self.round = 1
else:
self.round += 1
print('Beginning round {}'.format(self.round))
def deal_damage(self, index, amount):
c = self.combatant_hash[index]
c.damage(amount)