Inheritance: MonoBehaviour
Example #1
0
    //Start;
    void Start()
    {
        //Get references to components;
        r           = GetComponent <Rigidbody>();
        triggerArea = GetComponentInChildren <TriggerArea>();

        //Disable gravity, freeze rotation of rigidbody and set to kinematic;
        r.freezeRotation = true;
        r.useGravity     = false;
        r.isKinematic    = true;

        //Check if any waypoints have been assigned and if not, throw a warning;
        if (waypoints.Count <= 0)
        {
            Debug.LogWarning("No waypoints have been assigned to 'MovingPlatform'!");
        }
        else
        {
            //Set first waypoint;
            currentWaypoint = waypoints[currentWaypointIndex];
        }

        //Start coroutines;
        StartCoroutine(WaitRoutine());
        StartCoroutine(LateFixedUpdate());
    }
Example #2
0
 /// <summary>
 /// Adds a trigger for the event to this tile.
 /// </summary>
 /// <param name="trigger"></param>
 public void AddTrigger(TriggerArea trigger)
 {
     triggers.Add(new TriggerID()
     {
         id      = battlemap.triggerList.values[trigger.idIndex].id,
         faction = trigger.faction
     });
 }
Example #3
0
 public Detector(GameObject root)
 {
     Root        = root;
     RootWrapper = GetWrapperInternal(root, GoOn);
     RaycastTargetWrapperList = GetRaycastTargetWrapperList(RootWrapper);
     ButtonWrapperList        = GetButtonWrapperList(RootWrapper);
     GetTriggerArea(RaycastTargetWrapperList);
 }
        void Start()
        {
            TriggerArea ta = triggerArea.gameObject.AddComponent <TriggerArea>();

            ta.ui = this;
            if (cam == null)
            {
                cam = Camera.main;
            }
        }
Example #5
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         Vector3     pos = collision.gameObject.transform.position;
         Box_Manager bm  = boxManager_obj.GetComponent <Box_Manager>();
         bm.createBox(box, pos, mode);
         //Box_Manager bm = new Box_Manager(box, mode, pos);
         TriggerArea ta = gameObject.GetComponent <TriggerArea>();
         Destroy(ta);
     }
 }
        public static void GenericDamage(CLRScriptBase script, NWLocation location, TriggerArea triggerArea, int effectArea, float effectSize, int damageType, int diceNumber, int diceType, int saveDC, int attackBonus, int numberOfShots, uint trapOrigin, int targetAlignment, int targetRace, int minimumToTrigger, int detectDC, int disarmDC, string description)
        {
            string tag = uniqueTrapTag();
            string detectTag = tag + detectSuffix();
            
            script.ApplyEffectAtLocation(DURATION_TYPE_PERMANENT,
                script.SupernaturalEffect(script.EffectAreaOfEffect(triggerAreaToAreaOfEffect(triggerArea), "acr_traponenter", "****", "acr_traponexit", tag)),
                location,
                0.0f);

            script.ApplyEffectAtLocation(DURATION_TYPE_PERMANENT,
                script.SupernaturalEffect(script.EffectAreaOfEffect(triggerAreaToDetectArea(triggerArea), "acr_trapdtctenter", "****", "acr_trapdtctexit", detectTag)),
                location,
                0.0f);

            ALFA.Shared.ActiveTrap createdTrap = new ALFA.Shared.ActiveTrap();
            createdTrap.AreaName = script.GetName(script.GetAreaFromLocation(location));
            createdTrap.AttackBonus = attackBonus;
            createdTrap.ChallengeRating = 0.0f;
            createdTrap.DamageType = damageType;
            createdTrap.DetectTag = detectTag;
            createdTrap.DiceNumber = diceNumber;
            createdTrap.DiceType = diceType;
            createdTrap.EffectArea = effectArea;
            createdTrap.EffectSize = effectSize;
            createdTrap.Location = location;
            createdTrap.MinimumToTrigger = minimumToTrigger;
            createdTrap.NumberOfShots = numberOfShots;
            createdTrap.SaveDC = saveDC;
            createdTrap.SpellTrap = false;
            createdTrap.Tag = tag;
            createdTrap.TargetAlignment = targetAlignment;
            createdTrap.TargetRace = targetRace;
            createdTrap.TrapTriggerVFX = triggerAreaToTrapVFX(triggerArea);
            createdTrap.DetectDC = detectDC;
            createdTrap.DisarmDC = disarmDC;
            createdTrap.Detected = false;
            createdTrap.Disabler = 0;
            createdTrap.Helpers = new List<uint>();
            createdTrap.TotalHelp = 0;
            createdTrap.IsFiring = false;
            createdTrap.Description = description;
            createdTrap.ConfigureDisplayName();
            createdTrap.CalculateCR();

            createdTrap.TrapOrigin = GetNearestTrapEmitter(script, location);

            ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect.Add(detectTag, createdTrap);
            ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers.Add(tag, createdTrap);

            script.SetLocalString(script.GetModule(), "ACR_TRAPS_LAST_TAG", tag);
        }
