fun: tomato plant is a tile entity

This commit is contained in:
cha0s 2019-06-12 22:23:21 -05:00
parent 2164a43bfd
commit 766e6b3e0c
2 changed files with 22 additions and 8 deletions

View File

@ -69,6 +69,7 @@ export function tomatoPlantJSON() {
},
positioned: {},
roomed: {},
'tile-entity': {},
visible: {},
},
};

View File

@ -2,6 +2,13 @@ import {buildInvoke, buildTraversal, buildCondition} from '@avocado/behavior';
// Tomato seeds.
export function tomatoSeedsJSON() {
const hasExistingTomato = buildInvoke(
['wielder', 'layer', 'hasTileEntityWithUriAt'],
[
buildTraversal(['target']),
'/tomato-plant.entity.json',
],
);
return {
traits: {
existent: {},
@ -30,14 +37,20 @@ export function tomatoSeedsJSON() {
tool: {
params: {
// Has to be wet dirt.
condition: buildCondition('is', [
7,
buildInvoke(
['wielder', 'layer', 'tileAt'],
[
buildTraversal(['target']),
],
),
condition: buildCondition('and', [
buildCondition('is', [
7,
buildInvoke(
['wielder', 'layer', 'tileAt'],
[
buildTraversal(['target']),
],
),
]),
buildCondition('is', [
false,
hasExistingTomato,
]),
]),
actions: {
type: 'actions',