(SW) Cooldown Groups - #2387
Conversation
- Add SW.GroupAs list of group names to [SuperWeaponType] - Add SW.GroupAs.SyncLongestCooldown boolean tag (default false) - Reset active superweapons sharing a group with the fired superweapon - Optionally synchronize all group members to the longest recharge time of active superweapons - Document new tags in docs/New-or-Enhanced-Logics.md
- Update tags to SW.CooldownGroup and SW.CooldownGroup.SyncLongest - Update documentation heading to 'Cooldown groups' and clarify superweapons terminology
…apons - Add HouseExt::AI_TryFireSW wrapper to randomly choose between ready superweapons sharing a cooldown group - Use synchronized ScenarioClass::Instance->Random to prevent multiplayer desyncs - Temporarily mask non-chosen superweapons during Ares evaluation loop and restore if not fired - Wire hooks at 0x4FD799 and 0x4F9038 - Document AI fair selection behavior in docs/New-or-Enhanced-Logics.md
- Rename function to AI_TryFireSW_CooldownGroupAware to prevent confusion - Add Debug::Log mentioning house ID, group name, and randomly selected candidate - Clean up PRNG implementation details from documentation
- Use pOtherSuper->Type->RechargeTime to find true maximum base recharge time - Call SetRechargeTime(maxRechargeTime) before Reset() to set CustomChargeTime - Add debug logging to report fired superweapon and calculated maximum recharge time
…hold - Correctly push pSuper->Type->ArrayIndex into SuspendedEMPulseSWs instead of arrayIndex - Ensures all suspended superweapons are properly resumed when EMP cannon finishes firing
- Hook SuperClass::Grant (0x6CB560) to reset custom charge time when a structure is built/rebuilt - Hook SuperClass::HasChargeProgressed (0x6CBDCC and 0x6CBDB7) to clear custom charge time once the superweapon reaches 100% Ready - Ensures rebuilt structures charge with their own native RechargeTime rather than stale group cooldowns
…ooltip - Display individual base recharge time - Append (MM:SS) with the longest present group recharge time if it exceeds base time - Do not append parentheses if group time equals base time
- Add Superweapon cooldown groups to Whats-New.md under 0.6 New (by FS-21) - Add Superweapon cooldown groups under FS-21 in CREDITS.md
- Explicitly state that if any active superweapon in the group has SyncLongest=true, the synchronized longest cooldown applies to the entire group - Clarify that individual reset times only occur if all active superweapons in the group have SyncLongest=false
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
I think |
- Add RandomizeSuperWeaponPriority boolean tag under [AI] in rulesmd.ini (default false) - Shuffle ready candidate superweapons using synchronized engine PRNG (Random2Class) - Fall back gracefully to other ready candidates if first shuffled pick has no valid target - Add documentation in New-or-Enhanced-Logics.md, entry in Whats-New.md, and credit in CREDITS.md
Yeah,
|
SW.CooldownGroup. When any superweapon belonging to a group is launched, all other currently active (IsPresent) superweapons belonging to that group for the firer house will have their countdown timers reset (RechargeTimer), implementing a shared cooldown mechanism.SW.CooldownGroupaccepts a comma-separated list of group names, allowing a superweapon to belong to multiple groups simultaneously.SW.CooldownGroup.SyncLongestcontrols whether all present superweapons in the affected group(s) synchronize their cooldown to the longestRechargeTimeamong the superweapons currently active (built) in the group for that player. If any active superweapon in the group has this set totrue, the synchronized longest cooldown applies to the entire group. If all active superweapons in the group have this set tofalse, each superweapon resets to its own individual recharge time.[SuperWeaponTypes].In
rulesmd.ini: