humus-old/server/fixtures/potion.entity.js
2019-12-12 19:27:19 -06:00

49 lines
982 B
JavaScript

import {buildInvoke, buildTraversal} from '@avocado/behavior';
import {AFFINITY_NONE} from '../../common/combat/constants';
// Healing potion.
export function potionJSON() {
const causeHealing = buildInvoke(['wielder', 'takeHarmFrom'], [
buildTraversal(['item']),
]);
const decrement = buildInvoke(
['item', 'decrementQuantity'],
[
1,
]
);
return {
traits: {
harmful: {
params: {
harmSpecs: [
{
affinity: AFFINITY_NONE,
lock: 0,
power: -50,
variance: 0.1,
},
],
},
},
existent: {},
item: {
params: {
cooldown: 0.5,
itemActions: {
type: 'actions',
traversals: [
causeHealing,
decrement,
],
},
slotImageUris: {
default: '/potion.png',
},
},
},
},
};
}