PostRulerTacticalTransfer

Tracking Issue: #1609

Tags: dlc2, events

Fires at the end of tactical play once the vanilla code has finished updating the persistent ruler state: current HP and armor are copied over from the tactical unit and, if the ruler was not killed, the NumEscapes and EscapeHealth unit values are updated. Listeners get the final say on the persisted stats and unit values.

The event fires both when the ruler was killed and when it escaped - use UnitState.IsDead() or the bRulerDefeated/bRulerEscaped flags on the event source to tell the outcomes apart.

RulerState is the persistent ruler unit and belongs to the pending NewGameState, so ELD_Immediate listeners may modify it directly.

UnitState is the unit that took part in the tactical mission, read from the history. It may be none if the ruler was not found among the tactical units (vanilla treats that case as an escape).

PostRulerTacticalTransfer event

Param Value
EventID PostRulerTacticalTransfer
EventData XComLWTuple
EventSource XComGameState_AlienRulerManager
NewGameState yes

Tuple contents

Index Name Type Direction
0 UnitState XComGameState_Unit in
1 RulerState XComGameState_Unit in

Listener template

static function EventListenerReturn OnPostRulerTacticalTransfer(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_AlienRulerManager AlienRulerManager;
    local XComLWTuple Tuple;
    local XComGameState_Unit UnitState;
    local XComGameState_Unit RulerState;

    AlienRulerManager = XComGameState_AlienRulerManager(EventSource);
    Tuple = XComLWTuple(EventData);

    UnitState = XComGameState_Unit(Tuple.Data[0].o);
    RulerState = XComGameState_Unit(Tuple.Data[1].o);

    // Your code here

    return ELR_NoInterrupt;
}

Source code references