humus-old/server/fixtures/watering-can.entity.js

58 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-05-28 20:35:24 -05:00
import {buildInvoke, buildTraversal, buildCondition} from '@avocado/behavior';
// Hoe.
export function wateringCanJSON() {
const waterTile = buildInvoke(
['wielder', 'layer', 'setTileAt'],
2019-05-28 20:35:24 -05:00
[
buildTraversal(['target']),
// 7 === wet dirt
7,
]
)
return {
traits: {
existent: {},
item: {
params: {
itemActions: {
type: 'actions',
traversals: [
buildInvoke(['item', 'useTool']),
],
},
slotImages: {
default: '/watering-can.png',
},
},
},
tool: {
params: {
2019-05-30 09:11:29 -05:00
// Has to be dirt.
condition: buildCondition('is', [
6,
buildInvoke(
['wielder', 'layer', 'tileAt'],
2019-05-30 09:11:29 -05:00
[
buildTraversal(['target']),
],
),
]),
2019-05-28 20:35:24 -05:00
actions: {
type: 'actions',
traversals: [
waterTile,
],
},
target: {
type: 'projection',
distance: 1,
length: 1,
width: 1,
},
},
},
},
};
}