Skip to content

Commit 8ad7b75

Browse files
author
AH-Pooya
committed
Heal is Defensive
1 parent 79d7c16 commit 8ad7b75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Model.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def set_constants(self, hero_constant):
146146

147147
def get_ability(self, ability_name):
148148
for ability in self.abilities:
149-
if ability.name == ability_name:
149+
if ability_name is AbilityName and ability_name.value == ability.name or ability.name == ability_name:
150150
return ability
151151
return None
152152

@@ -346,7 +346,7 @@ def _handle_cast_ability(self, cast_abilities, my_or_opp):
346346

347347
def _get_ability_constants(self, name):
348348
for constant in self.ability_constants:
349-
if constant.name == name:
349+
if name is AbilityName and name.value == constant.name or constant.name == name:
350350
return constant
351351

352352
def _update_heroes(self, heroes_list, main_hero_list):
@@ -540,8 +540,8 @@ def get_impact_cells(self, ability_constant, start_cell, target_cell):
540540
return impact_cells
541541

542542
def is_affected(self, ability_constant, cell):
543-
return (self._get_opp_hero(cell) is not None and not ability_constant.type == AbilityType.HEAL) or (
544-
self._get_my_hero(cell) is not None and ability_constant.type == AbilityType.HEAL)
543+
return (self._get_opp_hero(cell) is not None and not ability_constant.type == AbilityType.DEFENSIVE) or (
544+
self._get_my_hero(cell) is not None and ability_constant.type == AbilityType.DEFENSIVE)
545545

546546
@staticmethod
547547
def manhattan_distance(start_cell=None, end_cell=None, start_cell_row=None, start_cell_column=None,
@@ -748,7 +748,7 @@ def get_ability_targets(self, ability_name=None, ability=None, ability_constant=
748748
affected_cells = set()
749749
for cell in cells:
750750
affected_cells.update(self.get_cells_in_aoe(cell, ability_constant.area_of_effect))
751-
if ability_constant.type == AbilityType.HEAL:
751+
if ability_constant.type == AbilityType.DEFENSIVE:
752752
return self.get_my_heroes_in_cells(cells)
753753
return self._get_opp_heroes_in_cells(cells)
754754

0 commit comments

Comments
 (0)