Skip to content

Commit

Permalink
Remove the power node stuff that is no longer necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Aug 21, 2024
1 parent f8e6623 commit d7a5d87
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 26 deletions.
3 changes: 0 additions & 3 deletions server/src/classes/Plugins/Ship/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export default class ShipPlugin extends Aspect {
cargoContainers: number;
/** The volume of the ship's cargo containers. */
cargoContainerVolume: Liter;
/** The names of the power nodes that will be spawned when the ship spawns. */
powerNodes: string[];

constructor(params: Partial<ShipPlugin>, plugin: BasePlugin) {
const name = generateIncrementedName(
Expand Down Expand Up @@ -113,7 +111,6 @@ export default class ShipPlugin extends Aspect {
this.deckEdges = params.deckEdges?.map((edge) => new DeckEdge(edge)) || [];
this.cargoContainers = params.cargoContainers || 4;
this.cargoContainerVolume = params.cargoContainerVolume || 4000;
this.powerNodes = ["offense", "defense", "navigation", "intel", "internal"];
}
addDeck(deck: Partial<DeckPlugin>) {
let { name } = deck;
Expand Down
9 changes: 1 addition & 8 deletions server/src/classes/Plugins/ShipSystems/BaseSystem.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { generateIncrementedName } from "server/src/utils/generateIncrementedName";
import { Aspect } from "../Aspect";
import type BasePlugin from "..";
import type {
ShipSystemTypes,
ShipSystemFlags,
PowerNodes,
} from "./shipSystemTypes";
import type { ShipSystemTypes, ShipSystemFlags } from "./shipSystemTypes";
import type {
Kelvin,
KelvinPerSecond,
Expand Down Expand Up @@ -46,8 +42,6 @@ export default class BaseShipSystemPlugin extends Aspect {
defaultPower: MegaWatt;
/** The threshold of power usage for safely using this system */
maxSafePower: MegaWatt;
/** The type of power node this system is assigned to */
powerNode?: PowerNodes;

//////////
// Heat //
Expand Down Expand Up @@ -99,7 +93,6 @@ export default class BaseShipSystemPlugin extends Aspect {
this.requiredPower = params.requiredPower || 5;
this.defaultPower = params.defaultPower || 10;
this.maxSafePower = params.maxSafePower || 20;
this.powerNode = params.powerNode;
this.powerToHeat = params.powerToHeat || 10;
this.heatDissipationRate = params.heatDissipationRate || 1;
this.nominalHeat = params.nominalHeat || 295.37;
Expand Down
3 changes: 1 addition & 2 deletions server/src/classes/Plugins/ShipSystems/ImpulseEngines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
} from "server/src/utils/unitTypes";
import type BasePlugin from "..";
import BaseShipSystemPlugin, { registerSystem } from "./BaseSystem";
import type { PowerNodes, ShipSystemFlags } from "./shipSystemTypes";
import type { ShipSystemFlags } from "./shipSystemTypes";

// TODO March 16, 2022: Add the necessary sound effects
export default class ImpulseEnginesPlugin extends BaseShipSystemPlugin {
Expand All @@ -13,7 +13,6 @@ export default class ImpulseEnginesPlugin extends BaseShipSystemPlugin {
cruisingSpeed: KilometerPerSecond;
emergencySpeed: KilometerPerSecond;
thrust: KiloNewtons;
powerNode?: PowerNodes = "navigation";
constructor(params: Partial<ImpulseEnginesPlugin>, plugin: BasePlugin) {
super(params, plugin);
this.cruisingSpeed = params.cruisingSpeed || 1500;
Expand Down
14 changes: 14 additions & 0 deletions server/src/classes/Plugins/ShipSystems/Shields.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type BasePlugin from "..";
import BaseShipSystemPlugin, { registerSystem } from "./BaseSystem";
import type { ShipSystemFlags } from "./shipSystemTypes";

// TODO March 16, 2022: Add the necessary sound effects
export default class ShieldsPlugin extends BaseShipSystemPlugin {
static flags: ShipSystemFlags[] = ["efficiency", "heat", "power"];
type = "torpedoLauncher" as const;

constructor(params: Partial<ShieldsPlugin>, plugin: BasePlugin) {
super(params, plugin);
}
}
registerSystem("torpedoLauncher", ShieldsPlugin);
3 changes: 1 addition & 2 deletions server/src/classes/Plugins/ShipSystems/Thrusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
} from "server/src/utils/unitTypes";
import type BasePlugin from "..";
import BaseShipSystemPlugin, { registerSystem } from "./BaseSystem";
import type { PowerNodes, ShipSystemFlags } from "./shipSystemTypes";
import type { ShipSystemFlags } from "./shipSystemTypes";

// TODO March 16, 2022: Add the necessary sound effects
export default class ThrustersPlugin extends BaseShipSystemPlugin {
Expand All @@ -15,7 +15,6 @@ export default class ThrustersPlugin extends BaseShipSystemPlugin {
directionThrust: KiloNewtons;
rotationMaxSpeed: RotationsPerMinute;
rotationThrust: KiloNewtons;
powerNode?: PowerNodes = "navigation";
constructor(params: Partial<ThrustersPlugin>, plugin: BasePlugin) {
super(params, plugin);
this.directionMaxSpeed = params.directionMaxSpeed || 1;
Expand Down
3 changes: 1 addition & 2 deletions server/src/classes/Plugins/ShipSystems/TorpedoLauncher.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type BasePlugin from "..";
import BaseShipSystemPlugin, { registerSystem } from "./BaseSystem";
import type { PowerNodes, ShipSystemFlags } from "./shipSystemTypes";
import type { ShipSystemFlags } from "./shipSystemTypes";

// TODO March 16, 2022: Add the necessary sound effects
export default class TorpedoLauncherPlugin extends BaseShipSystemPlugin {
Expand All @@ -13,7 +13,6 @@ export default class TorpedoLauncherPlugin extends BaseShipSystemPlugin {
headingDegree: number;
pitchDegree: number;

powerNode?: PowerNodes = "offense";
constructor(params: Partial<TorpedoLauncherPlugin>, plugin: BasePlugin) {
super(params, plugin);
this.loadTime = params.loadTime ?? 5000;
Expand Down
7 changes: 0 additions & 7 deletions server/src/classes/Plugins/ShipSystems/shipSystemTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,3 @@ export type AllShipSystems = {
(typeof ShipSystemTypes)[k]
>;
};

export type PowerNodes =
| "offense"
| "defense"
| "navigation"
| "intel"
| "internal";
3 changes: 1 addition & 2 deletions server/src/classes/Plugins/ShipSystems/warpEngines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from "server/src/utils/unitTypes";
import type BasePlugin from "..";
import BaseShipSystemPlugin, { registerSystem } from "./BaseSystem";
import type { PowerNodes, ShipSystemFlags } from "./shipSystemTypes";
import type { ShipSystemFlags } from "./shipSystemTypes";

// TODO May 3, 2022: Add the necessary sound effects
export default class WarpEnginesPlugin extends BaseShipSystemPlugin {
Expand All @@ -18,7 +18,6 @@ export default class WarpEnginesPlugin extends BaseShipSystemPlugin {
minSpeedMultiplier: number;
/** How many warp factors there are between min and max inclusive. This does not include emergency or destructive warp which are automatically extrapolated. */
warpFactorCount: number;
powerNode?: PowerNodes = "navigation";
constructor(params: Partial<WarpEnginesPlugin>, plugin: BasePlugin) {
super(params, plugin);
this.interstellarCruisingSpeed =
Expand Down

0 comments on commit d7a5d87

Please sign in to comment.