Exemplo n.º 1
0
 public override void PlayerLeftServer(Player p)
 {
     Alive.Remove(p);
     Infected.Remove(p);
     AssignFirstZombie();
     UpdateAllPlayerStatus();
 }
Exemplo n.º 2
0
        public override void PlayerJoinedLevel(Player p, Level lvl, Level oldLvl)
        {
            p.SendCpeMessage(CpeMessageType.BottomRight3, "");
            p.SendCpeMessage(CpeMessageType.BottomRight2, "");
            p.SendCpeMessage(CpeMessageType.BottomRight1, "");
            if (RoundInProgress && lvl.name.CaselessEq(MapName))
            {
                if (Running && p != null)
                {
                    Player.Message(p, "You joined in the middle of a round. &cYou are now infected!");
                    p.Game.BlocksLeft = 25;
                    InfectPlayer(p, null);
                }
            }
            if (RoundInProgress && oldLvl == Map && lvl != Map)
            {
                PlayerLeftGame(p);
            }

            if (lvl.name.CaselessEq(MapName))
            {
                double startLeft = (RoundStart - DateTime.UtcNow).TotalSeconds;
                if (startLeft >= 0)
                {
                    Player.Message(p, "%a" + (int)startLeft + " %Sseconds left until the round starts. %aRun!");
                }
                Player.Message(p, "This map has &a" + Map.Config.Likes +
                               " likes %Sand &c" + Map.Config.Dislikes + " dislikes");
                Player.Message(p, "This map's win chance is &a" + Map.WinChance + "%S%");

                if (Map.Config.Authors.Length > 0)
                {
                    string[] authors = Map.Config.Authors.Replace(" ", "").Split(',');
                    Player.Message(p, "It was created by {0}",
                                   authors.Join(n => PlayerInfo.GetColoredName(p, n)));
                }

                HUD.UpdatePrimary(this, p);
                HUD.UpdateSecondary(this, p);
                HUD.UpdateTertiary(p);

                if (Server.votingforlevel)
                {
                    Picker.SendVoteMessage(p);
                }
                return;
            }

            p.SetPrefix();
            HUD.Reset(p);
            Alive.Remove(p);
            Infected.Remove(p);
            if (oldLvl != null && oldLvl.name.CaselessEq(MapName))
            {
                HUD.UpdateAllPrimary(this);
            }
        }
Exemplo n.º 3
0
        public override void PlayerLeftGame(Player p)
        {
            Alive.Remove(p);
            Infected.Remove(p);
            p.Game.Infected = false;
            RemoveBounties(p);

            AssignFirstZombie();
            HUD.UpdateAllPrimary(this);
        }
Exemplo n.º 4
0
        public override void PlayerJoinedLevel(Player p, Level lvl, Level oldLvl)
        {
            p.SendCpeMessage(CpeMessageType.BottomRight2, "");
            p.SendCpeMessage(CpeMessageType.BottomRight1, "");
            if (RoundInProgress && lvl.name.CaselessEq(CurLevelName))
            {
                if (Running && p != null)
                {
                    p.SendMessage("You joined in the middle of a round. &cYou are now infected!");
                    p.Game.BlocksLeft = 50;
                    InfectPlayer(p);
                }
            }

            if (lvl.name.CaselessEq(CurLevelName))
            {
                double startLeft = (RoundStart - DateTime.UtcNow).TotalSeconds;
                if (startLeft >= 0)
                {
                    p.SendMessage("%a" + (int)startLeft + " %Sseconds left until the round starts. %aRun!");
                }
                p.SendMessage("This map has &a" + CurLevel.Likes +
                              " likes %Sand &c" + CurLevel.Dislikes + " dislikes");
                p.SendMessage("This map's win chance is &a" + CurLevel.WinChance + "%S%");
                p.SendCpeMessage(CpeMessageType.Status2,
                                 "%SPillaring " + (CurLevel.Pillaring ? "&aYes" : "&cNo") +
                                 "%S, Type is &a" + CurLevel.BuildType);

                if (CurLevel.Authors != "")
                {
                    p.SendMessage("It was created by " + CurLevel.Authors);
                }
                PlayerMoneyChanged(p);
                UpdatePlayerStatus(p);

                if (Server.votingforlevel)
                {
                    SendVoteMessage(p, lastLevel1, lastLevel2);
                }
                return;
            }

            p.SetPrefix();
            ResetCpeMessages(p);
            Alive.Remove(p);
            Infected.Remove(p);
            if (oldLvl != null && oldLvl.name.CaselessEq(CurLevelName))
            {
                UpdateAllPlayerStatus();
            }
        }
Exemplo n.º 5
0
        public void InfectPlayer(Player p)
        {
            if (!RoundInProgress || p == null)
            {
                return;
            }
            Infected.Add(p);
            Alive.Remove(p);

            p.Game.Infected = true;
            UpdatePlayerColor(p, Colors.red);
            UpdateAllPlayerStatus();
            PlayerMoneyChanged(p);
        }
Exemplo n.º 6
0
        //Kills an Entity, moving it to the Dead list and removing from it's Alignment list
        public void KillEntity(int in_ID)
        {
            int index = ID.IndexOf(in_ID);

            switch (Behaviour[index][1])
            {
            case "Friendly": Friendlies.RemoveAt(Friendlies.IndexOf(in_ID)); break;

            case "Hostile": Hostiles.RemoveAt(Hostiles.IndexOf(in_ID)); break;

            case "Neutral": Neutrals.RemoveAt(Neutrals.IndexOf(in_ID)); break;
            }

            Alive.Remove(in_ID);
            Dead.Add(in_ID);
        }
Exemplo n.º 7
0
        public void InfectPlayer(Player p, Player killer)
        {
            if (!RoundInProgress || p == null)
            {
                return;
            }
            Infected.Add(p);
            Alive.Remove(p);

            p.Game.CurrentRoundsSurvived = 0;
            p.Game.TimeInfected          = DateTime.UtcNow;
            p.SetPrefix();
            ResetPlayerState(p, true);

            CheckHumanPledge(p, killer);
            CheckBounty(p, killer);
        }
Exemplo n.º 8
0
        public void InfectPlayer(Player p)
        {
            if (!RoundInProgress || p == null)
            {
                return;
            }
            Infected.Add(p);
            Alive.Remove(p);
            p.Game.CurrentRoundsSurvived = 0;
            p.SetPrefix();

            if (p.Game.Invisible)
            {
                p.SendCpeMessage(CpeMessageType.BottomRight2, "", false);
                Player.GlobalSpawn(p, false);
                p.Game.ResetInvisibility();
            }

            p.Game.Infected = true;
            UpdatePlayerColor(p, Colors.red);
            UpdateAllPlayerStatus();
            PlayerMoneyChanged(p);
        }