OverrideNegativeTraitRoll

Tracking Issue: #1150

Tags: events

Fires an event that allows mods to override whether a soldier should get a negative trait after the mission. Default: Vanilla Behavior will be used.

OverrideNegativeTraitRoll event

Param Value
EventID OverrideNegativeTraitRoll
EventData XComLWTuple
EventSource XComGameState_Unit
NewGameState yes

Tuple contents

Index Name Type Direction
0 ShouldRollNegativeTrait bool inout

Listener template

static function EventListenerReturn OnOverrideNegativeTraitRoll(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_Unit UnitState;
    local XComLWTuple Tuple;
    local bool ShouldRollNegativeTrait;

    UnitState = XComGameState_Unit(EventSource);
    Tuple = XComLWTuple(EventData);

    ShouldRollNegativeTrait = Tuple.Data[0].b;

    // Your code here

    Tuple.Data[0].b = ShouldRollNegativeTrait;

    return ELR_NoInterrupt;
}

Source code references