Added costs to blueprints

This commit is contained in:
Pax1601
2023-08-12 12:31:28 +02:00
parent 46ca6ac327
commit 6c496e428f
12 changed files with 1082 additions and 3 deletions

View File

@@ -23,4 +23,5 @@ interface UnitBlueprint {
loadouts?: LoadoutBlueprint[];
filename?: string;
liveryID?: string;
cost?: number;
}

View File

@@ -16,6 +16,9 @@ export class AircraftDatabase extends UnitDatabase {
return 0;
const blueprint = this.getByName(name);
if (blueprint?.cost != undefined)
return blueprint?.cost;
if (blueprint?.era == "WW2")
return 20;
else if (blueprint?.era == "Early Cold War")

View File

@@ -12,6 +12,9 @@ export class GroundUnitDatabase extends UnitDatabase {
return 0;
const blueprint = this.getByName(name);
if (blueprint?.cost != undefined)
return blueprint?.cost;
if (blueprint?.era == "WW2")
return 20;
else if (blueprint?.era == "Early Cold War")

View File

@@ -12,6 +12,9 @@ export class HelicopterDatabase extends UnitDatabase {
return 0;
const blueprint = this.getByName(name);
if (blueprint?.cost != undefined)
return blueprint?.cost;
if (blueprint?.era == "WW2")
return 20;
else if (blueprint?.era == "Early Cold War")

View File

@@ -12,6 +12,9 @@ export class NavyUnitDatabase extends UnitDatabase {
return 0;
const blueprint = this.getByName(name);
if (blueprint?.cost != undefined)
return blueprint?.cost;
if (blueprint?.era == "WW2")
return 20;
else if (blueprint?.era == "Early Cold War")

View File

@@ -51,7 +51,7 @@ export class UnitDatabase {
const blueprint = this.blueprints[unit];
if (this.getSpawnPointsByName(blueprint.name) <= getMissionHandler().getAvailableSpawnPoints() &&
getMissionHandler().getCommandModeOptions().eras.includes(blueprint.era) &&
(!getMissionHandler().getCommandModeOptions().restrictToCoalition || blueprint.coalition === getMissionHandler().getCommandedCoalition())) {
(!getMissionHandler().getCommandModeOptions().restrictToCoalition || blueprint.coalition === getMissionHandler().getCommandedCoalition() || blueprint.coalition === undefined)) {
filteredBlueprints[unit] = blueprint;
}
}