Exemplo n.º 1
0
        public override bool OnPickup()
        {
            Player ply = new SmodPlayer(PlayerObject);

            ply.PersonalBroadcast(5, "You have picked up a <b>Rocket Launcher</b>!", false);

            return(base.OnPickup());
        }
        public override bool OnPickup()
        {
            Player p = new SmodPlayer(base.PlayerObject);

            p.PersonalBroadcast(3, "<color=#fff8>You have picked up a tranquilizer gun.</color>", false);

            return(base.OnPickup());
        }
Exemplo n.º 3
0
        public override bool OnPickup()
        {
            Player player = new SmodPlayer(base.PlayerObject);

            player.PersonalBroadcast(3, "You have picked up a Defibrilator!", false);

            return(base.OnPickup());
        }
Exemplo n.º 4
0
        protected override void OnValidShoot(UnityEngine.GameObject target, ref float damage)
        {
            SmodPlayer ply;

            try { ply = new SmodPlayer(target); }
            catch { return; }

            damage = 0;
        }
Exemplo n.º 5
0
 public Smod2.API.Player GetById(int id)
 {
     foreach (Smod2.API.Player player in SmodPlayer.GetPlayers())
     {
         if (((GameObject)player.GetGameObject()).GetComponent <RemoteAdmin.QueryProcessor>().PlayerId == id)
         {
             return(player);
         }
     }
     return(null);
 }
        // TODO: Redirect any damage done to ragdoll to player, make invisible player unshootable
        protected override void OnValidShoot(GameObject target, ref float damage)
        {
            SmodPlayer p;

            try { p = new SmodPlayer(target); }
            catch { return; }

            damage = TranqGunPlugin.Damage;

            // -- Exclude certain roles
            if (p.TeamRole.Role == Role.SCP_173 || p.TeamRole.Role == Role.SCP_079)
            {
                return;
            }

            // -- Timed ragdoll logic
            Timing.Run(Tranquilize(p));
        }
Exemplo n.º 7
0
 public List <Smod2.API.Player> GetByName(string name)
 {
     return(SmodPlayer.GetPlayers(name));
 }
Exemplo n.º 8
0
 public List <Smod2.API.Player> GetAll()
 {
     return(SmodPlayer.GetPlayers());
 }
Exemplo n.º 9
0
        public override bool OnDrop()
        {
            Player     player = new SmodPlayer(base.PlayerObject);
            GameObject ply    = (GameObject)player.GetGameObject();
            int        limit  = 0;

            foreach (Ragdoll ragdoll in DefibPlugin.ragdolls.Where(rg => rg.transform.position.x <= ply.transform.position.x + 5f || rg.transform.position.z <= ply.transform.position.z + 2.5f))
            {
                if (limit > 0)
                {
                    break;
                }

                if (FriendlyRoles((int)player.TeamRole.Role).Contains(ragdoll.owner.charclass))
                {
                    foreach (Player target in PluginManager.Manager.Server.GetPlayers())
                    {
                        if (target.PlayerId == ragdoll.owner.PlayerId && target.TeamRole.Role == Role.SPECTATOR)
                        {
                            Delete();

                            switch (ragdoll.owner.charclass)
                            {
                            case 1:
                                DefibPlugin.TargetRole = Role.CLASSD;
                                break;

                            case 4:
                                DefibPlugin.TargetRole = Role.NTF_SCIENTIST;
                                break;

                            case 6:
                                DefibPlugin.TargetRole = Role.SCIENTIST;
                                break;

                            case 8:
                                DefibPlugin.TargetRole = Role.CHAOS_INSURGENCY;
                                break;

                            case 11:
                                DefibPlugin.TargetRole = Role.NTF_LIEUTENANT;
                                break;

                            case 12:
                                DefibPlugin.TargetRole = Role.NTF_COMMANDER;
                                break;

                            case 13:
                                DefibPlugin.TargetRole = Role.NTF_CADET;
                                break;

                            case 15:
                                DefibPlugin.TargetRole = Role.FACILITY_GUARD;
                                break;
                            }

                            if (DefibPlugin.Delay > 0)
                            {
                                Timing.RunCoroutine(_Delay(() => target.ChangeRole(DefibPlugin.TargetRole, false, false, false, false), DefibPlugin.Delay));
                            }
                            else
                            {
                                target.ChangeRole(DefibPlugin.TargetRole, false, false, false, false);
                            }

                            Timing.RunCoroutine(_Delay(() => target.SetHealth(Mathf.RoundToInt(target.GetHealth() * DefibPlugin.ReviveHealth)), 2f));
                            limit++;
                            NetworkServer.Destroy(ragdoll.gameObject);
                        }
                    }
                }
            }
            return(base.OnDrop());
        }