|
@@ -2,7 +2,7 @@ from intelligine.core.exceptions import NearNothingFound
|
2
|
2
|
from synergine.core.exceptions import NotConcernedEvent
|
3
|
3
|
from intelligine.synergy.event.src.NearEvent import NearEvent
|
4
|
4
|
from xyzworld.mechanism.ArroundMechanism import ArroundMechanism
|
5
|
|
-from intelligine.cst import ATTACKABLE, COLONY, COL_FIGHTER
|
|
5
|
+from intelligine.cst import ATTACKABLE, COLONY, COL_FIGHTER, BRAIN_PART_ATTACK
|
6
|
6
|
|
7
|
7
|
|
8
|
8
|
class NearAttackableEvent(NearEvent):
|
|
@@ -24,4 +24,8 @@ class NearAttackableEvent(NearEvent):
|
24
|
24
|
except NearNothingFound:
|
25
|
25
|
raise NotConcernedEvent()
|
26
|
26
|
|
|
27
|
+ brain_part = self._get_brain_part(context, object_id, BRAIN_PART_ATTACK)
|
|
28
|
+ if not brain_part.can_attack(context, object_id, parameters[self._near_name][0]):
|
|
29
|
+ raise NotConcernedEvent()
|
|
30
|
+
|
27
|
31
|
return parameters
|