| Conditions | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from intelligine.synergy.event.move.MoveAction import MoveAction |
||
| 17 | def run(self, obj, context, synergy_manager): |
||
| 18 | obj_id_transportable = self._parameters[TakeableEvent.PARAM_TAKE] |
||
| 19 | obj_transportable = synergy_manager.get_map().get_object(obj_id_transportable) |
||
| 20 | |||
| 21 | if not obj_transportable.is_takable(): |
||
| 22 | raise ActionAborted() |
||
| 23 | |||
| 24 | obj_carried = obj_transportable.get_what_carry() |
||
| 25 | obj_carried.set_carried_by(obj) |
||
| 26 | obj.carry(obj_carried) |
||
| 27 | cant_put_still = Core.get_configuration_manager().get('ant.take.cant_put_still') |
||
| 28 | context.metas.value.set(CANT_PUT_STILL, obj.get_id(), cant_put_still) |
||
| 29 | obj.get_brain().get_part(BRAIN_PART_TAKE).done(obj_carried) |
||
| 30 |