Example #7
0
        public static void GenericDamage(CLRScriptBase script, NWLocation location, TriggerArea triggerArea, int effectArea, float effectSize, int damageType, int diceNumber, int diceType, int saveDC, int attackBonus, int numberOfShots, uint trapOrigin, int targetAlignment, int targetRace, int minimumToTrigger, int detectDC, int disarmDC, string description)
        {
            string tag       = uniqueTrapTag();
            string detectTag = tag + detectSuffix();

            script.ApplyEffectAtLocation(DURATION_TYPE_PERMANENT,
                                         script.SupernaturalEffect(script.EffectAreaOfEffect(triggerAreaToAreaOfEffect(triggerArea), "acr_traponenter", "****", "acr_traponexit", tag)),
                                         location,
                                         0.0f);

            script.ApplyEffectAtLocation(DURATION_TYPE_PERMANENT,
                                         script.SupernaturalEffect(script.EffectAreaOfEffect(triggerAreaToDetectArea(triggerArea), "acr_trapdtctenter", "****", "acr_trapdtctexit", detectTag)),
                                         location,
                                         0.0f);

            ALFA.Shared.ActiveTrap createdTrap = new ALFA.Shared.ActiveTrap();
            createdTrap.AreaName         = script.GetName(script.GetAreaFromLocation(location));
            createdTrap.AttackBonus      = attackBonus;
            createdTrap.ChallengeRating  = 0.0f;
            createdTrap.DamageType       = damageType;
            createdTrap.DetectTag        = detectTag;
            createdTrap.DiceNumber       = diceNumber;
            createdTrap.DiceType         = diceType;
            createdTrap.EffectArea       = effectArea;
            createdTrap.EffectSize       = effectSize;
            createdTrap.Location         = location;
            createdTrap.MinimumToTrigger = minimumToTrigger;
            createdTrap.NumberOfShots    = numberOfShots;
            createdTrap.SaveDC           = saveDC;
            createdTrap.SpellTrap        = false;
            createdTrap.Tag             = tag;
            createdTrap.TargetAlignment = targetAlignment;
            createdTrap.TargetRace      = targetRace;
            createdTrap.TrapTriggerVFX  = triggerAreaToTrapVFX(triggerArea);
            createdTrap.DetectDC        = detectDC;
            createdTrap.DisarmDC        = disarmDC;
            createdTrap.Detected        = false;
            createdTrap.Disabler        = 0;
            createdTrap.Helpers         = new List <uint>();
            createdTrap.TotalHelp       = 0;
            createdTrap.IsFiring        = false;
            createdTrap.Description     = description;
            createdTrap.ConfigureDisplayName();
            createdTrap.CalculateCR();

            createdTrap.TrapOrigin = GetNearestTrapEmitter(script, location);

            ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect.Add(detectTag, createdTrap);
            ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers.Add(tag, createdTrap);

            script.SetLocalString(script.GetModule(), "ACR_TRAPS_LAST_TAG", tag);
        }
Example #8
0
    public void GetButton(TriggerArea RootWrapper, List <TriggerArea> Buttons)
    {
        if (RootWrapper.Btn != null)
        {
            Buttons.Add(RootWrapper);
        }


        foreach (TriggerArea child in RootWrapper.Pubwrapperlist)
        {
            GetButton(child, Buttons);
        }
    }
Example #9
0
    public void GetRaycastTarget(TriggerArea rootWrapper, List <TriggerArea> RaycastTargets)
    {
        if (rootWrapper.bRaycastTargetActive)
        {
            RaycastTargets.Add(rootWrapper);
        }


        foreach (TriggerArea child in rootWrapper.Pubwrapperlist)
        {
            GetRaycastTarget(child, RaycastTargets);
        }
    }
