@@ -146,7 +146,7 @@ def set_constants(self, hero_constant):
146
146
147
147
def get_ability (self , ability_name ):
148
148
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 :
150
150
return ability
151
151
return None
152
152
@@ -346,7 +346,7 @@ def _handle_cast_ability(self, cast_abilities, my_or_opp):
346
346
347
347
def _get_ability_constants (self , name ):
348
348
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 :
350
350
return constant
351
351
352
352
def _update_heroes (self , heroes_list , main_hero_list ):
@@ -540,8 +540,8 @@ def get_impact_cells(self, ability_constant, start_cell, target_cell):
540
540
return impact_cells
541
541
542
542
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 )
545
545
546
546
@staticmethod
547
547
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=
748
748
affected_cells = set ()
749
749
for cell in cells :
750
750
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 :
752
752
return self .get_my_heroes_in_cells (cells )
753
753
return self ._get_opp_heroes_in_cells (cells )
754
754
0 commit comments