|
@@ -1,8 +1,8 @@
|
1
|
1
|
from intelligine.core.exceptions import PheromoneException
|
2
|
2
|
from intelligine.synergy.object.Bug import Bug
|
3
|
3
|
from intelligine.cst import CARRYING, TRANSPORTER, ATTACKER, COL_TRANSPORTER, COL_TRANSPORTER_NOT_CARRYING, \
|
4
|
|
- COL_FIGHTER, MOVE_MODE_EXPLO, MOVE_MODE_GOHOME, CARRIED, BODY_PART_PHEROMONE_GLAND, TYPE, TYPE_ANT, \
|
5
|
|
- COL_TRANSPORTER_CARRYING
|
|
4
|
+ COL_FIGHTER, MOVE_MODE_EXPLO, MOVE_MODE_GOHOME, BODY_PART_PHEROMONE_GLAND, TYPE, TYPE_ANT, \
|
|
5
|
+ COL_TRANSPORTER_CARRYING, MOVE_MODE_NURSE
|
6
|
6
|
from intelligine.synergy.object.Food import Food
|
7
|
7
|
from intelligine.simulation.object.pheromone.MovementPheromoneGland import MovementPheromoneGland
|
8
|
8
|
from intelligine.simulation.object.brain.AntBrain import AntBrain
|
|
@@ -44,7 +44,10 @@ class Ant(Bug):
|
44
|
44
|
position = self._get_position()
|
45
|
45
|
self._carried = None
|
46
|
46
|
obj.set_position(position)
|
|
47
|
+ obj.set_is_carried(False, self)
|
47
|
48
|
self._context.metas.states.remove(self.get_id(), CARRYING)
|
|
49
|
+ self._add_col(COL_TRANSPORTER_NOT_CARRYING)
|
|
50
|
+ self._remove_col(COL_TRANSPORTER_CARRYING)
|
48
|
51
|
|
49
|
52
|
def get_carried(self):
|
50
|
53
|
return self._carried
|
|
@@ -52,7 +55,9 @@ class Ant(Bug):
|
52
|
55
|
def carry(self, obj):
|
53
|
56
|
self._carried = obj
|
54
|
57
|
self._context.metas.states.add(self.get_id(), CARRYING)
|
55
|
|
- self._context.metas.value.set(CARRIED, self.get_id(), obj.get_id())
|
|
58
|
+ self._add_col(COL_TRANSPORTER_CARRYING)
|
|
59
|
+ self._remove_col(COL_TRANSPORTER_NOT_CARRYING)
|
|
60
|
+ obj.set_is_carried(True, self)
|
56
|
61
|
# TODO: pour le moment hardcode, a gerer dans AntTakeBrainPart (callback en fct de ce qui est depose)
|
57
|
62
|
if isinstance(obj, Food):
|
58
|
63
|
self.get_brain().switch_to_mode(MOVE_MODE_GOHOME)
|