OverrideMetaHitEffect

Tracking Issue: #1116

Tags: events

Allows listeners to change the behavior of XComUnitPawn::PlayMetaHitEffect(). Meta Hit Effects are intended to communicate the overall effect of the attack, and include things like blood gushing out of the unit.

Listeners can set OverrideMetaHitEffect to true, and then the default behavior will be omitted entirely, and no meta hit effect will be played.

Alternatively, listeners can modify the parameters passed with the Tuple to modify the default behavior.

OverrideMetaHitEffect event

Param Value
EventID OverrideMetaHitEffect
EventData XComLWTuple
EventSource XComUnitPawn
NewGameState none

Tuple contents

Index Name Type Direction
0 OverrideMetaHitEffect bool inout
1 HitLocation vector inout
2 DamageTypeName name inout
3 Momentum vector inout
4 bIsUnitRuptured bool inout
5 HitResult enum (EAbilityHitResult) inout

Listener template

static function EventListenerReturn OnOverrideMetaHitEffect(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComUnitPawn Pawn;
    local XComLWTuple Tuple;
    local bool OverrideMetaHitEffect;
    local vector HitLocation;
    local name DamageTypeName;
    local vector Momentum;
    local bool bIsUnitRuptured;
    local EAbilityHitResult HitResult;

    Pawn = XComUnitPawn(EventSource);
    Tuple = XComLWTuple(EventData);

    OverrideMetaHitEffect = Tuple.Data[0].b;
    HitLocation = Tuple.Data[1].v;
    DamageTypeName = Tuple.Data[2].n;
    Momentum = Tuple.Data[3].v;
    bIsUnitRuptured = Tuple.Data[4].b;
    HitResult = EAbilityHitResult(Tuple.Data[5].i);

    // Your code here

    Tuple.Data[0].b = OverrideMetaHitEffect;
    Tuple.Data[1].v = HitLocation;
    Tuple.Data[2].n = DamageTypeName;
    Tuple.Data[3].v = Momentum;
    Tuple.Data[4].b = bIsUnitRuptured;
    Tuple.Data[5].i = HitResult;

    return ELR_NoInterrupt;
}

Source code references