Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the AI Condition bTestTargetEffectsApply work properly and allow it to be used with grenades #1451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BlackDog86
Copy link
Contributor

@BlackDog86 BlackDog86 commented Jan 7, 2025

Fixes #1369

This is an alternative approach to the original issue of allowing mods to specifically exclude the lost from AOE targetting profiles and centres around some findings from testing, wherein XGAIBehavior::GetAllAoETargets was incorrecly adding a bunch of units to its out array, which should have been filtered out when bTestTargetEffectsApply was set on the AOE profile in XCOMAI.ini. Furthermore, the same function was also not capable of checking the area of effect profiles of grenades, as it was only set up to look directly at multitargeteffects on the ability templates (which for launchgrenade and throwgrenade, don't exist).

It could be argued that this is a bugfix - strictly speaking, but basically the only abilities in the base game which use this part of the function are Harbor Wave and the Purifier Flamethrower and the only base-game effect the oversight would've had, is that purifiers would probably try to fire at things even if they have fire immunity (the assasin's harbor wave has a unique damage type which I don't think anything is immune to anyway).

With the fix in place, enemy & AI modders can simply specify bTestTargetEffectsApply on their AOE Profiles in the AI templates and that should be sufficient to prevent those abilities being used against units which are immune to the effects (whether those are created via multi-target effects, or by making additional grenades / rockets).

@BlackDog86 BlackDog86 force-pushed the 1369-Exclude-Immune-From-AOE-Properly branch from d676993 to eb485f8 Compare January 7, 2025 22:52
@BlackDog86 BlackDog86 force-pushed the 1369-Exclude-Immune-From-AOE-Properly branch from eb485f8 to 315b917 Compare January 7, 2025 22:54
@BlackDog86
Copy link
Contributor Author

Also for posterity:
image

@BlackDog86 BlackDog86 self-assigned this Jan 7, 2025
@BlackDog86 BlackDog86 requested a review from Iridar January 7, 2025 23:00
@BlackDog86 BlackDog86 added this to the 1.30.0 milestone Jan 7, 2025
@BlackDog86 BlackDog86 added the ready-to-review A pull request is ready to be reviewed label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready-to-review A pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow mods to adjust AI behaviour of AoE profiles to specifically exclude lost units
1 participant