Skip to content

Addressing issue 1575 - Adding functionality to allow mods to manage what X2Effects are allowed to be applied to an Unit#1577

Open
ReshiMael wants to merge 2 commits into
X2CommunityCore:masterfrom
ReshiMael:master
Open

Addressing issue 1575 - Adding functionality to allow mods to manage what X2Effects are allowed to be applied to an Unit#1577
ReshiMael wants to merge 2 commits into
X2CommunityCore:masterfrom
ReshiMael:master

Conversation

@ReshiMael
Copy link
Copy Markdown
Contributor

  • Adding boolean X2Effect_Persistent.
  • Adding boolean to XComGameState_Unit that checks for the presence of an effect that flags for immunity to an effect
  • Modifying the ApplyEffect function in X2Effect to check for whether or not a unit is flagged as being immune to a specific effect.

This combination of features allows mod added persistent effects to arbitrarily exclude other effects from being allowed to be to applied to a unit, without having to rely on damage typing and other current systems that are heavily limited and may not be applicable or convenient for many use cases.

Example Given: We want to specifically ban a chosen from ever being Frozen, which is Frost damage typed. We do not want this chosen to be immune to damage from a gun another mod adds that has a Frost damage typing. This would enable the damage to be dealt to our chosen while also preventing our chosen from being Frozen.

@BlackDog86
Copy link
Copy Markdown
Contributor

BlackDog86 commented May 11, 2026

Hi Reshi - the commit history in this submission needs cleaning up. All CHL PRs (unless the rules have changed under Tedster...) need to be made in a single commit, if adjusting files that are already part of Highlander. The only case where there should be more than one commit is if you're adding files TO CHL that aren't already present, so you'll probably need to squash & force push in Git (it can be a pain, depending which Git client you use).

I think in terms of the documentation as well, you should only add this section in one location

/// HL-Docs: feature:EffectImmunity; issue:1575; tags:tactical
/// Long explainer about what this mod changes

Usually the docs are best done in the class with the most extensive changes. The other files can just have Start / End issue tags and a short explainer without the tags. Apologies if this is long-winded but otherwise someone else will just mention it down the line!

ReshiMael added 2 commits May 11, 2026 19:20
Required to implement resolve issue 1575
HL-Docs: feature:EffectImmunity; issue:1575; tags:tactical
Adding a boolean function to enable Persistent Effects on a unit to control whether or not OTHER X2ffects are allowed to be applied to this unit.
This enables various functionality that was previously heavily limited by damage typing.
An example use case: We do not want to X2Effect_MindControl to be allowed to be applied to a unit, but we want to allow other Mental-typed effects to effect this unit.
This would enable that. Alternative use case example: We want to block a Chosen from being able to be Frozen, but do not want to block damage from a weapon that is damage typed as Frost
This also provides a solution should we want to block an effect that has no damage typing.
@ReshiMael
Copy link
Copy Markdown
Contributor Author

Commits are squashed for Clarity
2 Commits are necessary
1- Adding X2Effect to the CHL
2- Modifying X2Effect, X2Effect_Persistent, and XComGameState_Unit to enable the functionality required for 1575

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants