long-war-2 / lwotc

Port of Long War 2 to XCOM 2's War of the Chosen expansion
345 stars 91 forks source link

Relays have vanilla HP #120

Closed pledbrook closed 5 years ago

pledbrook commented 5 years ago

When destroying (and perhaps protecting) relays, the relays themselves have vanilla HP rather than LW2 values.

pledbrook commented 5 years ago

The old LW2 had this DLC hook:

static function bool OverrideDestructibleInitialHealth(out int NewHealth, XComGameState_Destructible DestructibleState, XComDestructibleActor Visualizer)
{
    local ArchetypeToHealth Override;
    local int CurrentDifficulty;

    `LWTRACE("In Toughness of actor : " $ Visualizer.ObjectArchetype.name $ " (" $ DestructibleState.ActorId.ActorName $ ") = " $ DestructibleState.Health);
    CurrentDifficulty = `DIFFICULTYSETTING;
    foreach default.DestructibleActorHealthOverride (Override)
    {
        if (Visualizer.ObjectArchetype.name == Override.ArchetypeName)
        {
            if (Override.Difficulty == -1 || Override.Difficulty == CurrentDifficulty)
            {
                NewHealth = Override.Health;
                `LWTRACE("Out Toughness of actor : " $ Visualizer.ObjectArchetype.name $ " (" $ DestructibleState.ActorId.ActorName $ ") = " $ NewHealth);
                return true;
            }
        }
    }

    return false;
}

Will require a highlander change for this, specifically in XComDestructibleActor.uc and XComGameState_Destructible.uc.

pledbrook commented 5 years ago

Going to push this back. I've been trying the implementation from the Configurable Protect Device mod, but can't get it to work. And I'm not sure that folks are ready to have the highlander patch that Pavonis did for this.