//Made possible my Michaelis. Sightly modified to match the actual Dusk explode timing.

#library "moortaar"
#include "zcommon.acs"

#define MORTAR_TIDBASE 2000

// Activator: player
Script "csdmo_BreachchargeDetonate" (void)
{
    int tid = MORTAR_TIDBASE + PlayerNumber();
    if(!IsTidUsed(tid)) terminate;
    
    SetActivator(tid); // Activator: mortar ball
    SetActorState(0, "Death");
    SetActivatorToTarget(tid); // Activator: player
    
    delay(1);
    restart;
}

// Activator: mortar ball
Script "CSDMO_BreachchargeFired" (void)
{
    int tid = UniqueTid();
    Thing_ChangeTID(0, tid);
    
    SetActivatorToTarget(0);
    // Activator: owner
    int plr = PlayerNumber();
    Thing_ChangeTID(tid, MORTAR_TIDBASE + plr);
}