| Total Complexity | 4 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from synergine.synergy.event.Action import Action |
||
| 6 | class NearAttackableAction(Action): |
||
| 7 | |||
| 8 | _listen = NearAttackableEvent |
||
| 9 | |||
| 10 | def __init__(self, object_id, parameters): |
||
| 11 | super().__init__(object_id, parameters) |
||
| 12 | |||
| 13 | def prepare(self, context): |
||
| 14 | pass |
||
| 15 | |||
| 16 | def run(self, obj, context, synergy_manager): |
||
| 17 | # TODO: reprendre ? |
||
| 18 | for obj_id_attackable in self._parameters['objects_ids_attackable']: |
||
| 19 | obj_attackable = synergy_manager.get_map().get_object(obj_id_attackable) |
||
| 20 | obj_attackable.hurted(randint(0, 2)) |
||
| 21 |