Skip to content

Commit

Permalink
Add stunt action implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaj-a committed Aug 5, 2024
1 parent 4ca1e46 commit b54802f
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 1 deletion.
110 changes: 110 additions & 0 deletions src/module/system/action-macros/piloting/stunt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.Stunt";

const stunt = new SingleCheckAction({
cost: 1,
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
notes: [{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` }],
rollOptions: ["action:stunt"],
section: "skill",
slug: "stunt",
statistic: "piloting",
traits: ["manipulate", "move", "reckless"],
variants: [
{
modifiers: [
{ label: `${PREFIX}.BackOff.Title`, modifier: -1 },
{ label: `${PREFIX}.Modifiers.RecklessPiloting`, modifier: -5, predicate: ["reckless-piloting"] },
],
name: `${PREFIX}.BackOff.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.BackOff.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` },
],
rollOptions: ["action:stunt", "action:stunt:back-off"],
slug: "back-off",
},
{
modifiers: [
{ label: `${PREFIX}.Evade.Title`, modifier: -1 },
{ label: `${PREFIX}.Modifiers.RecklessPiloting`, modifier: -5, predicate: ["reckless-piloting"] },
],
name: `${PREFIX}.Evade.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.Evade.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` },
],
rollOptions: ["action:stunt", "action:stunt:evade"],
slug: "evade",
},
{
modifiers: [
{ label: `${PREFIX}.FlipAndBurn.Title`, modifier: -1 },
{ label: `${PREFIX}.Modifiers.RecklessPiloting`, modifier: -5, predicate: ["reckless-piloting"] },
],
name: `${PREFIX}.FlipAndBurn.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.FlipAndBurn.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` },
],
rollOptions: ["action:stunt", "action:stunt:flip-and-burn"],
slug: "flip-and-burn",
},
{
modifiers: [
{ label: `${PREFIX}.BarrelRoll.Title`, modifier: -2 },
{ label: `${PREFIX}.Modifiers.RecklessPiloting`, modifier: -5, predicate: ["reckless-piloting"] },
],
name: `${PREFIX}.BarrelRoll.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.BarrelRoll.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` },
],
rollOptions: ["action:stunt", "action:stunt:barrel-roll"],
slug: "barrel-roll",
},
{
modifiers: [
{ label: `${PREFIX}.Flyby.Title`, modifier: -2 },
{ label: `${PREFIX}.Modifiers.RecklessPiloting`, modifier: -5, predicate: ["reckless-piloting"] },
],
name: `${PREFIX}.Flyby.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.Flyby.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` },
],
rollOptions: ["action:stunt", "action:stunt:flyby"],
slug: "flyby",
},
{
modifiers: [
{ label: `${PREFIX}.Drift.Title`, modifier: -2 },
{ label: `${PREFIX}.Modifiers.RecklessPiloting`, modifier: -5, predicate: ["reckless-piloting"] },
],
name: `${PREFIX}.Drift.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.Drift.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` },
],
rollOptions: ["action:stunt", "action:stunt:drift"],
slug: "drift",
},
{
modifiers: [
{ label: `${PREFIX}.TurnInPlace.Title`, modifier: -2 },
{ label: `${PREFIX}.Modifiers.RecklessPiloting`, modifier: -5, predicate: ["reckless-piloting"] },
],
name: `${PREFIX}.TurnInPlace.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.TurnInPlace.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` },
],
rollOptions: ["action:stunt", "action:stunt:turn-in-place"],
slug: "turn-in-place",
},
],
});

export { stunt };
3 changes: 2 additions & 1 deletion src/scripts/hooks/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { plotCourse } from "@system/action-macros/piloting/plot-course.ts";
import { program } from "@system/action-macros/computers/program.ts";
import { runOver } from "@system/action-macros/piloting/run-over.ts";
import { stop } from "@system/action-macros/piloting/stop.ts";
import { stunt } from "@system/action-macros/piloting/stunt.ts";

export const Init = {
listen: (): void => {
Expand Down Expand Up @@ -177,7 +178,7 @@ export const Init = {
game.pf2e.StatusEffects.initialize();

if (game.modules.get("starfinder-field-test-for-pf2e")?.active) {
[accessInfosphere, drive, hack, navigate, plotCourse, program, runOver, stop].forEach((action) =>
[accessInfosphere, drive, hack, navigate, plotCourse, program, runOver, stop, stunt].forEach((action) =>
game.pf2e.actions.set(action.slug, action),
);
}
Expand Down
52 changes: 52 additions & 0 deletions static/lang/action-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,58 @@
"Stop": {
"Description": "<p>You bring the vehicle to a stop.</p>",
"Title": "Stop"
},
"Stunt": {
"Description": "<p>You perform a stunt while Driving your vehicle, temporarily improving its effective capabilities at the risk of losing control. Drive your vehicle and choose a stunt. All piloting checks attempted as part of your Stunt receive the listed penalty, including piloting checks made to take a reckless action. If the Drive action and Stunt are both reckless, you must attempt the piloting check to keep control of the vehicle twice.</p><table><caption>Stunts</caption><thead><tr><th>Stunt</th><th>Penalty</th><th>Benefit</th></tr></thead><tbody><tr><td>Back Off</td><td>-1</td><td>Move half Speed backwards.</td></tr><tr><td>Evade</td><td>-1</td><td>Move half Speed to gain a +1 status bonus to AC.</td></tr><tr><td>Flip and Burn</td><td>-1</td><td>Move half Speed, then turn and direction.</td></tr><tr><td>Barrel Roll</td><td>-2</td><td>Move half Speed to gain a +2 status bonus to AC.</td></tr><tr><td>Flyby</td><td>-2</td><td>Move half Speed through an enemy square.</td></tr><tr><td>Drift</td><td>-2</td><td>Move half Speed sideways without turning.</td></tr><tr><td>Turn in Place</td><td>-2</td><td>Turn, then move full Speed.</td></tr></tbody></table>",
"BackOff": {
"Notes": {
"success": "<strong>Success</strong> Move half Speed backwards."
},
"Title": "Back Off"
},
"BarrelRoll": {
"Notes": {
"success": "<strong>Success</strong> Move half Speed to gain a +2 status bonus to AC."
},
"Title": "Barrel Roll"
},
"Drift": {
"Notes": {
"success": "<strong>Success</strong> Move half Speed sideways without turning."
},
"Title": "Drift"
},
"Evade": {
"Notes": {
"success": "<strong>Success</strong> Move half Speed to gain a +1 status bonus to AC."
},
"Title": "Evade"
},
"FlipAndBurn": {
"Notes": {
"success": "<strong>Success</strong> Move half Speed, then turn and direction."
},
"Title": "Flip and Burn"
},
"Flyby": {
"Notes": {
"success": "<strong>Success</strong> Move half Speed through an enemy square."
},
"Title": "Flyby"
},
"Modifiers": {
"RecklessPiloting": "Reckless Piloting"
},
"Notes": {
"failure": "<strong>Failure</strong> The vehicle moves its Speed in a straight line along its most recent heading, drifting up to 45 degrees at the GM's discretion, and becomes uncontrolled."
},
"Title": "Stunt",
"TurnInPlace": {
"Notes": {
"success": "<strong>Success</strong> Turn, then move full Speed."
},
"Title": "Turn in Place"
}
}
}
}
Expand Down

0 comments on commit b54802f

Please sign in to comment.