Files
WT-Offline/gui-patches/battle/force-extra-slot-weapons/replace.nut
T
N0VAN0M4LY 9f28a84cd3 fix(battle): present extra lineup slots as ordinary vehicles
The live game draws one vehicle from each RandomSpawnUnits group at
launch and shows it as a plain lineup vehicle (a 12.7 US lineup gets an
M1A1 12.0 and an ADATS 12.0, no dice), so the random_units state and the
patch that filled it are gone. The strike UCAV costs 750 spawn points,
the live game's value, now in tuning/battle.jsonc.
2026-11-28 07:28:48 +08:00

13 lines
724 B
Plaintext

function getForcedUnitWeapon(unit) {
// WTOffline: the extra vehicles the local service added to a LocalMP lineup carry their forced
// weapon (nuclear carrier, RandomSpawnUnits forceWeapon); online the battle server sends it.
foreach (wtoSlot in (require("nestdb").ndbTryRead(["wto", "activeBattle"])?.extraBattleSlots ?? []))
if (wtoSlot?.unitName == unit.name && (wtoSlot?.forceWeapon ?? "") != "")
return wtoSlot.forceWeapon
let groupName = this.getRandomUnitsGroupName(unit.name)
if (groupName == null)
return this.missionParams?.editSlotbar[unit.shopCountry][unit.name]["forceWeapon"]
return getRandomUnitsForceWeapon(getEventEconomicName(getRoomEvent()), unit.name)
}