WillRecoveryTimeModifier

Tracking Issue: #650

Tags: events

Allows mods to apply a multiplier to the Will recovery project time, where a value of 1.0 makes no change, 2.0 doubles the duration, etc. Listeners can get the recovering unit from the Will project's ProjectFocus property.

WillRecoveryTimeModifier event

Param Value
EventID WillRecoveryTimeModifier
EventData XComLWTuple
EventSource XComGameState_HeadquartersProjectRecoverWill
NewGameState maybe

Tuple contents

Index Name Type Direction
0 TimeMultiplier float inout
1 bAssumeActive bool in

Listener template

static function EventListenerReturn OnWillRecoveryTimeModifier(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_HeadquartersProjectRecoverWill ProjectState;
    local XComLWTuple Tuple;
    local float TimeMultiplier;
    local bool bAssumeActive;

    ProjectState = XComGameState_HeadquartersProjectRecoverWill(EventSource);
    Tuple = XComLWTuple(EventData);

    TimeMultiplier = Tuple.Data[0].f;
    bAssumeActive = Tuple.Data[1].b;

    // Your code here

    Tuple.Data[0].f = TimeMultiplier;

    return ELR_NoInterrupt;
}

The NewGameState and bAssumeActive will be whatever caller to CalculateWorkPerHour() passes. Note that both arguments are optional.

If you want to modify the TimeMultiplier, you must subscribe with ELD_Immediate deferral

Source code references