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(
|
|
['wielder', 'layer', 'setTileAt'],
|
|
[
|
|
buildTraversal(['target']),
|
|
// 7 === wet dirt
|
|
7,
|
|
]
|
|
)
|
|
return {
|
|
traits: {
|
|
existent: {},
|
|
item: {
|
|
params: {
|
|
itemActions: {
|
|
type: 'actions',
|
|
traversals: [
|
|
buildInvoke(['item', 'useTool']),
|
|
],
|
|
},
|
|
slotImageUris: {
|
|
default: '/watering-can.png',
|
|
},
|
|
},
|
|
},
|
|
tool: {
|
|
params: {
|
|
// Has to be dirt.
|
|
condition: buildCondition('is', [
|
|
6,
|
|
buildInvoke(
|
|
['wielder', 'layer', 'tileAt'],
|
|
[
|
|
buildTraversal(['target']),
|
|
],
|
|
),
|
|
]),
|
|
actions: {
|
|
type: 'actions',
|
|
traversals: [
|
|
waterTile,
|
|
],
|
|
},
|
|
target: {
|
|
type: 'projection',
|
|
distance: 1,
|
|
length: 1,
|
|
width: 1,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|