Example #10
0
    void Start()
    {
        TriggerArea triggerArea = GetComponent <TriggerArea>();

        if (triggerArea != null)
        {
            triggerArea.TriggerEnter += OnStageEnter;
            triggerArea.TriggerExit  += OnStageExit;
        }
        else
        {
            Debug.LogError("No Trigger Area found");
        }
    }
Example #11
0
 public TriggerArea GetWrapperWithButton(TriggerArea CurrentWrapper)
 {
     if (CurrentWrapper.TargetObj.GetComponent <Canvas>() != null)
     {
         return(null);
     }
     else if (CurrentWrapper.Btn != null)
     {
         return(CurrentWrapper);
     }
     else
     {
         return(GetWrapperWithButton(CurrentWrapper.Parentwrapper));
     }
 }
Example #12
0
    private void CreateTriggers(MapEntry map)
    {
        int triggerCount = 0;

        for (int i = 0; i < map.triggerAreas.Count; i++)
        {
            TriggerArea area = map.triggerAreas[i];
            for (int x = area.xMin; x < area.xMax + 1; x++)
            {
                for (int y = area.yMin; y < area.yMax + 1; y++)
                {
                    battleMap.GetTile(x, y).AddTrigger(area);
                    triggerCount++;
                }
            }
        }
        Debug.Log("Added triggers to tiles:  " + triggerCount);
    }
Example #13
0
        /// <summary>
        /// This method gets the name of a trap-placement VFX that is appropriate for the trap
        /// to be spawned.
        /// </summary>
        /// <param name="triggerArea">the TriggerArea to match against</param>
        /// <returns>the name of an appropriate VFX</returns>
        private static string triggerAreaToTrapVFX(TriggerArea triggerArea)
        {
            string visual = "acr_trap_";

            switch (triggerArea)
            {
            case TriggerArea.Small:
            {
                visual += "010";
                break;
            }

            case TriggerArea.Medium:
            {
                visual += "015";
                break;
            }

            case TriggerArea.Large:
            {
                visual += "020";
                break;
            }

            case TriggerArea.Huge:
            {
                visual += "025";
                break;
            }

            case TriggerArea.Gargantuan:
            {
                visual += "030";
                break;
            }

            case TriggerArea.Colossal:
            {
                visual += "035";
                break;
            }
            }
            return(visual);
        }
Example #14
0
        /// <summary>
        /// This method turns a TriggerArea value into a constant that can be used
        /// for a trap's detection area.
        /// </summary>
        /// <param name="triggerArea">The TriggerArea to match</param>
        /// <returns>a vfx_persistent.2da line number</returns>
        private static int triggerAreaToDetectArea(TriggerArea triggerArea)
        {
            int areaOfEffect = 83;

            switch (triggerArea)
            {
            case TriggerArea.Small:
            {
                areaOfEffect = 83;
                break;
            }

            case TriggerArea.Medium:
            {
                areaOfEffect = 84;
                break;
            }

            case TriggerArea.Large:
            {
                areaOfEffect = 85;
                break;
            }

            case TriggerArea.Huge:
            {
                areaOfEffect = 87;
                break;
            }

            case TriggerArea.Gargantuan:
            {
                areaOfEffect = 88;
                break;
            }

            case TriggerArea.Colossal:
            {
                areaOfEffect = 86;
                break;
            }
            }
            return(areaOfEffect);
        }
