forked from foundryvtt/pf2e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
climb.ts
53 lines (49 loc) · 1.92 KB
/
climb.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { ActionMacroHelpers, SkillActionOptions } from "../index.ts";
import { SingleCheckAction } from "@actor/actions/index.ts";
const PREFIX = "PF2E.Actions.Climb";
function climb(options: SkillActionOptions): void {
const slug = options?.skill ?? "athletics";
const rollOptions = ["action:climb"];
const modifiers = options?.modifiers;
ActionMacroHelpers.simpleRollActionCheck({
actors: options.actors,
actionGlyph: options.glyph ?? "A",
title: `${PREFIX}.Title`,
checkContext: (opts) => ActionMacroHelpers.defaultCheckContext(opts, { modifiers, rollOptions, slug }),
traits: ["move"],
event: options.event,
callback: options.callback,
difficultyClass: options.difficultyClass,
extraNotes: (selector: string) => [
ActionMacroHelpers.note(selector, PREFIX, "criticalSuccess"),
ActionMacroHelpers.note(selector, PREFIX, "success"),
ActionMacroHelpers.note(selector, PREFIX, "criticalFailure"),
],
}).catch((error: Error) => {
ui.notifications.error(error.message);
throw error;
});
}
const action = new SingleCheckAction({
cost: 1,
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
notes: [
{ outcome: ["criticalSuccess"], text: `${PREFIX}.Notes.criticalSuccess` },
{ outcome: ["success"], text: `${PREFIX}.Notes.success` },
{ outcome: ["criticalFailure"], text: `${PREFIX}.Notes.criticalFailure` },
],
rollOptions: ["action:climb"],
sampleTasks: {
untrained: `${PREFIX}.SampleTasks.Untrained`,
trained: `${PREFIX}.SampleTasks.Trained`,
expert: `${PREFIX}.SampleTasks.Expert`,
master: `${PREFIX}.SampleTasks.Master`,
legendary: `${PREFIX}.SampleTasks.Legendary`,
},
section: "skill",
slug: "climb",
statistic: "athletics",
traits: ["move"],
});
export { climb as legacy, action };