Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Starfinder 2E playtest actions #15656

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
20 changes: 20 additions & 0 deletions src/module/system/action-macros/computers/access-infosphere.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.AccessInfosphere";

const accessInfosphere = new SingleCheckAction({
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:access-infosphere"],
section: "skill",
slug: "access-infosphere",
statistic: "computers",
traits: ["concentrate", "exploration", "secret"],
});

export { accessInfosphere };
21 changes: 21 additions & 0 deletions src/module/system/action-macros/computers/hack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.Hack";

const hack = new SingleCheckAction({
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
notes: [
{ outcome: ["criticalSuccess"], text: `${PREFIX}.Notes.criticalSuccess` },
{ outcome: ["success"], text: `${PREFIX}.Notes.success` },
{ outcome: ["failure"], text: `${PREFIX}.Notes.failure` },
{ outcome: ["criticalFailure"], text: `${PREFIX}.Notes.criticalFailure` },
],
rollOptions: ["action:hack"],
section: "skill",
slug: "hack",
statistic: "computers",
traits: ["exploration"],
});

export { hack };
21 changes: 21 additions & 0 deletions src/module/system/action-macros/computers/program.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.Program";

const program = new SingleCheckAction({
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
notes: [
{ outcome: ["criticalSuccess"], text: `${PREFIX}.Notes.criticalSuccess` },
{ outcome: ["success"], text: `${PREFIX}.Notes.success` },
{ outcome: ["failure"], text: `${PREFIX}.Notes.failure` },
{ outcome: ["criticalFailure"], text: `${PREFIX}.Notes.criticalFailure` },
],
rollOptions: ["action:program"],
section: "skill",
slug: "program",
statistic: "computers",
traits: ["downtime", "manipulate"],
});

export { program };
54 changes: 54 additions & 0 deletions src/module/system/action-macros/piloting/drive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.Drive";

const drive = new SingleCheckAction({
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
rollOptions: ["action:drive"],
section: "skill",
slug: "drive",
statistic: "piloting",
traits: ["move"],
variants: [
{
cost: 1,
description: `${PREFIX}.Drive1.Description`,
name: `${PREFIX}.Drive1.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.Drive1.Notes.success` },
{ outcome: ["failure"], text: `${PREFIX}.Drive1.Notes.failure` },
{ outcome: ["criticalFailure"], text: `${PREFIX}.Drive1.Notes.criticalFailure` },
],
rollOptions: ["action:drive", "action:drive:drive1"],
slug: "drive1",
},
{
cost: 2,
description: `${PREFIX}.Drive2.Description`,
name: `${PREFIX}.Drive2.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.Drive2.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Drive2.Notes.failure` },
],
rollOptions: ["action:drive", "action:drive:drive2"],
slug: "drive2",
traits: ["move", "reckless"],
},
{
cost: 3,
description: `${PREFIX}.Drive3.Description`,
modifiers: [{ label: `${PREFIX}.Drive3.Title`, modifier: -5 }],
name: `${PREFIX}.Drive3.Title`,
notes: [
{ outcome: ["criticalSuccess", "success"], text: `${PREFIX}.Drive3.Notes.success` },
{ outcome: ["criticalFailure", "failure"], text: `${PREFIX}.Drive3.Notes.failure` },
],
rollOptions: ["action:drive", "action:drive:drive3"],
slug: "drive3",
traits: ["move", "reckless"],
},
],
});

export { drive };
19 changes: 19 additions & 0 deletions src/module/system/action-macros/piloting/navigate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.Navigate";

const navigate = new SingleCheckAction({
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
notes: [
{ outcome: ["criticalSuccess"], text: `${PREFIX}.Notes.criticalSuccess` },
{ outcome: ["success"], text: `${PREFIX}.Notes.success` },
],
rollOptions: ["action:navigate"],
section: "skill",
slug: "navigate",
statistic: "piloting",
traits: ["exploration", "secret"],
});

export { navigate };
21 changes: 21 additions & 0 deletions src/module/system/action-macros/piloting/plot-course.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { SingleCheckAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.PlotCourse";

const plotCourse = new SingleCheckAction({
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
notes: [
{ outcome: ["criticalSuccess"], text: `${PREFIX}.Notes.criticalSuccess` },
{ outcome: ["success"], text: `${PREFIX}.Notes.success` },
{ outcome: ["failure"], text: `${PREFIX}.Notes.failure` },
{ outcome: ["criticalFailure"], text: `${PREFIX}.Notes.criticalFailure` },
],
rollOptions: ["action:plot-course"],
section: "skill",
slug: "plot-course",
statistic: "piloting",
traits: ["exploration", "secret"],
});

export { plotCourse };
17 changes: 17 additions & 0 deletions src/module/system/action-macros/piloting/run-over.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.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 };
14 changes: 14 additions & 0 deletions src/module/system/action-macros/piloting/stop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { SimpleAction } from "@actor/actions/index.ts";

const PREFIX = "SF2E.Actions.Stop";

const stop = new SimpleAction({
cost: 1,
description: `${PREFIX}.Description`,
name: `${PREFIX}.Title`,
section: "skill",
slug: "stop",
traits: ["manipulate"],
});

export { stop };
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 };
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 };
25 changes: 25 additions & 0 deletions src/scripts/hooks/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ import { SetGamePF2e } from "@scripts/set-game-pf2e.ts";
import { registerSettings } from "@system/settings/index.ts";
import { htmlQueryAll } from "@util";
import * as R from "remeda";
import { accessInfosphere } from "@system/action-macros/computers/access-infosphere.ts";
import { drive } from "@system/action-macros/piloting/drive.ts";
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";
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 @@ -167,6 +177,21 @@ 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,
takeControl,
].forEach((action) => game.pf2e.actions.set(action.slug, action));
}
});
},
};
Loading
Loading