humus-old/server/fixtures/potion.entity.js

50 lines
1.0 KiB
JavaScript
Raw Normal View History

2019-05-26 08:07:45 -05:00
import {buildInvoke, buildTraversal} from '@avocado/behavior';
import {AFFINITY_NONE} from '../../common/combat/constants';
// Healing potion.
export function potionJSON() {
const causeHealing = buildInvoke(['user', 'takeDamageFrom'], [
buildTraversal(['item']),
]);
const decrement = buildInvoke(
['item', 'decrementQuantity'],
);
const cooldown = buildInvoke(
['global', 'wait'],
[0.5],
);
return {
traits: {
damaging: {
params: {
damageSpecs: [
{
affinity: AFFINITY_NONE,
lock: 0,
power: -50,
variance: 0.1,
},
],
},
},
existent: {},
item: {
params: {
itemActions: {
type: 'actions',
traversals: [
causeHealing,
decrement,
cooldown,
],
},
slotImages: {
default: '/potion.png',
},
},
},
},
};
}