OverrideTotalNumKills

Tracking Issue: #562

Tags: events

Allows mods to override the total amount of kill XP this unit has. The event data includes the kill XP calculated by vanilla, which can be left as it is, modified, or replaced completely.

One example use case is to provide an additional source of XP, such as simply going on a mission.

OverrideTotalNumKills event

Param Value
EventID OverrideTotalNumKills
EventData XComLWTuple
EventSource XComGameState_Unit
NewGameState none

Tuple contents

Index Name Type Direction
0 TotalNumKills int inout

Listener template

static function EventListenerReturn OnOverrideTotalNumKills(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_Unit UnitState;
    local XComLWTuple Tuple;
    local int TotalNumKills;

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

    TotalNumKills = Tuple.Data[0].i;

    // Your code here

    Tuple.Data[0].i = TotalNumKills;

    return ELR_NoInterrupt;
}

Source code references