Records the uncommitted battle-session work exactly as it was left (local service matchmaking, settlement, chat, native LocalMP hooks, battle gui/exe patches) so the following review and rework commits show every correction as a diff against this state. This commit is not reviewed and is known to be incomplete: in-game testing reported wrong settlement rewards, single-country teams, missing random/fixed supplement slots, misattributed hit messages and other regressions. Do not merge this branch before the rework lands.
12 lines
1.5 KiB
JSON
12 lines
1.5 KiB
JSON
{
|
|
"id": "battle/force-extra-slot-weapons",
|
|
"title": "Lock nuclear, strike-UCAV, and RandomSpawnUnits forced weapon presets in LocalMP",
|
|
"file": "scripts/miscustomrules/rulebase.nut",
|
|
"reason": "Extra battle slots require fixed nuclear bomb or strike-UCAV missile presets and fallback RandomSpawnUnits event lookup when session room event metadata is local.",
|
|
"features": ["D-改装件与挂载", "J-本地对局"],
|
|
"edit": {
|
|
"find": " function getForcedUnitWeapon(unit) {\r\n let groupName = this.getRandomUnitsGroupName(unit.name)\r\n if (groupName == null)\r\n return this.missionParams?.editSlotbar[unit.shopCountry][unit.name][\"forceWeapon\"]\r\n\r\n return getRandomUnitsForceWeapon(getEventEconomicName(getRoomEvent()), unit.name)\r\n }",
|
|
"replace": " function getForcedUnitWeapon(unit) {\r\n let { ndbTryRead } = require(\"nestdb\")\r\n let wtoBattle = ndbTryRead([\"wto\", \"activeBattle\"])\r\n foreach (wtoSlot in (wtoBattle?.extraBattleSlots ?? [])) {\r\n if (wtoSlot?.unitName == unit.name && (wtoSlot?.forceWeapon ?? \"\") != \"\")\r\n return wtoSlot.forceWeapon\r\n }\r\n let groupName = this.getRandomUnitsGroupName(unit.name)\r\n if (groupName == null)\r\n return this.missionParams?.editSlotbar[unit.shopCountry][unit.name][\"forceWeapon\"]\r\n\r\n let wtoRoomEcon = getEventEconomicName(getRoomEvent())\r\n let wtoEconName = wtoRoomEcon != \"\" ? wtoRoomEcon : (wtoBattle?.randomUnitsEventName ?? \"\")\r\n return getRandomUnitsForceWeapon(wtoEconName, unit.name)\r\n }"
|
|
}
|
|
}
|