Skip to content

Commit

Permalink
Add take control action implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaj-a committed Jul 31, 2024
1 parent 6cafeab commit 4003eb0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
17 changes: 17 additions & 0 deletions src/module/system/action-macros/piloting/take-control.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.TakeControl";

const takeControl = new SingleCheckAction({
cost: 1,
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
notes: [{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.Notes.success` }],
rollOptions: ["action:take-control"],
section: "skill",
slug: "take-control",
statistic: "piloting",
traits: ["manipulate"],
});

export { takeControl };
16 changes: 13 additions & 3 deletions src/scripts/hooks/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ 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";
import { takeControl } from "@system/action-macros/piloting/take-control.ts";

export const Init = {
listen: (): void => {
Expand Down Expand Up @@ -178,9 +179,18 @@ 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, stunt].forEach((action) =>
game.pf2e.actions.set(action.slug, action),
);
[
accessInfosphere,
drive,
hack,
navigate,
plotCourse,
program,
runOver,
stop,
stunt,
takeControl,
].forEach((action) => game.pf2e.actions.set(action.slug, action));
}
});
},
Expand Down
7 changes: 7 additions & 0 deletions static/lang/action-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,13 @@
},
"Title": "Turn in Place"
}
},
"TakeControl": {
"Description": "<p>You take control of a vehicle. Attempt a Piloting check; on a success, you become the vehicle's pilot, or regain control of the vehicle if it was uncontrolled. Some vehicles have complicated controls that cause this action to become a multi-action activity, and most vehicles take at least 3 actions if they aren't activated.</p>",
"Notes": {
"success": "<strong>Success</strong> You become the vehicle's pilot, or regain control of the vehicle if it was uncontrolled."
},
"Title": "Take Control"
}
}
}
Expand Down

0 comments on commit 4003eb0

Please sign in to comment.