Started implementing spells in action engine

This commit is contained in:
ThaumRystra
2024-10-27 12:51:48 +02:00
parent 01df7898cc
commit 804c5f3aee
9 changed files with 131 additions and 147 deletions

View File

@@ -35,6 +35,10 @@ type InputProvider = {
* Get the details of a check or save
*/
check(suggestedParams: CheckParams): Promise<CheckParams>;
/**
* Get the details of casting a spell
*/
castSpell(suggestedParams: CastSpellParams): Promise<CastSpellParams>;
}
export type Advantage = 0 | 1 | -1;
@@ -49,4 +53,10 @@ export type CheckParams = {
targetAbilityVariableName?: string;
}
export type CastSpellParams = {
spellId: string,
slotId: string | undefined,
ritual: boolean,
}
export default InputProvider;

View File

@@ -28,6 +28,9 @@ export default function getReplayChoicesInputProvider(actionId: string, decision
check() {
return Promise.resolve(decisionStack.pop());
},
castSpell() {
return Promise.resolve(decisionStack.pop());
},
}
return replaySavedInput;
}

View File

@@ -41,7 +41,10 @@ const inputProviderForTests: InputProvider = {
},
async check(suggestedParams) {
return suggestedParams;
}
},
async castSpell(suggestedParams) {
return suggestedParams;
},
}
export default inputProviderForTests;