fun: watering can
This commit is contained in:
parent
f51e9c5c8f
commit
67e7755247
BIN
resource/watering-can.png
Normal file
BIN
resource/watering-can.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 683 B |
|
@ -74,6 +74,10 @@ export function createEntityForConnection(socket) {
|
|||
qty: 1,
|
||||
uri: '/hoe.entity.json',
|
||||
},
|
||||
3: {
|
||||
qty: 1,
|
||||
uri: '/watering-can.entity.json',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -32,6 +32,8 @@ import {rockJSON} from './fixtures/rock.entity';
|
|||
writeFixture('rock.entity.json', rockJSON());
|
||||
import {hoeJSON} from './fixtures/hoe.entity';
|
||||
writeFixture('hoe.entity.json', hoeJSON());
|
||||
import {wateringCanJSON} from './fixtures/watering-can.entity';
|
||||
writeFixture('watering-can.entity.json', wateringCanJSON());
|
||||
// Write rooms.
|
||||
import {kittyFireJSON} from './fixtures/kitty-fire.room';
|
||||
writeFixture('kitty-fire.room.json', kittyFireJSON());
|
||||
|
|
62
server/fixtures/watering-can.entity.js
Normal file
62
server/fixtures/watering-can.entity.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
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: {
|
||||
condition: buildCondition(
|
||||
'or',
|
||||
[
|
||||
// Has to be dirt.
|
||||
buildCondition('is', [
|
||||
6,
|
||||
buildInvoke(
|
||||
['user', 'layer', 'tileAt'],
|
||||
[
|
||||
buildTraversal(['target']),
|
||||
],
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
actions: {
|
||||
type: 'actions',
|
||||
traversals: [
|
||||
waterTile,
|
||||
],
|
||||
},
|
||||
target: {
|
||||
type: 'projection',
|
||||
distance: 1,
|
||||
length: 1,
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user