コード例 #1
0
        private void cmdRadZoneList(BasePlayer player, string command, string[] args)
        {
            if (!IsAdmin(player))
            {
                return;
            }

            if (radiationZones.Count == 0)
            {
                SendReply(player, msg("NoRadiationZones", player.userID));
                return;
            }

            for (int i = 0; i < radiationZones.Count; i++)
            {
                if (i == 0)
                {
                    SendEchoConsole(player.net.connection, $"---- MonumentRadiation Zone List ----");
                }

                RadiationZone zone = radiationZones[i];
                SendEchoConsole(player.net.connection, $"{zone.name} || Location: {zone.transform.position} || Radius: {zone.radius} || Radiation Amount: {zone.amount}");
            }
            SendReply(player, msg("Title", player.userID) + msg("InfoToConsole", player.userID));
        }
コード例 #2
0
 public void RemoveRadiationZone(RadiationZone zone)
 {
     if ((this.radiationZones != null) && this.radiationZones.Remove(zone))
     {
         zone.RemoveFromRadiation(this);
     }
 }
コード例 #3
0
ファイル: ZoneManager.cs プロジェクト: wilddip/Oxide2Plugins
 void Awake()
 {
     radiation = gameObject.AddComponent <RadiationZone>();
     zone      = GetComponent <Zone>();
     radiation.exposurePerMin = float.Parse(zone.info.radiation);
     radiation.radius         = GetComponent <UnityEngine.SphereCollider>().radius;
     Interface.CallHook("anticheatAllowRadiationZone", radiation);
 }
コード例 #4
0
 public void AddRadiationZone(RadiationZone zone)
 {
     if (zone.CanAddToRadiation(this))
     {
         if (this.radiationZones == null)
         {
         }
         (this.radiationZones = new List <RadiationZone>()).Add(zone);
     }
 }
コード例 #5
0
 public void AddRadiationZone(RadiationZone zone)
 {
     if (zone.CanAddToRadiation(this))
     {
         if (this.radiationZones == null)
         {
         }
         (this.radiationZones = new System.Collections.Generic.List <RadiationZone>()).Add(zone);
     }
 }
コード例 #6
0
 public void SetInfo(ZoneDefinition info)
 {
     this.info = info;
     GetComponent <UnityEngine.Transform>().position    = info.Location.GetPosition();
     GetComponent <UnityEngine.SphereCollider>().radius = info.Location.GetRadius();
     radiationamount = 0f;
     if (float.TryParse(info.radiation, out radiationamount))
     {
         radiationzone = gameObject.AddComponent <RadiationZone>();
     }
 }
コード例 #7
0
 public void AddRadiationZone(RadiationZone zone)
 {
     if (zone.CanAddToRadiation(this))
     {
         List <RadiationZone> radiationZones = this.radiationZones;
         if (radiationZones == null)
         {
             List <RadiationZone> radiationZones1 = new List <RadiationZone>();
             List <RadiationZone> radiationZones2 = radiationZones1;
             this.radiationZones = radiationZones1;
             radiationZones      = radiationZones2;
         }
         radiationZones.Add(zone);
     }
 }
コード例 #8
0
            public void SetInfo(ZoneDefinition info)
            {
                this.info = info;
                GetComponent <UnityEngine.Transform>().position    = info.Location.GetPosition();
                GetComponent <UnityEngine.SphereCollider>().radius = info.Location.GetRadius();
                radiationamount = 0f;
                zoneMask        = 0;
                if (info.undestr != null || info.nodecay != null)
                {
                    zoneMask |= ((int)1) << UnityEngine.LayerMask.NameToLayer("Construction");
                    zoneMask |= ((int)1) << UnityEngine.LayerMask.NameToLayer("Deployed");
                }
                if (info.nogather != null)
                {
                    zoneMask |= ((int)1) << UnityEngine.LayerMask.NameToLayer("Resource");
                    zoneMask |= ((int)1) << UnityEngine.LayerMask.NameToLayer("Tree");
                }
                if (info.nopve != null)
                {
                    zoneMask |= ((int)1) << UnityEngine.LayerMask.NameToLayer("AI");
                }
                if (zoneMask != 0)
                {
                    InvokeRepeating("CheckCollisions", 0f, 10f);
                }

                if (info.autolights != null)
                {
                    float currentTime = GetSkyHour();

                    if (currentTime > AutolightOffTime && currentTime < AutolightOnTime)
                    {
                        lightsOn = true;
                    }
                    else
                    {
                        lightsOn = false;
                    }
                    InvokeRepeating("CheckLights", 0f, 10f);
                }

                if (float.TryParse(info.radiation, out radiationamount))
                {
                    radiationzone = gameObject.AddComponent <RadiationZone>();
                }
            }
コード例 #9
0
        private void ccmdRadZoneList(ConsoleSystem.Arg arg)
        {
            if (!IsAuthed(arg))
            {
                return;
            }

            if (radiationZones.Count == 0)
            {
                SendReply(arg, "There are no radiation zones setup");
                return;
            }

            for (int i = 0; i < radiationZones.Count; i++)
            {
                if (i == 0)
                {
                    SendReply(arg, $"---- MonumentRadiation Zone List ----");
                }

                RadiationZone zone = radiationZones[i];
                SendReply(arg, $"{zone.name} || Location: {zone.transform.position} || Radius: {zone.radius} || Radiation Amount: {zone.amount}");
            }
        }
コード例 #10
0
ファイル: ZoneManager.cs プロジェクト: bloodyblaze/rep-Mods
            public void SetInfo(ZoneDefinition info)
            {
                this.info = info;
                GetComponent<UnityEngine.Transform>().position = info.Location.GetPosition();
                GetComponent<UnityEngine.SphereCollider>().radius = info.Location.GetRadius();
                radiationamount = 0f;
                zoneMask = 0;
                if(info.undestr != null || info.nodecay != null)
                {
                    zoneMask |= ((int)1) << LayerMask.NameToLayer("Construction");
                    zoneMask |= ((int)1) << LayerMask.NameToLayer("Deployed");
                }
                if(info.nogather != null)
                {
                    zoneMask |= ((int)1) << LayerMask.NameToLayer("Resource");
                    zoneMask |= ((int)1) << LayerMask.NameToLayer("Tree");
                }
                if (info.nopve != null)
                {
                    zoneMask |= ((int)1) << LayerMask.NameToLayer("AI");
                }
                if (zoneMask != 0) InvokeRepeating("CheckCollisions", 0f, 10f);

                if (info.autolights != null)
                {
                    float currentTime = GetSkyHour();

                    if (currentTime > AutolightOffTime && currentTime < AutolightOnTime)
                    {
                        lightsOn = true;
                    }
                    else
                    {
                        lightsOn = false;
                    }
                    InvokeRepeating("CheckLights", 0f, 10f);
                }

                if (float.TryParse(info.radiation, out radiationamount))
                    radiationzone = gameObject.AddComponent<RadiationZone>();
            }
コード例 #11
0
 void Awake()
 {
     radiation = gameObject.AddComponent<RadiationZone>();
     zone = GetComponent<Zone>();
     radiation.exposurePerMin = float.Parse(zone.info.radiation);
     radiation.radius = GetComponent<UnityEngine.SphereCollider>().radius;
     Interface.CallHook("anticheatAllowRadiationZone", radiation);
 }