Example #1
0
        private void addTrap(BasePlayer player, StorageContainer box, int trap)
        {
            uint boxID    = box.net.ID;
            var  trapName = convertToName(trap.ToString());

            bTraps trapInfo;

            if (!currentTraps.TryGetValue(boxID, out trapInfo))
            {
                trapInfo = new bTraps {
                    ID = boxID
                }
            }
            ;
            trapInfo.Position  = box.transform.position;
            trapInfo.Name      = box.panelName;
            trapInfo.Trap      = trap;
            trapInfo.TrapOwner = player.userID.ToString();

            if (!(trapInfo.Name == "generic"))
            {
                currentTraps[boxID] = trapInfo;
                storedData.currentTraps.Add(trapInfo);
                SaveData();
            }
            else
            {
                tempTraps[boxID] = trapInfo;
            }

            SendReply(player, string.Format(lang.GetMessage("title", this, player.UserIDString) + lang.GetMessage("boxTrapped", this, player.UserIDString), trapName));
        }
Example #2
0
        private void assignTraps(LootContainer drop)
        {
            uint boxID      = drop.net.ID;
            int  randomTrap = randomTrapCheck();

            bTraps trapInfo;

            if (!tempTraps.TryGetValue(boxID, out trapInfo))
            {
                trapInfo = new bTraps {
                    ID = boxID
                }
            }
            ;
            trapInfo.Position  = drop.transform.position;
            trapInfo.Name      = drop.panelName;
            trapInfo.Trap      = randomTrap;
            trapInfo.TrapOwner = "boobytraps";

            tempTraps[boxID] = trapInfo;
            var trapName = convertToName(trapInfo.Trap.ToString());

            Puts("Random trap set at " + drop.transform.position + " using trap: " + trapName);
        }