initial commit
This commit is contained in:
2513
src/game/GameApp.ts
Normal file
2513
src/game/GameApp.ts
Normal file
File diff suppressed because it is too large
Load Diff
273
src/game/definitions.ts
Normal file
273
src/game/definitions.ts
Normal file
@@ -0,0 +1,273 @@
|
||||
export type ShipRole = "military" | "transport" | "mining";
|
||||
export type ConstructibleCategory =
|
||||
| "station"
|
||||
| "refining"
|
||||
| "farm"
|
||||
| "shipyard"
|
||||
| "defense";
|
||||
|
||||
export type UnitState =
|
||||
| "idle"
|
||||
| "moving"
|
||||
| "leaving-gravity-well"
|
||||
| "spooling-ftl"
|
||||
| "warping"
|
||||
| "arriving"
|
||||
| "mining-approach"
|
||||
| "mining"
|
||||
| "delivering"
|
||||
| "docking-approach"
|
||||
| "docking"
|
||||
| "docked"
|
||||
| "undocking"
|
||||
| "patrolling"
|
||||
| "escorting";
|
||||
|
||||
export type UnitOrderKind = "idle" | "move" | "transfer" | "mine" | "patrol" | "escort";
|
||||
|
||||
export type ItemStorageKind = "bulk-solid" | "bulk-liquid" | "bulk-gas" | "container" | "manufactured";
|
||||
export type ModuleCategory =
|
||||
| "bridge"
|
||||
| "engine"
|
||||
| "ftl"
|
||||
| "mining"
|
||||
| "cargo-bulk"
|
||||
| "cargo-container"
|
||||
| "dock"
|
||||
| "refinery"
|
||||
| "defense"
|
||||
| "habitat"
|
||||
| "production";
|
||||
|
||||
export interface ModuleDefinition {
|
||||
id: string;
|
||||
label: string;
|
||||
category: ModuleCategory;
|
||||
summary: string;
|
||||
}
|
||||
|
||||
export interface ItemDefinition {
|
||||
id: string;
|
||||
label: string;
|
||||
storage: ItemStorageKind;
|
||||
}
|
||||
|
||||
export interface ShipDefinition {
|
||||
id: string;
|
||||
label: string;
|
||||
role: ShipRole;
|
||||
speed: number;
|
||||
ftlSpeed: number;
|
||||
spoolTime: number;
|
||||
cargoCapacity: number;
|
||||
cargoKind?: ItemStorageKind;
|
||||
cargoItemId?: string;
|
||||
color: number;
|
||||
hullColor: number;
|
||||
size: number;
|
||||
maxHealth: number;
|
||||
modules: string[];
|
||||
}
|
||||
|
||||
export interface ConstructibleDefinition {
|
||||
id: string;
|
||||
label: string;
|
||||
category: ConstructibleCategory;
|
||||
color: number;
|
||||
radius: number;
|
||||
dockingCapacity: number;
|
||||
storage: Partial<Record<ItemStorageKind, number>>;
|
||||
modules: string[];
|
||||
}
|
||||
|
||||
export interface PlanetDefinition {
|
||||
label: string;
|
||||
orbitRadius: number;
|
||||
orbitSpeed: number;
|
||||
size: number;
|
||||
color: number;
|
||||
tilt: number;
|
||||
hasRing?: boolean;
|
||||
}
|
||||
|
||||
export interface SolarSystemDefinition {
|
||||
id: string;
|
||||
label: string;
|
||||
position: [number, number, number];
|
||||
starColor: number;
|
||||
starGlow: number;
|
||||
starSize: number;
|
||||
gravityWellRadius: number;
|
||||
planets: PlanetDefinition[];
|
||||
}
|
||||
|
||||
export const itemDefinitions: ItemDefinition[] = [
|
||||
{ id: "ore", label: "Raw Ore", storage: "bulk-solid" },
|
||||
{ id: "refined-metals", label: "Refined Metals", storage: "manufactured" },
|
||||
{ id: "gas", label: "Volatile Gas", storage: "bulk-gas" },
|
||||
{ id: "water", label: "Water", storage: "bulk-liquid" },
|
||||
{ id: "drone-parts", label: "Drone Parts", storage: "container" },
|
||||
];
|
||||
|
||||
export const moduleDefinitions: ModuleDefinition[] = [
|
||||
{ id: "command-bridge", label: "Command Bridge", category: "bridge", summary: "Core ship control and crew systems." },
|
||||
{ id: "ion-drive", label: "Ion Drive", category: "engine", summary: "Sub-light propulsion package." },
|
||||
{ id: "ftl-core", label: "FTL Core", category: "ftl", summary: "Spool and warp inter-system engine." },
|
||||
{ id: "strip-miner", label: "Strip Miner", category: "mining", summary: "Excavation laser and ore intake." },
|
||||
{ id: "bulk-bay", label: "Bulk Cargo Bay", category: "cargo-bulk", summary: "Reinforced storage for raw solids." },
|
||||
{ id: "container-bay", label: "Container Hold", category: "cargo-container", summary: "Standardized freight racks." },
|
||||
{ id: "docking-clamps", label: "Docking Clamps", category: "dock", summary: "Docking collar and transfer arms." },
|
||||
{ id: "refinery-stack", label: "Refinery Stack", category: "refinery", summary: "Ore cracking and metal separation." },
|
||||
{ id: "turret-grid", label: "Turret Grid", category: "defense", summary: "Close defense batteries." },
|
||||
{ id: "habitat-ring", label: "Habitat Ring", category: "habitat", summary: "Crew quarters and service modules." },
|
||||
{ id: "fabricator-array", label: "Fabricator Array", category: "production", summary: "Assembly lines for manufactured goods." },
|
||||
];
|
||||
|
||||
export const shipDefinitions: ShipDefinition[] = [
|
||||
{
|
||||
id: "frigate",
|
||||
label: "Vanguard Frigate",
|
||||
role: "military",
|
||||
speed: 50,
|
||||
ftlSpeed: 3200,
|
||||
spoolTime: 2.2,
|
||||
cargoCapacity: 0,
|
||||
color: 0x7ed4ff,
|
||||
hullColor: 0x1f4f78,
|
||||
size: 4,
|
||||
maxHealth: 100,
|
||||
modules: ["command-bridge", "ion-drive", "ftl-core", "turret-grid"],
|
||||
},
|
||||
{
|
||||
id: "destroyer",
|
||||
label: "Bulwark Destroyer",
|
||||
role: "military",
|
||||
speed: 34,
|
||||
ftlSpeed: 2900,
|
||||
spoolTime: 2.8,
|
||||
cargoCapacity: 0,
|
||||
color: 0xff8f70,
|
||||
hullColor: 0x6a2e26,
|
||||
size: 7,
|
||||
maxHealth: 240,
|
||||
modules: ["command-bridge", "ion-drive", "ftl-core", "turret-grid", "turret-grid"],
|
||||
},
|
||||
{
|
||||
id: "hauler",
|
||||
label: "Atlas Hauler",
|
||||
role: "transport",
|
||||
speed: 22,
|
||||
ftlSpeed: 2600,
|
||||
spoolTime: 3.3,
|
||||
cargoCapacity: 180,
|
||||
cargoKind: "container",
|
||||
cargoItemId: "drone-parts",
|
||||
color: 0xb0ff8d,
|
||||
hullColor: 0x365f2a,
|
||||
size: 8,
|
||||
maxHealth: 180,
|
||||
modules: ["command-bridge", "ion-drive", "ftl-core", "container-bay", "docking-clamps"],
|
||||
},
|
||||
{
|
||||
id: "miner",
|
||||
label: "Prospector Miner",
|
||||
role: "mining",
|
||||
speed: 26,
|
||||
ftlSpeed: 2400,
|
||||
spoolTime: 3.1,
|
||||
cargoCapacity: 120,
|
||||
cargoKind: "bulk-solid",
|
||||
cargoItemId: "ore",
|
||||
color: 0xffdd75,
|
||||
hullColor: 0x68552b,
|
||||
size: 6,
|
||||
maxHealth: 150,
|
||||
modules: ["command-bridge", "ion-drive", "ftl-core", "strip-miner", "bulk-bay", "docking-clamps"],
|
||||
},
|
||||
];
|
||||
|
||||
export const constructibleDefinitions: ConstructibleDefinition[] = [
|
||||
{
|
||||
id: "trade-hub",
|
||||
label: "Trade Hub",
|
||||
category: "station",
|
||||
color: 0x8bd3ff,
|
||||
radius: 20,
|
||||
dockingCapacity: 4,
|
||||
storage: { container: 1200, manufactured: 800 },
|
||||
modules: ["habitat-ring", "docking-clamps", "container-bay"],
|
||||
},
|
||||
{
|
||||
id: "refinery",
|
||||
label: "Refining Station",
|
||||
category: "refining",
|
||||
color: 0xffb86c,
|
||||
radius: 24,
|
||||
dockingCapacity: 3,
|
||||
storage: { "bulk-solid": 2000, manufactured: 1000 },
|
||||
modules: ["docking-clamps", "refinery-stack", "bulk-bay", "fabricator-array"],
|
||||
},
|
||||
{
|
||||
id: "farm-ring",
|
||||
label: "Farm Station",
|
||||
category: "farm",
|
||||
color: 0x92ef8a,
|
||||
radius: 22,
|
||||
dockingCapacity: 2,
|
||||
storage: { "bulk-liquid": 600, container: 400 },
|
||||
modules: ["habitat-ring", "production", "container-bay"],
|
||||
},
|
||||
{
|
||||
id: "shipyard",
|
||||
label: "Orbital Shipyard",
|
||||
category: "shipyard",
|
||||
color: 0xd0a2ff,
|
||||
radius: 28,
|
||||
dockingCapacity: 5,
|
||||
storage: { manufactured: 1800, container: 1200 },
|
||||
modules: ["docking-clamps", "fabricator-array", "habitat-ring"],
|
||||
},
|
||||
{
|
||||
id: "defense-grid",
|
||||
label: "Defense Platform",
|
||||
category: "defense",
|
||||
color: 0xff7a95,
|
||||
radius: 18,
|
||||
dockingCapacity: 1,
|
||||
storage: { manufactured: 300 },
|
||||
modules: ["turret-grid", "command-bridge"],
|
||||
},
|
||||
];
|
||||
|
||||
export const solarSystemDefinitions: SolarSystemDefinition[] = [
|
||||
{
|
||||
id: "helios",
|
||||
label: "Helios Reach",
|
||||
position: [0, 0, 0],
|
||||
starColor: 0xffd27a,
|
||||
starGlow: 0xffb14a,
|
||||
starSize: 56,
|
||||
gravityWellRadius: 210,
|
||||
planets: [
|
||||
{ label: "Icarus", orbitRadius: 180, orbitSpeed: 0.18, size: 20, color: 0xd4a373, tilt: 0.2 },
|
||||
{ label: "Viridia", orbitRadius: 300, orbitSpeed: 0.11, size: 30, color: 0x58a36c, tilt: -0.4 },
|
||||
{ label: "Aster", orbitRadius: 460, orbitSpeed: 0.08, size: 38, color: 0x6ea7d4, tilt: 0.3, hasRing: true },
|
||||
{ label: "Noctis", orbitRadius: 670, orbitSpeed: 0.05, size: 50, color: 0x6958a8, tilt: -0.15 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "perseus",
|
||||
label: "Perseus Gate",
|
||||
position: [4200, 0, 600],
|
||||
starColor: 0x9fd4ff,
|
||||
starGlow: 0x66b6ff,
|
||||
starSize: 48,
|
||||
gravityWellRadius: 190,
|
||||
planets: [
|
||||
{ label: "Kepler", orbitRadius: 150, orbitSpeed: 0.22, size: 16, color: 0xd9b188, tilt: 0.12 },
|
||||
{ label: "Tethys", orbitRadius: 280, orbitSpeed: 0.12, size: 28, color: 0x73b0a1, tilt: -0.22 },
|
||||
{ label: "Orpheon", orbitRadius: 430, orbitSpeed: 0.07, size: 42, color: 0x4a67a8, tilt: 0.25, hasRing: true },
|
||||
{ label: "Cinder", orbitRadius: 610, orbitSpeed: 0.045, size: 36, color: 0xb15e49, tilt: -0.08 },
|
||||
],
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user