mirror of
https://github.com/swarm-game/swarm.git
synced 2024-09-11 14:46:33 +03:00
parent
13ae996306
commit
b158251a20
@ -53,3 +53,4 @@ Achievements
|
||||
1575-structure-recognizer
|
||||
1631-tags.yaml
|
||||
1634-message-colors.yaml
|
||||
1681-pushable-entity.yaml
|
57
data/scenarios/Testing/1681-pushable-entity.yaml
Normal file
57
data/scenarios/Testing/1681-pushable-entity.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
version: 1
|
||||
name: Push test
|
||||
creative: false
|
||||
description: Push item
|
||||
objectives:
|
||||
- goal:
|
||||
- Push a crate onto the stone pad
|
||||
condition: |
|
||||
j <- robotnamed "judge";
|
||||
as j {ishere "crate"}
|
||||
solution: |
|
||||
move;
|
||||
push;
|
||||
robots:
|
||||
- name: base
|
||||
dir: [1, 0]
|
||||
display:
|
||||
char: Ω
|
||||
attr: robot
|
||||
devices:
|
||||
- branch predictor
|
||||
- calculator
|
||||
- compass
|
||||
- dictionary
|
||||
- grabber
|
||||
- logger
|
||||
- net
|
||||
- scanner
|
||||
- treads
|
||||
- dozer blade
|
||||
- name: judge
|
||||
dir: [0, 1]
|
||||
system: true
|
||||
display:
|
||||
char: j
|
||||
attr: robot
|
||||
invisible: true
|
||||
entities:
|
||||
- name: crate
|
||||
display:
|
||||
attr: wood
|
||||
char: 'c'
|
||||
description:
|
||||
- Pushable crate
|
||||
properties: [known, pushable]
|
||||
known: [water]
|
||||
world:
|
||||
dsl: |
|
||||
{water}
|
||||
palette:
|
||||
'Ω': [grass, erase, base]
|
||||
'j': [stone, erase, judge]
|
||||
'.': [grass, erase]
|
||||
'x': [grass, crate]
|
||||
upperleft: [0, 0]
|
||||
map: |
|
||||
Ωxxj
|
@ -141,6 +141,8 @@ data EntityProperty
|
||||
Unwalkable
|
||||
| -- | Robots can pick this up (via 'Swarm.Language.Syntax.Grab' or 'Swarm.Language.Syntax.Harvest').
|
||||
Portable
|
||||
| -- | Robots can 'Swarm.Language.Syntax.Push' this
|
||||
Pushable
|
||||
| -- | Obstructs the view of robots that attempt to "scout"
|
||||
Opaque
|
||||
| -- | Regrows from a seed after it is harvested.
|
||||
|
@ -187,7 +187,7 @@ execConst runChildProg c vs s k = do
|
||||
let verbed = verbedGrabbingCmd Push'
|
||||
-- Ensure it can be pushed.
|
||||
omni <- isPrivilegedBot
|
||||
(omni || e `hasProperty` Portable && not (e `hasProperty` Liquid))
|
||||
(omni || e `hasProperty` Pushable || e `hasProperty` Portable && not (e `hasProperty` Liquid))
|
||||
`holdsOrFail` ["The", e ^. entityName, "here can't be", verbed <> "."]
|
||||
|
||||
-- Place the entity and remove it from previous loc
|
||||
|
@ -1188,6 +1188,7 @@ displayProperties :: [EntityProperty] -> Widget Name
|
||||
displayProperties = displayList . mapMaybe showProperty
|
||||
where
|
||||
showProperty Growable = Just "growing"
|
||||
showProperty Pushable = Just "pushable"
|
||||
showProperty Combustible = Just "combustible"
|
||||
showProperty Infinite = Just "infinite"
|
||||
showProperty Liquid = Just "liquid"
|
||||
|
@ -339,6 +339,7 @@ testScenarioSolutions rs ui =
|
||||
, testSolution Default "Testing/1207-scout-command"
|
||||
, testSolution Default "Testing/1218-stride-command"
|
||||
, testSolution Default "Testing/1234-push-command"
|
||||
, testSolution Default "Testing/1681-pushable-entity"
|
||||
, testSolution Default "Testing/1256-halt-command"
|
||||
, testSolution Default "Testing/1295-density-command"
|
||||
, testSolution Default "Testing/1356-portals/portals-flip-and-rotate"
|
||||
|
Loading…
Reference in New Issue
Block a user