diff --git a/data/scenarios/Challenges/Ranching/pied-piper.yaml b/data/scenarios/Challenges/Ranching/pied-piper.yaml index 10fbbb58f..b65736868 100644 --- a/data/scenarios/Challenges/Ranching/pied-piper.yaml +++ b/data/scenarios/Challenges/Ranching/pied-piper.yaml @@ -164,7 +164,7 @@ entities: char: 'k' description: - Used by an `unlocker`{=entity} to open a a `locked door`{=entity} - properties: [known] + properties: [known, pickable] - name: unlocker display: char: 'u' @@ -190,7 +190,7 @@ entities: attr: wood description: - wall - properties: [known, unwalkable] + properties: [known, unwalkable, boundary] - name: oats display: attr: oats diff --git a/data/scenarios/Testing/00-ORDER.txt b/data/scenarios/Testing/00-ORDER.txt index c662b7c16..5c9e4dc25 100644 --- a/data/scenarios/Testing/00-ORDER.txt +++ b/data/scenarios/Testing/00-ORDER.txt @@ -70,3 +70,4 @@ Achievements 231-requirements 2085-toplevel-mask.yaml 2086-structure-palette.yaml +2239-custom-entity.yaml diff --git a/data/scenarios/Testing/2239-custom-entity.yaml b/data/scenarios/Testing/2239-custom-entity.yaml new file mode 100644 index 000000000..9057775d5 --- /dev/null +++ b/data/scenarios/Testing/2239-custom-entity.yaml @@ -0,0 +1,42 @@ +version: 1 +name: Custom entity +description: | + Custom entity overriding standard entity +creative: false +objectives: + - goal: + - Move to (1,0) + condition: | + as base { + loc <- whereami; + return $ loc == (1,0) + }; +entities: + - name: rock + display: + char: '$' + attr: gold + description: + - Not your average rock! + properties: [pickable] + capabilities: [move] +robots: + - name: base + dir: east + devices: + - logger + - grabber + - welder +solution: | + grab; + equip "rock"; + move +known: [rock] +world: + dsl: | + {grass} + palette: + 'B': [grass, rock, base] + upperleft: [0, 0] + map: | + B diff --git a/src/swarm-scenario/Swarm/Game/Entity.hs b/src/swarm-scenario/Swarm/Game/Entity.hs index 2b88b0a4b..2cb29f199 100644 --- a/src/swarm-scenario/Swarm/Game/Entity.hs +++ b/src/swarm-scenario/Swarm/Game/Entity.hs @@ -436,7 +436,7 @@ data EntityMap = EntityMap instance Semigroup EntityMap where EntityMap n1 c1 d1 <> EntityMap n2 c2 d2 = EntityMap - (n1 <> n2) + (n2 <> n1) (c1 <> c2) (filter ((`M.notMember` n2) . view entityName) d1 <> d2)