// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   ExplosiveSpecialPlace.java


public class ExplosiveSpecialPlace extends TriggerObject
{

    ExplosiveSpecialPlace()
    {
        OnBombPlanted = null;
        super.MeshName = "Data/Meshes/Equipment/bomba_zdalna.3DA";
    }

    public void BombPlanted()
    {
        GameObject.InvokeActionChain(OnBombPlanted);
    }

    public void OnCreate()
    {
        super.OnCreate();
        super.bSG = true;
        ReplaceMaterial("bomb.mat", "bomb_place.mat");
        ReplaceMaterial("bomb SI.mat", "bomb_place.mat");
        SetFlag(8);
        ClearFlag(32);
        super.bActiveTrigger = true;
        super.sTip = "&HUD_TIP_PLANT_BOMB&";
    }

    void Execute(Actor executor)
    {
        if(executor instanceof Pawn)
        {
            Inventory cPawnInventory = ((Pawn)executor).cInventory;
            Explosive cBomb = (Explosive)cPawnInventory.GetSpecificInvObject(511);
            cBomb.Use();
        }
    }

    public boolean IsActive(ControlObject Activator)
    {
        if(Activator instanceof Pawn)
        {
            Inventory cPawnInventory = ((Pawn)Activator).cInventory;
            return cPawnInventory.GetSpecificInvObject(511) != null;
        } else
        {
            return false;
        }
    }

    public Action OnBombPlanted[];
}
