battleman.py: Factored next round code into a separate function
This commit is contained in:
parent
e6e22d775c
commit
84f66955a7
11
battleman.py
11
battleman.py
|
@ -274,13 +274,20 @@ class Battle():
|
||||||
|
|
||||||
if self.current >= len(self.groups):
|
if self.current >= len(self.groups):
|
||||||
self.current = 0
|
self.current = 0
|
||||||
self.round += 1
|
self.next_round()
|
||||||
print('Beginning round {}'.format(self.round))
|
|
||||||
|
|
||||||
g = self.get_current_group()
|
g = self.get_current_group()
|
||||||
g.begin_turn()
|
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):
|
def deal_damage(self, index, amount):
|
||||||
c = self.combatant_hash[index]
|
c = self.combatant_hash[index]
|
||||||
c.damage(amount)
|
c.damage(amount)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user