-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathitem-instances.js
36 lines (36 loc) · 1.85 KB
/
item-instances.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** Configure ItemInstance object */
module.exports.configItemInstance = (world) => {
return {
tableName: `item_instances`,
className: `ItemInstance`,
properties: [
{ name: `accuracy`, type: `int` },
{ name: `air`, type: `int` },
{ name: `armor`, type: `int` },
{ name: `character`, instanceOf: `Character`, store: false },
{ name: `container`, instanceOf: `ItemInstance`, store: false },
{ name: `contents`, type: `Array`, arrayOf: { instanceOf: `ItemInstance` } },
{ name: `deflection`, type: `int` },
{ name: `deployment`, type: `Deployment`, store: false },
{ name: `description`, type: `varchar`, length: 512, default: `It looks like a wieghtless and translucent spherical form of bound energy.` },
{ name: `details`, type: `object` },
{ name: `dodge`, type: `int` },
{ name: `earth`, type: `int` },
{ name: `fire`, type: `int` },
{ name: `flags`, type: `Array`, arrayOf: { type: `int` } },
{ name: `id`, type: `int` },
{ name: `life`, type: `int` },
{ name: `name`, type: `varchar`, length: 32, default: `a translucent sphere of energy` },
{ name: `names`, type: `Array`, default: [`sphere`, `energy`], arrayOf: { type: `varchar`, length: 32 } },
{ name: `power`, type: `int` },
{ name: `prototype`, instanceOf: `ItemPrototype`, loadTransform: x => new world.ItemPrototype({ id: x }) },
{ name: `rarity`, type: `int` },
{ name: `room`, instanceOf: `Room`, store: false },
{ name: `roomDescription`, type: `varchar`, length: 80, default: `a translucent sphere of energy is floating here` },
{ name: `slot`, type: `int`, default: world.constants().slots.NONE },
{ name: `speed`, type: `int` },
{ name: `type`, type: `int`, default: world.constants().itemTypes.OTHER },
{ name: `water`, type: `int` }
]
};
};