Files
DiceCloud/app/imports/api/creature/actions/applyAction.js
2021-02-11 16:16:22 +02:00

25 lines
740 B
JavaScript

import spendResources from '/imports/api/creature/actions/spendResources.js'
import embedInlineCalculations from '/imports/api/creature/computation/afterComputation/embedInlineCalculations.js';
export default function applyAction({prop, log}){
spendResources(prop);
// If this is not the top level action, we can add its name to the log
if (log.content.length){
log.content.push({name: prop.name});
}
if (prop.summary){
log.content.push({
description: embedInlineCalculations(
prop.summary, prop.summaryCalculations
),
});
}
if (prop.description){
log.content.push({
description: embedInlineCalculations(
prop.description, prop.descriptionCalculations
),
});
}
}