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

Restoration can't be activated if the squad is not missing HP #1436

Open
copyrite opened this issue Dec 28, 2024 · 4 comments · May be fixed by #1440
Open

Restoration can't be activated if the squad is not missing HP #1436

copyrite opened this issue Dec 28, 2024 · 4 comments · May be fixed by #1440
Assignees
Milestone

Comments

@copyrite
Copy link
Contributor

Restoration states the following:

The GREMLIN flies to each squad member, healing or reviving them as needed.

However, when computing whether the ability can be activated, the ability iterates through squad members. If it finds that all of them are in full health, the ability is unusable. In effect, if no one is hurt, Restoration can't be used as a comically oversized Revival Protocol.

Best also check what the interaction with any of the damaging statuses on squad members is and fix that if needed.

Originally posted to LWOTC: long-war-2/lwotc#1727

@Iridar
Copy link
Contributor

Iridar commented Dec 29, 2024

I can see the problem after looking at the code. It is indeed kinda messy. It seems the cutoff check is:

MultiTargetingStyle.NumTargetsRequired = 1; //At least someone must need healing

and

HealTargetCondition.ExcludeFullHealth = true;

So effectively the ability multi targets all units that don't have full HP and at the same time aren't dead or bleeding out.

The build visualization function just makes the gremlin visit those targets that had any effect applied to them by the ability.

One the previous Highlander fixes might actually be messing with this intended functionality, as there is the StunRecover effect that always gets applied to all units now, so it could be it's causing the Gremlin to visit all squad units, even if it's not doing anything for them. Needs testing.

@Iridar Iridar added this to the 1.30.0 milestone Dec 29, 2024
@faanlez
Copy link

faanlez commented Dec 29, 2024

ExcludeFullHealth actually doesn't exclude full health units affected by effects that are in the MedikitHealEffectTypes config, as this is used by the medikit/gremlin heal abilities to let you remove the statuses without needing an actual wound.

@Iridar
Copy link
Contributor

Iridar commented Dec 29, 2024

Firaxis Noodle Games

@BlackDog86
Copy link
Contributor

BlackDog86 commented Jan 1, 2025

Yeah, so the targetting conditions are really wonky here - as you both say, it looks like X2Condition_UnitProperty::ExcludeFullHealth excludes (as a first priority) units that have full health unless they are effected by a status effect that can be healed by a medikit (using native logic) - so this excludes targets with mental status effects, essentially.

Then it manually excludes stuff which is dead or bleeding out under seperate conditions.

So in effect, although it removes disoriented,panicked,unconscious,dazed,obsessed,berserk etc. from valid units, if the unit isn't damaged or affected by something a medkit can remove the unit won't be targetted which seems like a pretty silly oversight.

My proposal is probably to develop a custom X2Condition to replace the current mess which would allow friendly units to be targetted matching the below criteria:

Unit is not dead or bleeding out AND
(Unit has missing health OR
Unit has a status effect that can be healed with a medikit OR
Unit has a mental status effect that can be removed with Revival Protocol)

Does this sound sensible?

@BlackDog86 BlackDog86 self-assigned this Jan 1, 2025
@BlackDog86 BlackDog86 linked a pull request Jan 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants