[Spells] Add all types to checks for max_targets_allowed rule for AEs (#4682)

- Added all TargetedAE types to IsTargetableAESpell
- Added IsTargetableAESpell to IsAnyAESpell and changed order for earlier escapes
- IsPBAESpell now checks all PBAE types
- The rule Spells, TargetedAOEMaxTargets will now check all Targeted AE types
- The rule Spells, PointBlankAOEMaxTargets will now check all remaining types that can be a PBAE and not only Nuke PBAEs
This commit is contained in:
nytmyr 2025-02-15 15:03:23 -06:00 committed by GitHub
parent 3ba113a91d
commit 9aa0f7c695
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 15 deletions

View File

@ -93,7 +93,14 @@ bool IsTargetableAESpell(uint16 spell_id)
return false;
}
return spells[spell_id].target_type == ST_AETarget;
return (
spells[spell_id].target_type == ST_AETarget ||
spells[spell_id].target_type == ST_TargetAETap ||
spells[spell_id].target_type == ST_AETargetHateList ||
spells[spell_id].target_type == ST_TargetAENoPlayersPets ||
spells[spell_id].target_type == ST_UndeadAE ||
spells[spell_id].target_type == ST_SummonedAE
);
}
bool IsSacrificeSpell(uint16 spell_id)
@ -675,17 +682,19 @@ bool IsAnyNukeOrStunSpell(uint16 spell_id) {
}
bool IsAnyAESpell(uint16 spell_id) {
return (
IsValidSpell(spell_id) &&
(
IsAEDurationSpell(spell_id) ||
IsAESpell(spell_id) ||
IsAERainNukeSpell(spell_id) ||
IsAERainSpell(spell_id) ||
IsPBAESpell(spell_id) ||
IsPBAENukeSpell(spell_id)
)
);
if (!IsValidSpell(spell_id)) {
return false;
}
return (
IsTargetableAESpell(spell_id) ||
IsAESpell(spell_id) ||
IsPBAESpell(spell_id) ||
IsAEDurationSpell(spell_id) ||
IsAERainNukeSpell(spell_id) ||
IsAERainSpell(spell_id) ||
IsPBAENukeSpell(spell_id)
);
}
bool IsAESpell(uint16 spell_id)
@ -740,8 +749,8 @@ bool IsPBAESpell(uint16 spell_id)
if (
spell.aoe_range > 0 &&
spell.target_type == ST_AECaster
) {
!IsTargetRequiredForSpell(spell_id)
) {
return true;
}

View File

@ -1110,7 +1110,7 @@ void EntityList::AESpell(
) {
max_targets_allowed = RuleI(Spells, TargetedAOEMaxTargets);
} else if (
IsPBAENukeSpell(spell_id) &&
IsPBAESpell(spell_id) &&
IsDetrimentalSpell &&
!is_npc
) {