From 84f66955a7a3422703a5dab83bfda14af9886f7e Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 22 Mar 2012 18:09:09 -0400 Subject: [PATCH] battleman.py: Factored next round code into a separate function --- battleman.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/battleman.py b/battleman.py index a94416d..f0e59c1 100755 --- a/battleman.py +++ b/battleman.py @@ -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)