Skip to content

Make X2Effect_AdditionalAnimSets fine-tuneable #222

@robojumper

Description

@robojumper

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions