XP-L0 DE: Tactical Part Removal Device

XP-L0 DE: Tactical Part Removal Device

867 Downloads

My first mod!

Add this onto your rocket and activate it to "remove" a part from your rocket "safelyā€¯. (It's basically a bomb)
Can be activated through an action group, or by right-clicking it in-flight.

Also supports grabbing and storing trough KAS! (I think you can strap it onto kerbals, but we wouldn't do that, right?)

The model is just the big radial battery which i simply reskinned. But i think it looks pretty good!

Spoiler for source code!

usingSystem;
usingSystem.Collections.Generic;
usingSystem.Collections;
usingUnityEngine;

publicclassKSPBomb : PartModule
{
    [KSPAction("ExplodeAction"KSPActionGroup.NoneguiName = "Explode")] //Action Group thingy
    publicvoidBlowUpByActionGroup(KSPActionParamparam)
    {
        DoBoom ();
    }

    [KSPEvent(name = "Explode"active = trueguiActive = trueguiName = "Explode")] //Right click in-flight
    publicvoidDoBoom()
    {
        foreach (PartchildPartinpart.children) //I don't think you can attach stuff to this, but in case someone changes it it will work.
        {
            childPart.temperature = childPart.maxTemp * 2;
        }

        part.parent.temperature = part.parent.maxTemp * 2; //heat whatever i'm attached to to twice it's max temprature
        part.temperature = part.maxTemp * 2; //Same for myself. Goodbye world!
    }
}