58 lines
1.2 KiB
JavaScript
58 lines
1.2 KiB
JavaScript
import {buildInvoke, buildTraversal, buildCondition} from '@avocado/behavior';
|
|
|
|
// Hoe.
|
|
export function wateringCanJSON() {
|
|
const waterTile = buildInvoke(
|
|
['user', 'layer', 'setTileAt'],
|
|
[
|
|
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: {
|
|
// Has to be dirt.
|
|
condition: buildCondition('is', [
|
|
6,
|
|
buildInvoke(
|
|
['user', 'layer', 'tileAt'],
|
|
[
|
|
buildTraversal(['target']),
|
|
],
|
|
),
|
|
]),
|
|
actions: {
|
|
type: 'actions',
|
|
traversals: [
|
|
waterTile,
|
|
],
|
|
},
|
|
target: {
|
|
type: 'projection',
|
|
distance: 1,
|
|
length: 1,
|
|
width: 1,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|