Started implementing spells in action engine
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,10 @@ const inputProviderForTests: InputProvider = {
|
||||
},
|
||||
async check(suggestedParams) {
|
||||
return suggestedParams;
|
||||
}
|
||||
},
|
||||
async castSpell(suggestedParams) {
|
||||
return suggestedParams;
|
||||
},
|
||||
}
|
||||
|
||||
export default inputProviderForTests;
|
||||
|
||||
Reference in New Issue
Block a user