49 lines
982 B
JavaScript
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',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|