2019-05-30 09:12:17 -05:00
|
|
|
import {buildInvoke, buildTraversal, buildCondition} from '@avocado/behavior';
|
|
|
|
|
|
|
|
// Tomato seeds.
|
|
|
|
export function tomatoSeedsJSON() {
|
2019-06-12 22:23:21 -05:00
|
|
|
const hasExistingTomato = buildInvoke(
|
|
|
|
['wielder', 'layer', 'hasTileEntityWithUriAt'],
|
|
|
|
[
|
|
|
|
buildTraversal(['target']),
|
|
|
|
'/tomato-plant.entity.json',
|
|
|
|
],
|
|
|
|
);
|
2019-05-30 09:12:17 -05:00
|
|
|
return {
|
|
|
|
traits: {
|
|
|
|
existent: {},
|
|
|
|
item: {
|
|
|
|
params: {
|
|
|
|
itemActions: {
|
|
|
|
type: 'actions',
|
|
|
|
traversals: [
|
|
|
|
buildInvoke(['item', 'useTool']),
|
|
|
|
],
|
|
|
|
},
|
2019-10-07 03:12:41 -05:00
|
|
|
slotImageUris: {
|
2019-05-30 09:12:17 -05:00
|
|
|
default: '/seeds.png',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
spawner: {
|
|
|
|
params: {
|
|
|
|
spawns: {
|
|
|
|
'tomato-plant': {
|
|
|
|
uri: '/tomato-plant.entity.json',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tool: {
|
|
|
|
params: {
|
|
|
|
// Has to be wet dirt.
|
2019-06-12 22:23:21 -05:00
|
|
|
condition: buildCondition('and', [
|
|
|
|
buildCondition('is', [
|
|
|
|
7,
|
|
|
|
buildInvoke(
|
|
|
|
['wielder', 'layer', 'tileAt'],
|
|
|
|
[
|
|
|
|
buildTraversal(['target']),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
buildCondition('is', [
|
|
|
|
false,
|
|
|
|
hasExistingTomato,
|
|
|
|
]),
|
2019-05-30 09:12:17 -05:00
|
|
|
]),
|
|
|
|
actions: {
|
|
|
|
type: 'actions',
|
|
|
|
traversals: [
|
|
|
|
buildInvoke(
|
|
|
|
['item', 'spawnAt'],
|
|
|
|
[
|
|
|
|
'tomato-plant',
|
|
|
|
buildInvoke(
|
2019-09-08 03:21:56 -05:00
|
|
|
['Math', 'Vector', 'add'],
|
2019-05-30 09:12:17 -05:00
|
|
|
[
|
|
|
|
buildInvoke(
|
2019-09-08 03:21:56 -05:00
|
|
|
['Math', 'Vector', 'mul'],
|
2019-05-30 09:12:17 -05:00
|
|
|
[
|
|
|
|
buildTraversal(['target']),
|
2019-06-05 20:20:45 -05:00
|
|
|
buildTraversal(['wielder', 'layer', 'tileset', 'tileSize']),
|
2019-05-30 09:12:17 -05:00
|
|
|
],
|
|
|
|
),
|
|
|
|
buildInvoke(
|
2019-09-08 03:21:56 -05:00
|
|
|
['Math', 'Vector', 'scale'],
|
2019-05-30 09:12:17 -05:00
|
|
|
[
|
2019-06-05 20:20:45 -05:00
|
|
|
buildTraversal(['wielder', 'layer', 'tileset', 'tileSize']),
|
2019-05-30 09:12:17 -05:00
|
|
|
0.5,
|
|
|
|
]
|
|
|
|
),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
},
|
|
|
|
target: {
|
|
|
|
type: 'projection',
|
|
|
|
distance: -1,
|
|
|
|
length: 3,
|
|
|
|
width: 3,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|