persea-old/fixtures/rock-projectile.entity.json
2020-06-20 02:01:32 -05:00

552 lines
17 KiB
JSON

{
"traits": {
"behaved": {
"params": {
"contextTypeHints": {
"other": "entity",
"wielder": "entity"
},
"routines": {
"type": "routines",
"routines": {
"initial": {
"type": "routine",
"routine": {
"type": "actions",
"traversals": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "setDoesNotCollideWith"
},
{
"type": "invoke",
"args": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "wielder"
}
]
}
]
}
]
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "setPosition"
},
{
"type": "invoke",
"args": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "wielder"
},
{
"type": "key",
"key": "position"
}
]
}
]
}
]
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "isVisible"
}
],
"value": {
"type": "literal",
"value": true
}
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "direction"
}
],
"value": {
"type": "traversal",
"steps": [
{
"type": "key",
"key": "wielder"
},
{
"type": "key",
"key": "direction"
}
]
}
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "moveFor"
},
{
"type": "invoke",
"args": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "Math"
},
{
"type": "key",
"key": "Vector"
},
{
"type": "key",
"key": "fromDirection"
},
{
"type": "invoke",
"args": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "direction"
}
]
}
]
}
]
},
{
"type": "literal",
"value": 0.5
}
]
}
]
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "destroy"
},
{
"type": "invoke",
"args": []
}
]
}
]
}
},
"reflect": {
"type": "routine",
"routine": {
"type": "actions",
"traversals": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "isColliding"
}
],
"value": {
"type": "literal",
"value": false
}
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "isHarmful"
}
],
"value": {
"type": "literal",
"value": false
}
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "Flow"
},
{
"type": "key",
"key": "parallel"
},
{
"type": "invoke",
"args": [
{
"type": "actions",
"traversals": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "transition"
},
{
"type": "invoke",
"args": [
{
"type": "literal",
"value": {
"opacity": 0,
"speed": 0
}
},
{
"type": "literal",
"value": 0.2
}
]
}
]
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "moveFor"
},
{
"type": "invoke",
"args": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "Math"
},
{
"type": "key",
"key": "Vector"
},
{
"type": "key",
"key": "sub"
},
{
"type": "invoke",
"args": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "position"
}
]
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "other"
},
{
"type": "key",
"key": "position"
}
]
}
]
}
]
},
{
"type": "literal",
"value": 0.2
}
]
}
]
}
]
}
]
}
]
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "destroy"
},
{
"type": "invoke",
"args": []
}
]
}
]
}
}
}
}
},
"state": {
"isBehaving": false
}
},
"collider": {
"params": {
"collisionGroup": "projectile",
"collisionStartActions": {
"type": "actions",
"traversals": [
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "context"
},
{
"type": "key",
"key": "add"
},
{
"type": "invoke",
"args": [
{
"type": "literal",
"value": "other"
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "other"
}
]
}
]
}
]
},
{
"type": "traversal",
"steps": [
{
"type": "key",
"key": "entity"
},
{
"type": "key",
"key": "currentRoutine"
}
],
"value": {
"type": "literal",
"value": "reflect"
}
}
]
},
"isSensor": true
}
},
"directional": {
"params": {
"directionCount": 4
}
},
"emitter": {
"params": {
"particles": {
"harmful": {
"rate": 0.0125,
"count": 5,
"traits": {
"primitive": {
"params": {
"primitives": [
{
"type": "circle",
"radius": 0.5,
"line": {
"rgba": [
128,
128,
128
]
},
"fill": {
"rgba": [
128,
128,
128
]
}
}
]
}
}
}
}
}
}
},
"existent": {
"state": {
"name": "Rock (projectile)"
}
},
"harmful": {
"params": {
"harmKnockback": 100,
"harmSpecs": [
{
"type": "blunt",
"power": 50,
"variance": 0.1
}
]
}
},
"layered": {},
"listed": {},
"mobile": {
"state": {
"speed": 200
}
},
"physical": {},
"pictured": {
"params": {
"images": {
"initial": {
"offset": [
0,
0
],
"size": [
12,
12
],
"uri": "/rock.png"
}
}
}
},
"positioned": {},
"roomed": {},
"shaped": {
"params": {
"shape": {
"type": "rectangle",
"position": [
0,
0
],
"size": [
12,
12
]
}
}
},
"visible": {
"state": {
"isVisible": false
}
}
}
}