コード例 #1
0
        private void ResetBradley()
        {
            BradleySpawner singleton = BradleySpawner.singleton;

            if (singleton == null)
            {
                Puts("No Bradley Spawner!");
            }
            else
            {
                if ((bool)singleton.spawned)
                {
                    singleton.spawned.Kill(BaseNetworkable.DestroyMode.None);
                }

                singleton.spawned = null;
                singleton.DoRespawn();
            }
        }
コード例 #2
0
        public static void quickrespawn(ConsoleSystem.Arg arg)
        {
            if (!arg.Player())
            {
                return;
            }
            BradleySpawner bradleySpawner = BradleySpawner.singleton;

            if (bradleySpawner == null)
            {
                Debug.LogWarning("No Spawner");
                return;
            }
            if (bradleySpawner.spawned)
            {
                bradleySpawner.spawned.Kill(BaseNetworkable.DestroyMode.None);
            }
            bradleySpawner.spawned = null;
            bradleySpawner.DoRespawn();
        }
コード例 #3
0
ファイル: Bradley.cs プロジェクト: Ailtop/RustDocuments
        public static void quickrespawn(Arg arg)
        {
            if (!ArgEx.Player(arg))
            {
                return;
            }
            BradleySpawner singleton = BradleySpawner.singleton;

            if (singleton == null)
            {
                Debug.LogWarning("No Spawner");
                return;
            }
            if ((bool)singleton.spawned)
            {
                singleton.spawned.Kill();
            }
            singleton.spawned = null;
            singleton.DoRespawn();
        }
コード例 #4
0
        /*
         * DoRespawn
         *
         * Respawn Bradley
         */
        bool DoRespawn(IPlayer player)
        {
            BradleySpawner singleton = BradleySpawner.singleton;

            if (singleton == null)
            {
                Puts("No Bradley spawner found!");
                return(false);
            }

            if (!Bradley.enabled)
            {
                Puts("Bradley has been disabled! Enable it if you want this plugin to work.");
                return(false);
            }

            if ((bool)singleton.spawned)
            {
                singleton.spawned.Kill(BaseNetworkable.DestroyMode.None);
            }

            singleton.spawned = null;
            singleton.DoRespawn();

            if (this.config_data.Options.LockBradleyOnRespawn && !player.HasPermission("respawnbradley.nolock"))
            {
                if (LootDefender != null)
                {
                    // Telling LootDefender Bradley took max amount of damage, this should hopefully always lock it whatever Damage Lock Threshold has been configured to
                    HitInfo hit_info = new HitInfo(player.Object as BaseEntity, singleton.spawned as BaseEntity, DamageType.Generic, singleton.spawned.MaxHealth(), new Vector3());
                    LootDefender.Call("OnEntityTakeDamage", singleton.spawned, hit_info);
                }
                else
                {
                    Puts("Unable to lock Bradley without LootDefender plugin!");
                }
            }

            return(true);
        }
コード例 #5
0
        public static void quickrespawn(ConsoleSystem.Arg arg)
        {
            if (!Object.op_Implicit((Object)arg.Player()))
            {
                return;
            }
            BradleySpawner singleton = BradleySpawner.singleton;

            if (Object.op_Equality((Object)singleton, (Object)null))
            {
                Debug.LogWarning((object)"No Spawner");
            }
            else
            {
                if (Object.op_Implicit((Object)singleton.spawned))
                {
                    singleton.spawned.Kill(BaseNetworkable.DestroyMode.None);
                }
                singleton.spawned = (BradleyAPC)null;
                singleton.DoRespawn();
            }
        }