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 X2Effect_AdditionalAnimSets fine-tuneable #222

Open
robojumper opened this issue Apr 24, 2017 · 0 comments
Open

Make X2Effect_AdditionalAnimSets fine-tuneable #222

robojumper opened this issue Apr 24, 2017 · 0 comments

Comments

@robojumper
Copy link
Member

robojumper commented Apr 24, 2017

X2Effect_AdditionalAnimSets is used by XComUnitPawnNativeBase.XComUpdateAnimSetList(). This function ensures that Animations are correct depending on equipped weapon, carrying/being carried etc.

X2Effect_AdditionalAnimSets has been introduced in the Alien Hunters update to append animations for the target of the Archon King's Icarus Drop ability.

However, this does add the AnimSets unconditionally. Using that to have more animations only on a single weapon (i.e. add an override for the sword melee, leaving the Knockout melee unaffected) is not possible. This effect can be seen here.

I propose adding a check to XComUpdateAnimSetList that only adds the AnimSets if a check for IsEffectCurrentlyRelevant passes. Vanilla code:

if( AdditionalAnimSetsEffect != none )
{
	XComAddAnimSets(AdditionalAnimSetsEffect.AdditonalAnimSets);
}

Possible change:

if( AdditionalAnimSetsEffect != none && AdditionalAnimSetsEffect.IsEffectCurrentlyRelevant(EffectState, UnitState))
{
	XComAddAnimSets(AdditionalAnimSetsEffect.AdditonalAnimSets);
}

The effect function (in X2Effect_Persistent) returns true by default. Subclasses can get a call to GetVisualizer() in there and return true or false depending on whether the affected weapon is equipped etc.

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

No branches or pull requests

1 participant