Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
taslimisina committed Jan 30, 2020
2 parents fc90340 + 2dfd186 commit 7739412
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions world.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ def get_player_units(self, player_id):

# return a list of units in a cell
def get_cell_units(self, cell=None, row=None, col=None):
if cell == None:
if row == None and col == None:
if cell is None:
if row is None and col is None:
return None
cell = self.map.get_cell(row, col)
return cell.units
Expand Down Expand Up @@ -674,11 +674,19 @@ def get_player_died_units(self, player_id):
return self.get_player_by_id(player_id).dead_units

def has_player_used_ranged_upgrade(self, player_id):
if self.turn_updates.got_range_upgrade is not None:
return True
for u in self.get_player_by_id(player_id).dead_units:
if u.was_range_upgraded:
return True
for u in self.get_player_by_id(player_id).units:
if u.was_range_upgraded:
return True
return False

def has_player_used_damage_upgrade(self, player_id):
if self.turn_updates.got_damage_upgrade is not None:
return True
for u in self.get_player_by_id(player_id).dead_units:
if u.was_damage_upgraded:
return True
for u in self.get_player_by_id(player_id).units:
if u.was_damage_upgraded:
return True
return False

0 comments on commit 7739412

Please sign in to comment.