|
@@ -6,8 +6,8 @@ from intelligine.cst import TRANSPORTABLE, TRANSPORTER, ALIVE, CARRYING, CANT_CA
|
6
|
6
|
class TakeableEvent(Event):
|
7
|
7
|
|
8
|
8
|
def concern(self, object_id, context):
|
9
|
|
- return context.metas.states.have(object_id, [TRANSPORTER, ALIVE]) and \
|
10
|
|
- context.metas.states.dont_have(object_id, [CARRYING]) and not \
|
|
9
|
+ return context.metas.states.have_list(object_id, [TRANSPORTER, ALIVE]) and \
|
|
10
|
+ context.metas.states.dont_have(object_id, CARRYING) and not \
|
11
|
11
|
context.metas.value.get(CANT_CARRY_STILL, object_id, allow_empty=True)
|
12
|
12
|
|
13
|
13
|
def __init__(self, actions):
|
|
@@ -17,7 +17,7 @@ class TakeableEvent(Event):
|
17
|
17
|
def _object_match(self, object_id, context, parameters={}):
|
18
|
18
|
# TODO: Nettoyer (refact possible sur ces objets ont tel states, comme dans concern)
|
19
|
19
|
for obj_near_id in parameters['objects_ids_near']:
|
20
|
|
- if context.metas.states.have(obj_near_id, [TRANSPORTABLE]):
|
|
20
|
+ if context.metas.states.have(obj_near_id, TRANSPORTABLE):
|
21
|
21
|
if 'objects_ids_transportable' not in parameters:
|
22
|
22
|
parameters['objects_ids_transportable'] = []
|
23
|
23
|
parameters['objects_ids_transportable'].append(obj_near_id)
|