Began adding creature templates to libraries

This commit is contained in:
ThaumRystra
2024-06-05 15:10:22 +02:00
parent 6070c499cc
commit 99c14099dc
18 changed files with 774 additions and 26 deletions

View File

@@ -0,0 +1,29 @@
import { EngineAction } from '/imports/api/engine/action/EngineActions';
import { PropTask } from '/imports/api/engine/action/tasks/Task';
import recalculateInlineCalculations from '/imports/api/engine/action/functions/recalculateInlineCalculations';
import getPropertyTitle from '/imports/api/utility/getPropertyTitle';
export default async function applyCreatureTemplateProperty(
task: PropTask, action: EngineAction, result, userInput
): Promise<void> {
const prop = task.prop;
//Log the Creature that is about to be summoned
let logValue = prop.description?.value
if (prop.description?.text) {
recalculateInlineCalculations(prop.description, action, 'reduce', userInput);
logValue = prop.description?.value;
}
// There are no targets for creature templates
// Creatures are always summoned as children of the action's creature
result.appendLog({
name: getPropertyTitle(prop),
value: logValue
}, []);
result.appendLog({
name: 'Warning',
value: 'Creature summoning is not yet implemented...'
}, []);
return;
}

View File

@@ -8,6 +8,7 @@ import adjustment from './applyAdjustmentProperty';
import branch from './applyBranchProperty';
import buff from './applyBuffProperty';
import buffRemover from './applyBuffRemoverProperty';
import creature from './applyCreatureTemplateProperty';
import damage from './applyDamageProperty';
import folder from './applyFolderProperty';
import note from './applyNoteProperty';
@@ -24,6 +25,7 @@ const applyPropertyByType: {
branch,
buff,
buffRemover,
creature,
damage,
folder,
note,