Example #15
0
        public Room0(int x, int y) : base("room0", new Vector2D(x, y), new Rectangle(0, 64, 432, 400))
        {
            Renderable renderable = this.Components.Get <Renderable>();

            renderable.Sprites.Add(new Vent(new Vector2D(5 * 16, 22 * 16), HorizontalDirection.Left));
            renderable.Sprites.Add(new Vent(new Vector2D(15 * 16, 22 * 16), HorizontalDirection.Right));

            LabRoomBuilder rb = new LabRoomBuilder(40, 43, "lab_tileset", 7);

            rb.Fill(new Rectangle(0, 0, 20, 8), true); //Floor
            this.AddCollision(CoordinateMode.Grid, new CollisionBox(0, 0, 19.75, 8)
            {
                RightFaceProperties = new CollisionFaceProperties()
            });                                                //Floor

            this.AddSegment(rb, new Rectangle(0, 8, 4, 10));   //Left Wall
            this.AddSegment(rb, new Rectangle(2, 21, 2, 6));   //Left Wall Above Glass
            this.AddSegment(rb, new Rectangle(18, 11, 2, 16)); //Right Wall

            rb.Fill(new Rectangle(20, 0, 20, 6), true);        //Floor after slope
            this.AddCollision(CoordinateMode.Grid, new CollisionBox(20, 0, 20, 6)
            {
                TopFaceProperties = new CollisionFaceProperties(true, 0.3, true)
            });                                                //Floor after slope

            this.AddSegment(rb, new Rectangle(0, 27, 40, 10)); //Ceiling

            this.FinalizeCollision();
            rb.ResolveNeighbors();

            TriggerArea hintMove = new TriggerArea(new Rectangle(16 * 16, 6 * 16, 5 * 16, 4 * 16), true);

            hintMove.Components.Add(new ShowTextComponent(new TextUnit(new Sprite("x_icons", new Rectangle(0, 0, 18, 18), new Rectangle(90, 0, 18, 18))
            {
                Modifiers = Sprite.Mod_InputType
            }, "Walk"), 10));
            this.QueueEntity(hintMove);

            rb.Fill(new Rectangle(18, 4, 7, 2), new RoomTileRaw()
            {
                Enabled = true, Initialized = true, Neighbors = 0b11111111, TileMapOffset = new Vector2D(0, 256)
            });
Example #16
0
    public bool IsPlayerInArea(string areaname)
    {
        if (!playership)
        {
            return(false);
        }
        GameObject areaobj = GameObject.Find(areaname);

        if (areaobj == null)
        {
            Debug.LogError("Cant find area " + areaname + " in scene");
            return(false);
        }
        TriggerArea area = areaobj.GetComponent <TriggerArea>();
        float       Range;

        Range = area.Radius;

        return(Vector3.Distance(playership.transform.position, areaobj.transform.position) < Range);
    }
    // Use this for initialization
    void Start()
    {
        PauseManager.setGameOver(false);

        ta = Instantiate(taPrefab, Vector3.zero, Quaternion.identity);

        NextTarget();

        ta.Subscribe(Calculate);

        if (timer)
        {
            timer.Subscribe(GameOver);
        }
        if (spawnTimer)
        {
            spawnTimer.Subscribe(UbaciUSobu);
            spawnTimer.StartTimer(initialSpawnTime);
        }
    }
Example #18
0
    public TriggerArea GetWrapperInternal(GameObject root, bool goOn)
    {
        if (!goOn)
        {
            return(null);
        }
        TriggerArea wrapper = new TriggerArea();

        wrapper.TargetObj = root;


        if (root.GetComponent <Graphic>() != null && !root.GetComponent <Text>())
        {
            wrapper.bRaycastTargetActive = root.GetComponent <Graphic>().raycastTarget;
        }
        else
        {
            wrapper.bRaycastTargetActive = false;
        }

        foreach (Transform child in root.GetComponent <Transform>())
        {
            TriggerArea subwrapper = new TriggerArea();
            if (child != null)
            {
                subwrapper = GetWrapperInternal(child.gameObject, goOn);
                subwrapper.Parentwrapper = wrapper;
                wrapper.Pubwrapperlist.Add(subwrapper);
            }
            else
            {
                goOn = false;
            }
        }
        return(wrapper);
    }
 /// <summary>
 /// This method turns a TriggerArea value into a constant that can be used
 /// for a trap's detection area.
 /// </summary>
 /// <param name="triggerArea">The TriggerArea to match</param>
 /// <returns>a vfx_persistent.2da line number</returns>
 private static int triggerAreaToDetectArea(TriggerArea triggerArea)
 {
     int areaOfEffect = 83;
     switch (triggerArea)
     {
         case TriggerArea.Small:
             {
                 areaOfEffect = 83;
                 break;
             }
         case TriggerArea.Medium:
             {
                 areaOfEffect = 84;
                 break;
             }
         case TriggerArea.Large:
             {
                 areaOfEffect = 85;
                 break;
             }
         case TriggerArea.Huge:
             {
                 areaOfEffect = 87;
                 break;
             }
         case TriggerArea.Gargantuan:
             {
                 areaOfEffect = 88;
                 break;
             }
         case TriggerArea.Colossal:
             {
                 areaOfEffect = 86;
                 break;
             }
     }
     return areaOfEffect;
 }
Example #20
0
    public List <TriggerArea> GetButtonWrapperList(TriggerArea RootWrapper)
    {
        GetButton(RootWrapper, ButtonWrapperList);

        return(ButtonWrapperList);
    }
Example #21
0
 public List <TriggerArea> GetRaycastTargetWrapperList(TriggerArea RootWrapper)
 {
     GetRaycastTarget(RootWrapper, RaycastTargetWrapperList);
     return(RaycastTargetWrapperList);
 }
 /// <summary>
 /// This method gets the name of a trap-placement VFX that is appropriate for the trap 
 /// to be spawned.
 /// </summary>
 /// <param name="triggerArea">the TriggerArea to match against</param>
 /// <returns>the name of an appropriate VFX</returns>
 private static string triggerAreaToTrapVFX(TriggerArea triggerArea)
 {
     string visual = "acr_trap_";
     switch (triggerArea)
     {
         case TriggerArea.Small:
             {
                 visual += "010";
                 break;
             }
         case TriggerArea.Medium:
             {
                 visual += "015";
                 break;
             }
         case TriggerArea.Large:
             {
                 visual += "020";
                 break;
             }
         case TriggerArea.Huge:
             {
                 visual += "025";
                 break;
             }
         case TriggerArea.Gargantuan:
             {
                 visual += "030";
                 break;
             }
         case TriggerArea.Colossal:
             {
                 visual += "035";
                 break;
             }
     }
     return visual;
 }
Example #23
0
        public Int32 ScriptMain([In] object[] ScriptParameters, [In] Int32 DefaultReturnCode)
        {
            int Value = (int)ScriptParameters[0]; // ScriptParameterTypes[0] is typeof(int)

            TrapEvent currentEvent = (TrapEvent)ScriptParameters[0];

            switch (currentEvent)
            {
            case TrapEvent.CreateGeneric:
            {
                NWLocation loc    = Location((uint)ScriptParameters[4], Vector((float)ScriptParameters[1], (float)ScriptParameters[2], (float)ScriptParameters[3]), 0.0f);
                string     resRef = (string)ScriptParameters[20];
                if (resRef == "")
                {
                    TriggerArea triggerArea      = (TriggerArea)ScriptParameters[5];
                    int         effectArea       = (int)ScriptParameters[6];
                    float       effectSize       = (float)ScriptParameters[7];
                    int         damageType       = (int)ScriptParameters[8];
                    int         diceNumber       = (int)ScriptParameters[9];
                    int         diceType         = (int)ScriptParameters[10];
                    int         saveDC           = (int)ScriptParameters[11];
                    int         attackBonus      = (int)ScriptParameters[12];
                    int         numberOfShots    = (int)ScriptParameters[13];
                    uint        trapOrigin       = (uint)ScriptParameters[14];
                    int         targetAlignment  = (int)ScriptParameters[15];
                    int         targetRace       = (int)ScriptParameters[16];
                    int         minimumToTrigger = (int)ScriptParameters[17];
                    int         detectDC         = (int)ScriptParameters[18];
                    int         disarmDC         = (int)ScriptParameters[19];
                    CreateTraps.GenericDamage(this, loc, triggerArea, effectArea, effectSize, damageType, diceNumber, diceType, saveDC, attackBonus, numberOfShots, trapOrigin, targetAlignment, targetRace, minimumToTrigger, detectDC, disarmDC, "");
                    break;
                }
                else
                {
                    ALFA.Shared.TrapResource trapToSpawn = ALFA.Shared.Modules.InfoStore.ModuleTraps[(string)ScriptParameters[20]];
                    if (trapToSpawn.SpellTrap)
                    {
                        CreateTraps.Spell(this, loc, (TriggerArea)trapToSpawn.TriggerArea, trapToSpawn.SpellId, trapToSpawn.NumberOfShots, trapToSpawn.TrapOrigin, trapToSpawn.TargetAlignment, trapToSpawn.TargetRace, trapToSpawn.MinimumToTrigger, trapToSpawn.DetectDC, trapToSpawn.DisarmDC, trapToSpawn.Description);
                    }
                    else
                    {
                        CreateTraps.GenericDamage(this, loc, (TriggerArea)trapToSpawn.TriggerArea, trapToSpawn.EffectArea, trapToSpawn.EffectSize, trapToSpawn.DamageType, trapToSpawn.DiceNumber, trapToSpawn.DiceType, trapToSpawn.SaveDC, trapToSpawn.AttackBonus, trapToSpawn.NumberOfShots, trapToSpawn.TrapOrigin, trapToSpawn.TargetAlignment, trapToSpawn.TargetRace, trapToSpawn.MinimumToTrigger, trapToSpawn.DetectDC, trapToSpawn.DisarmDC, trapToSpawn.Description);
                    }
                }
                break;
            }

            case TrapEvent.CreateSpell:
            {
                NWLocation  loc              = Location((uint)ScriptParameters[4], Vector((float)ScriptParameters[1], (float)ScriptParameters[2], (float)ScriptParameters[3]), 0.0f);
                TriggerArea triggerArea      = (TriggerArea)ScriptParameters[5];
                int         spellId          = (int)ScriptParameters[8];
                int         numberOfShots    = (int)ScriptParameters[13];
                uint        trapOrigin       = (uint)ScriptParameters[14];
                int         targetAlignment  = (int)ScriptParameters[15];
                int         targetRace       = (int)ScriptParameters[16];
                int         minimumToTrigger = (int)ScriptParameters[17];
                int         detectDC         = (int)ScriptParameters[18];
                int         disarmDC         = (int)ScriptParameters[19];
                CreateTraps.Spell(this, loc, triggerArea, spellId, numberOfShots, trapOrigin, targetAlignment, targetRace, minimumToTrigger, detectDC, disarmDC, "");
                break;
            }

            case TrapEvent.DetectEnter:
            {
                string trapTag = GetTag(OBJECT_SELF);
                if (ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect.Keys.Contains(trapTag))
                {
                    TrapDetect.Enter(this, ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect[trapTag]);
                }
                else
                {
                    uint enteringObject = GetEnteringObject();
                    SendMessageToPC(enteringObject, String.Format("Error: This appears to be a trap detection trigger, but I can not find any trap named {0}", trapTag));
                }
                break;
            }

            case TrapEvent.DetectExit:
            {
                string trapTag        = GetTag(OBJECT_SELF);
                uint   enteringObject = GetEnteringObject();
                if (ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect.Keys.Contains(trapTag))
                {
                    TrapDetect.Exit(this, ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect[trapTag]);
                }
                break;
            }

            case TrapEvent.TriggerEnter:
            {
                string trapTag = GetTag(OBJECT_SELF);
                if (ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers.Keys.Contains(trapTag))
                {
                    TrapTrigger.Enter(this, ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers[trapTag]);
                }
                else
                {
                    uint enteringObject = GetEnteringObject();
                    SendMessageToPC(enteringObject, String.Format("Error: This appears to be a trap firing trigger, but I can not find any trap named {0}", trapTag));
                }
                break;
            }

            case TrapEvent.TriggerExit:
            {
                string trapTag        = GetTag(OBJECT_SELF);
                uint   enteringObject = GetEnteringObject();
                if (ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers.Keys.Contains(trapTag))
                {
                    TrapTrigger.Exit(this, ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers[trapTag]);
                }
                break;
            }

            case TrapEvent.TrapDisarm:
            {
                string trapTag = GetTag(OBJECT_SELF);
                trapTag = trapTag.Substring(0, trapTag.Length - 1);
                uint disabler = GetLastUsedBy();
                if (ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers.Keys.Contains(trapTag))
                {
                    TrapDisable.Disable(this, ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers[trapTag], disabler);
                }
                break;
            }

            case TrapEvent.TrapDespawn:
            {
                string trapTag = GetTag(OBJECT_SELF);
                if (ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers.Keys.Contains(trapTag))
                {
                    TrapDisable.RemoveTrap(this, ALFA.Shared.Modules.InfoStore.SpawnedTrapTriggers[trapTag]);
                }
                if (ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect.Keys.Contains(trapTag))
                {
                    TrapDisable.RemoveTrap(this, ALFA.Shared.Modules.InfoStore.SpawnedTrapDetect[trapTag]);
                }
                break;
            }
            }

            return(0);
        }