From f65f8c8b3c6955d29acb27a0867f12e8d986643b Mon Sep 17 00:00:00 2001 From: Nikolaj Andresen Date: Wed, 31 Jul 2024 22:20:31 +0200 Subject: [PATCH] Add run over action implementation --- .../system/action-macros/piloting/run-over.ts | 17 +++++++++++++++++ src/scripts/hooks/init.ts | 3 ++- static/lang/action-en.json | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/module/system/action-macros/piloting/run-over.ts diff --git a/src/module/system/action-macros/piloting/run-over.ts b/src/module/system/action-macros/piloting/run-over.ts new file mode 100644 index 00000000000..4dd0d4e5977 --- /dev/null +++ b/src/module/system/action-macros/piloting/run-over.ts @@ -0,0 +1,17 @@ +import { SingleCheckAction } from "@actor/actions/index.ts"; + +const PREFIX = "SF2E.Actions.RunOver"; + +const runOver = new SingleCheckAction({ + cost: 3, + description: `${PREFIX}.Description`, + name: `${PREFIX}.Title`, + notes: [{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Notes.failure` }], + rollOptions: ["action:run-over"], + section: "skill", + slug: "run-over", + statistic: "piloting", + traits: ["move", "reckless"], +}); + +export { runOver }; diff --git a/src/scripts/hooks/init.ts b/src/scripts/hooks/init.ts index d34f6451458..11725c482bb 100644 --- a/src/scripts/hooks/init.ts +++ b/src/scripts/hooks/init.ts @@ -24,6 +24,7 @@ import { hack } from "@system/action-macros/computers/hack.ts"; import { navigate } from "@system/action-macros/piloting/navigate.ts"; 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"; export const Init = { listen: (): void => { @@ -175,7 +176,7 @@ export const Init = { game.pf2e.StatusEffects.initialize(); if (game.modules.get("starfinder-field-test-for-pf2e")?.active) { - [accessInfosphere, drive, hack, navigate, plotCourse, program].forEach((action) => + [accessInfosphere, drive, hack, navigate, plotCourse, program, runOver].forEach((action) => game.pf2e.actions.set(action.slug, action), ); } diff --git a/static/lang/action-en.json b/static/lang/action-en.json index 4a1c0a6f198..b058603ddf1 100644 --- a/static/lang/action-en.json +++ b/static/lang/action-en.json @@ -1109,6 +1109,13 @@ "success": "Success Your attempt is successful. Each additional day spent Programming reduces the materials needed to complete the item by an amount based on your level and your proficiency rank." }, "Title": "Program" + }, + "RunOver": { + "Description": "

You try to run over creatures or ram another vehicle with your vehicle. If you maintain control of your vehicle, it moves up to twice its Speed in a straight line at the vehicle's current heading. You attempt to run over any creatures in your path two sizes smaller than the vehicle or smaller, and you can attempt to ram one target creature or object in your path one size smaller than the vehicle or larger.

Each creature in your path, including a rammed target, takes the vehicle's collision damage (basic Reflex save at vehicle's collision DC). If the rammed target is a vehicle, its pilot can attempt a piloting check in place of this Reflex save, with the same results. If the target of your ram takes damage, you and your vehicle each take collision damage (no save) and your movement ends.

", + "Notes": { + "failure": "Failure 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": "Run Over" } } }