示例#1
0
        void HandlePlayerSpawning(Player p, ref Position pos, ref byte yaw, ref byte pitch, bool respawning)
        {
            if (p.level != Map)
            {
                return;
            }

            TWData data = Get(p);

            if (respawning)
            {
                data.Health                  = 2;
                data.KillStreak              = 0;
                data.ScoreMultiplier         = 1f;
                data.LastKillStreakAnnounced = 0;
            }

            TWTeam team = TeamOf(p);

            if (team == null || Config.Mode != TWGameMode.TDM)
            {
                return;
            }

            Vec3U16 coords = team.SpawnPos;

            pos = Position.FromFeetBlockCoords(coords.X, coords.Y, coords.Z);
        }
示例#2
0
        void HandlePlayerChat(Player p, string message)
        {
            if (Picker.HandlesMessage(p, message))
            {
                p.cancelchat = true; return;
            }
            if (p.level != Map || message.Length == 0 || message[0] != ':')
            {
                return;
            }

            TWTeam team = TeamOf(p);

            if (team == null || Config.Mode != TWGameMode.TDM)
            {
                return;
            }
            message = message.Substring(1);

            // "To Team &c-" + ColoredName + "&c- &S" + message);
            string prefix = team.Color + " - to " + team.Name;

            Chat.MessageChat(ChatScope.Level, p, prefix + " - λNICK: &f" + message,
                             Map, (pl, arg) => pl.Game.Referee || TeamOf(pl) == team);
            p.cancelchat = true;
        }
示例#3
0
        void JoinTeam(Player p, TWTeam team)
        {
            team.Members.Add(p);
            Map.Message(p.ColoredName + " &Sjoined the " + team.ColoredName + " &Steam");

            p.UpdateColor(team.Color);
            p.Message("You are now on the " + team.ColoredName + " team!");
            TabList.Update(p, true);
        }
示例#4
0
        void JoinTeam(Player p, TWTeam team)
        {
            team.Members.Add(p);
            Map.Message(p.ColoredName + " %Sjoined the " + team.ColoredName + " %Steam");

            p.color = team.Color;
            p.SetPrefix();

            p.Message("You are now on the " + team.ColoredName + " team!");
            TabList.Update(p, true);
        }
示例#5
0
        public override void PlayerLeftGame(Player p)
        {
            allPlayers.Remove(p);
            TWTeam team = TeamOf(p);

            if (team == null)
            {
                return;
            }
            team.Members.Remove(p);
            RestoreColor(p);
        }
示例#6
0
        void HandleSettingColor(Player p, ref string color)
        {
            if (p.level != Map)
            {
                return;
            }
            TWTeam team = TeamOf(p);

            if (team != null)
            {
                color = team.Color;
            }
        }
示例#7
0
        public void ChangeScore(Player p, int amount)
        {
            Get(p).Score += amount;
            UpdateStatus2(p);

            if (Config.Mode != TWGameMode.TDM)
            {
                return;
            }
            TWTeam team = TeamOf(p);

            if (team == null)
            {
                return;
            }

            team.Score += amount;
            UpdateAllStatus1();
        }
示例#8
0
        void HandleTabListEntryAdded(Entity entity, ref string tabName, ref string tabGroup, Player dst)
        {
            Player p = entity as Player;

            if (p == null || p.level != Map)
            {
                return;
            }
            TWTeam team = TeamOf(p);

            if (p.Game.Referee)
            {
                tabGroup = "&2Referees";
            }
            else if (team != null)
            {
                tabGroup = team.ColoredName + " team";
            }
            else
            {
                tabGroup = "&7Spectators";
            }
        }