Skip to content

Commit

Permalink
Add circumstance modifiers from climb and swim speeds to related acti…
Browse files Browse the repository at this point in the history
…ons (#18062)
  • Loading branch information
nikolaj-a authored Jan 23, 2025
1 parent 079e6c0 commit ba0fba6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
20 changes: 19 additions & 1 deletion src/module/system/action-macros/athletics/climb.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { ActionMacroHelpers, SkillActionOptions } from "../index.ts";
import { SingleCheckAction } from "@actor/actions/index.ts";
import { ModifierPF2e } from "@actor/modifiers.ts";

const PREFIX = "PF2E.Actions.Climb";

function climb(options: SkillActionOptions): void {
const slug = options?.skill ?? "athletics";
const rollOptions = ["action:climb"];
const modifiers = options?.modifiers;
const modifiers = (options?.modifiers ?? []).concat(
new ModifierPF2e({
slug: "climb-speed",
label: `${PREFIX}.Modifier.ClimbSpeed`,
modifier: 4,
type: "circumstance",
predicate: ["speed:climb"],
}),
);
ActionMacroHelpers.simpleRollActionCheck({
actors: options.actors,
actionGlyph: options.glyph ?? "A",
Expand All @@ -31,6 +40,15 @@ const action = new SingleCheckAction({
cost: 1,
description: `${PREFIX}.Description`,
img: "icons/skills/movement/arrow-upward-blue.webp",
modifiers: [
{
slug: "climb-speed",
label: `${PREFIX}.Modifier.ClimbSpeed`,
modifier: 4,
type: "circumstance",
predicate: ["speed:climb"],
},
],
name: `${PREFIX}.Title`,
notes: [
{ outcome: ["criticalSuccess"], text: `${PREFIX}.Notes.criticalSuccess` },
Expand Down
20 changes: 19 additions & 1 deletion src/module/system/action-macros/athletics/swim.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { ActionMacroHelpers, SkillActionOptions } from "../index.ts";
import { SingleCheckAction } from "@actor/actions/index.ts";
import { ModifierPF2e } from "@actor/modifiers.ts";

const PREFIX = "PF2E.Actions.Swim";

function swim(options: SkillActionOptions): void {
const slug = options?.skill ?? "athletics";
const rollOptions = ["action:swim"];
const modifiers = options?.modifiers;
const modifiers = (options?.modifiers ?? []).concat(
new ModifierPF2e({
slug: "swim-speed",
label: `${PREFIX}.Modifier.SwimSpeed`,
modifier: 4,
type: "circumstance",
predicate: ["speed:swim"],
}),
);
ActionMacroHelpers.simpleRollActionCheck({
actors: options.actors,
actionGlyph: options.glyph ?? "A",
Expand All @@ -31,6 +40,15 @@ const action = new SingleCheckAction({
cost: 1,
description: `${PREFIX}.Description`,
img: "icons/skills/movement/figure-running-gray.webp",
modifiers: [
{
slug: "swim-speed",
label: `${PREFIX}.Modifier.SwimSpeed`,
modifier: 4,
type: "circumstance",
predicate: ["speed:swim"],
},
],
name: `${PREFIX}.Title`,
notes: [
{ outcome: ["criticalSuccess"], text: `${PREFIX}.Notes.criticalSuccess` },
Expand Down
6 changes: 6 additions & 0 deletions static/lang/action-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@
},
"Climb": {
"Description": "<p><strong>Requirements</strong> You have two hands free.</p><hr><p>You attempt an Athletics check to move a maximum distance of 5 feet up, down, or across an incline. You're @UUID[Compendium.pf2e.conditionitems.Item.AJh5ex99aV6VTggg]{Off-Guard} while climbing unless you have a climb Speed. The GM determines the DC based on the nature of the incline and environmental circumstances; you might get an automatic critical success on an incline that's trivial to climb. If your land Speed is 40 feet or higher, increase the maximum distance by 5 feet for every 20 feet of Speed above 20 feet.</p><p><strong>Critical Success</strong> You move along the incline, increasing the maximum distance by 5 feet.<br><strong>Success</strong> You move along the incline.<br><strong>Critical Failure</strong> You fall. If you began the climb on stable ground, you fall and land @UUID[Compendium.pf2e.conditionitems.Item.j91X7x0XSomq8d60]{Prone}.</p>",
"Modifier": {
"ClimbSpeed": "Climb Speed"
},
"Notes": {
"criticalFailure": "<strong>Critical Failure</strong> You fall. If you began the climb on stable ground, you fall and land @UUID[Compendium.pf2e.conditionitems.Item.j91X7x0XSomq8d60]{Prone}.",
"criticalSuccess": "<strong>Critical Success</strong> You move along the incline, increasing the maximum distance by 5 feet.",
Expand Down Expand Up @@ -880,6 +883,9 @@
},
"Swim": {
"Description": "<p>You attempt an Athletics check to move a maximum distance of 10 feet through water. The GM determines the DC based on the turbulence or danger of the water; in most instances of calm water, you get an automatic critical success. If your land Speed is 40 feet or higher, increase the maximum possible distance by 5 feet for every 20 feet of Speed above 20 feet.</p><p>If you end your turn in water and haven't succeeded at a Swim action that turn, you sink 10 feet or get moved by the current, as determined by the GM. This doesn't apply if your last action on your turn was to enter the water.</p><p><strong>Critical Success</strong> You move through the water, increasing the maximum distance by 5 feet.<br><strong>Success</strong> You move through the water.<br><strong>Critical Failure</strong> You make no progress. If you're holding your breath, you lose 1 round of air.</p>",
"Modifier": {
"SwimSpeed": "Swim Speed"
},
"Notes": {
"criticalFailure": "<strong>Critical Failure</strong> You make no progress. If you're holding your breath, you lose 1 round of air.",
"criticalSuccess": "<strong>Critical Success</strong> You move through the water, increasing the maximum distance by 5 feet.",
Expand Down

0 comments on commit ba0fba6

Please sign in to comment.