Ejemplo n.º 1
0
 public override void PlayerLeftServer(Player p)
 {
     Alive.Remove(p);
     Infected.Remove(p);
     AssignFirstZombie();
     UpdateAllPlayerStatus();
 }
Ejemplo 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);
            }
        }
Ejemplo 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);
        }
Ejemplo n.º 4
0
 public void DisinfectPlayer(Player p)
 {
     if (!RoundInProgress || p == null)
     {
         return;
     }
     Infected.Remove(p);
     Alive.Add(p);
     ResetPlayerState(p, false);
 }
Ejemplo n.º 5
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();
            }
        }
Ejemplo n.º 6
0
        public void DisinfectPlayer(Player p)
        {
            if (!RoundInProgress || p == null)
            {
                return;
            }
            Infected.Remove(p);
            Alive.Add(p);

            p.Game.Infected = false;
            UpdatePlayerColor(p, p.color);
            UpdateAllPlayerStatus();
            PlayerMoneyChanged(p);
        }