ZSGG Public Library
Dreadnought
Legion T3 Army Unit
import { LegionArmyUnit } from "../../../../defaults/legion.js";
import { Attack, Passive, Spell } from "../../../../engine/ability.js";
import { Turret } from "../../../../engine/turret.js";
export class Dreadnought extends LegionArmyUnit {
override uuid: string;
static override src = "src/zerospace/faction/legion/unit/dreadnought.ts";
override get infuseCost(): number | undefined {
return 100;
}
constructor() {
super();
this.hexiteCost = 150;
this.fluxCost = 250;
this.buildTime = 45;
this.buildCount = 1;
this.name = "Dreadnought";
this.tier = "T3";
this.domain = "air";
this.maxTurrets = 2;
this.uuid = "7ecb8b22-f467-40b0-b12d-2869bdf7090c";
this.internalId = "Troop_Leg_Dreadnaught_C";
this.internalPath = "/Game/Nova/Archetypes_Troops/Troop_Leg_Dreadnaught.Default__Troop_Leg_Dreadnaught_C";
this.internalTags = [
"Attackable.Unit.Troop",
"Attackable.FlyingUnit",
"Attackable.ArmorType.Heavy",
"Attackable.Unit.Massive",
];
this.internalSecondaryTags = ["Air"];
this.description = "Heavy aircraft with installable turrets.";
this.supply = 15;
this.hp = 800;
this.shields = 0;
this.armor = 1;
this.armorType = "heavy";
this.speed = 500;
this.stunResist = 75;
this.vision = 1800;
this.turnSpeed = 800;
this.createdBy = ["faction/legion/unit/legion-build-drone"];
this.unlockedBy = ["faction/legion/building/terror-tower"];
this.constructingVersion = {
name: "Dreadnought (Constructing)",
hp: 1000,
buildTime: 45,
uuid: "eacfc8a6-42e4-468c-8eee-966751d8ebc8",
};
this.tag("massive");
this.attacks.starscourge = new Attack({
name: "Starscourge",
damage: 9,
cooldown: 0.5,
armorPenetration: 100,
delay: 0.1,
range: 1100,
targets: ["air", "ground"],
parentId: this.id,
parentUUID: this.uuid,
});
this.attacks.turretAttack = new Attack({
name: "Turret Attack",
damage: 9,
cooldown: 2,
range: 2000,
targets: ["air", "ground"],
shots: 2,
bonusDamage: [{ multiplier: 3, vs: ["flyer"] }],
unlocked: false,
unlockedBy: ["antiAirTurret"],
parentId: this.id,
parentUUID: this.uuid,
});
this.spells.bombardment = new Spell({
name: "Bombardment",
description:
"Bombard the area under Dreadnought. Drops 4 bombs on targets (+4 for each bomb bay). Bombs deal 60 damage in a small radius",
cooldown: 1.0,
damage: 60,
targets: ["ground"],
volleys: 4,
parentId: this.id,
parentUUID: this.uuid,
});
this.spells.teleport = new Spell({
name: "Teleport",
description: "Teleports to the targeted location",
cooldown: 60,
targets: ["map"],
targetMode: "location",
unlocked: false,
unlockedBy: ["commandModule"],
parentId: this.id,
parentUUID: this.uuid,
});
this.passives.sensor = new Passive({
name: "Sensor",
description: "Advanced sensor detection system",
unlocked: false,
unlockedBy: ["commandModule"],
parentId: this.id,
parentUUID: this.uuid,
});
const dreadnought = this;
this.turrets.bombBay = new Turret({
internalId: "Legion_Dreadnaught_BombBay2_C",
internalPath:
"/Game/Nova/Archetypes_Buildings/Legion_Dreadnaught_BombBay2.Default__Legion_Dreadnaught_BombBay2_C",
name: "Bomb Bay",
description: "Increase the amount of bombs dropped during Bombardment by 4",
fluxCost: 100,
buildTime: 20,
hp: 225,
apply() {
const bombardment = dreadnought.spells.bombardment;
bombardment.volleys = (bombardment.volleys || 4) + 4;
},
});
this.turrets.commandModule = new Turret({
internalId: "Legion_Dreadnought_CommandModule_C",
internalPath:
"/Game/Nova/Archetypes_Buildings/Legion_Dreadnought_CommandModule.Default__Legion_Dreadnought_CommandModule_C",
name: "Command Module",
description:
"Adds advanced sensor array and enables teleport ability. Multiple Commad Modules increase sensor range and max teleport charges.",
fluxCost: 100,
buildTime: 20,
hp: 225,
unlocks: ["teleport", "sensor"],
apply() {
dreadnought.spells.teleport.unlocked = true;
dreadnought.passives.sensor.unlocked = true;
dreadnought.providesDetection = true;
if (!dreadnought.spells.teleport.range) {
dreadnought.spells.teleport.range = 5000;
} else {
dreadnought.spells.teleport.range += 1000;
}
},
});
this.turrets.shieldGenerator = new Turret({
internalId: "Legion_TerrorTankShieldGenerator_C",
internalPath:
"/Game/Nova/Archetypes_Buildings/Legion_TerrorTankShieldGenerator.Default__Legion_TerrorTankShieldGenerator_C",
name: "Shield Generator",
description: "Dreadnought shield generator adds +100 shields",
fluxCost: 100,
buildTime: 20,
hp: 225,
apply() {
dreadnought.shields = (dreadnought.shields || 0) + 100;
},
});
this.turrets.antiAirMissileTurret = new Turret({
internalId: "Legion_DreadnaughtTurretAA_2_C",
internalPath:
"/Game/Nova/Archetypes_Buildings/Legion_DreadnaughtTurretAA_2.Default__Legion_DreadnaughtTurretAA_2_C",
name: "Anti-Air Turret",
description: "Turret that can attack while moving. \nPassive: +15% Dreadnought movement speed.",
fluxCost: 100,
buildTime: 20,
hp: 225,
unlocks: ["turretAttack"],
apply() {
dreadnought.attacks.turretAttack!.unlocked = true;
},
});
this.turrets.beamModule = new Turret({
internalId: "Legion_Dreadnought_Beam_C",
internalPath: "/Game/Nova/Archetypes_Buildings/Legion_Dreadnought_Beam.Default__Legion_Dreadnought_Beam_C",
name: "Beam Module",
description: "Enhances main beam weapon with bonus damage and armor penetration",
hexiteCost: 0,
fluxCost: 100,
buildTime: 20,
hp: 225,
unlocked: false,
apply() {
const beam = dreadnought.attacks.mainBeamWeapon;
beam.damage = (beam.damage || 0) + 5;
beam.armorPenetration = (beam.armorPenetration || 0) + 25;
},
});
this.turrets.supportModule = new Turret({
internalId: "Legion_Dreadnought_Support_C",
internalPath: "/Game/Nova/Archetypes_Buildings/Legion_Dreadnought_Support.Default__Legion_Dreadnought_Support_C",
name: "Support Module",
description: "Provides area repair and shield boost to nearby friendly units",
hexiteCost: 75,
fluxCost: 75,
buildTime: 20,
hp: 225,
unlocked: false,
apply() {
dreadnought.shields = (dreadnought.shields || 0) + 50;
},
});
}
}
export default Dreadnought;