Ejemplo n.º 1
0
 static void UpdatePlayerColor(Player p, string color)
 {
     if (p.Game.lastSpawnColor == color)
     {
         return;
     }
     p.Game.lastSpawnColor = color;
     Entities.GlobalRespawn(p, false);
     TabList.Add(p, p, Entities.SelfID);
 }
Ejemplo n.º 2
0
        public override void Use(Player p, string message)
        {
            p.Game.Aka = !p.Game.Aka;
            Player[] players = PlayerInfo.Online.Items;
            Player.Message(p, "AKA mode is now: " + (p.Game.Aka ? "&aOn" : "&cOff"));

            foreach (Player pl in players)
            {
                if (pl.level != p.level || p == pl || !Entities.CanSeeEntity(p, pl))
                {
                    continue;
                }
                p.DespawnEntity(pl.id);
                p.SpawnEntity(pl, pl.id, pl.pos[0], pl.pos[1], pl.pos[2], pl.rot[0], pl.rot[1], "");
            }
            TabList.Add(p, p, Entities.SelfID);
        }
Ejemplo n.º 3
0
        public override void Use(Player p, string message)
        {
            p.Game.Aka = !p.Game.Aka;
            Player[] players = PlayerInfo.Online.Items;
            Player.Message(p, "AKA mode is now: " + (p.Game.Aka ? "&aOn" : "&cOff"));

            foreach (Player other in players)
            {
                if (other.level != p.level || p == other || !p.CanSeeEntity(other))
                {
                    continue;
                }

                Entities.Despawn(p, other);
                Entities.Spawn(p, other);
            }
            TabList.Add(p, p, Entities.SelfID);
        }
Ejemplo n.º 4
0
        public override void Use(Player p, string message, CommandData data)
        {
            ZSData data_ = ZSGame.Get(p);

            data_.AkaMode = !data_.AkaMode;
            Player[] players = PlayerInfo.Online.Items;
            p.Message("AKA mode is now: " + (data_.AkaMode ? "&aOn" : "&cOff"));

            foreach (Player other in players)
            {
                if (other.level != p.level || p == other || !p.CanSeeEntity(other))
                {
                    continue;
                }

                Entities.Despawn(p, other);
                Entities.Spawn(p, other);
            }
            TabList.Add(p, p, Entities.SelfID);
        }
Ejemplo n.º 5
0
        public override void Use(Player p, string message)
        {
            if (Player.IsSuper(p))
            {
                MessageInGameOnly(p); return;
            }

            if (p.Game.Referee)
            {
                Player.SendChatFrom(p, p.ColoredName + " %Sis no longer a referee", false);
                p.Game.Referee = !p.Game.Referee;
                if (p.level == Server.zombie.CurLevel)
                {
                    Server.zombie.PlayerJoinedLevel(p, Server.zombie.CurLevel, Server.zombie.CurLevel);
                }

                if (p.HasCpeExt(CpeExt.HackControl))
                {
                    p.Send(Hacks.MakeHackControl(p));
                }
                Command.all.Find("spawn").Use(p, "");
            }
            else
            {
                Player.SendChatFrom(p, p.ColoredName + " %Sis now a referee", false);
                Server.zombie.PlayerLeftServer(p);
                Entities.GlobalDespawn(p, false, true);
                p.Game.Referee = !p.Game.Referee;

                if (p.HasCpeExt(CpeExt.HackControl))
                {
                    p.Send(Packet.HackControl(true, true, true, true, true, -1));
                }
            }

            Entities.GlobalSpawn(p, false, "");
            TabList.Add(p, p, Entities.SelfID);
            p.SetPrefix();
        }
Ejemplo n.º 6
0
        static void GiveMoney(ZombieGame game, Player[] alive)
        {
            Player[] online = PlayerInfo.Online.Items;
            Random   rand   = new Random();

            foreach (Player pl in online)
            {
                if (!pl.level.name.CaselessEq(game.CurLevelName))
                {
                    continue;
                }
                pl.Game.ResetInvisibility();
                int reward = GetMoneyReward(pl, alive, rand);

                if (reward == -1)
                {
                    pl.SendMessage("You may not hide inside a block! No " + Server.moneys + " for you."); reward = 0;
                }
                else if (reward > 0)
                {
                    pl.SendMessage(Colors.gold + "You gained " + reward + " " + Server.moneys);
                }

                pl.SetMoney(pl.money + reward);
                pl.Game.ResetZombieState();
                if (pl.Game.Referee)
                {
                    pl.SendMessage("You gained one " + Server.moneys + " because you're a ref. Would you like a medal as well?");
                    pl.SetMoney(pl.money + 1);
                }

                Entities.GlobalDespawn(pl, false);
                Entities.GlobalSpawn(pl, false);
                TabList.Add(pl, pl, Entities.SelfID);
                HUD.UpdateTertiary(pl);
            }
        }
Ejemplo n.º 7
0
    public void AddTab(string _title, QuestDetailModel.TabType _type)
    {
        int _index = TabList.Count;

        var model = new QuestDetailTabModel((uint)_index);

        model.OnShowedNext += () =>
        {
            if (_index + 1 >= m_tabs.Count)
            {
                return;
            }

            m_tabs[_index + 1].Appear();
        };

        QuestDetailTabContext newTab = new QuestDetailTabContext(model);

        newTab.TitleOn       = string.Format(GameTextUtil.GetText("stmina_bahutext"), _title);
        newTab.TitleOff      = _title;
        newTab.m_Type        = _type;
        newTab.m_Index       = _index;
        newTab.DidSelectTab += OnSelectTab;
        if (_index == tabIndex)
        {
            newTab.IsSelected = true;
        }
        else
        {
            newTab.IsSelected = false;
        }
        TabList.Add(newTab);
        tabMax = TabList.Count;

        m_tabs.Add(model);
    }
Ejemplo n.º 8
0
        public override void Use(Player p, string message, CommandData data)
        {
            if (message.Length > 0 && p.possess.Length > 0)
            {
                p.Message("Stop your current possession first."); return;
            }
            bool silent = false;

            if (message.CaselessEq("silent"))
            {
                if (!CheckExtraPerm(p, data, 1))
                {
                    return;
                }
                silent = true;
            }

            Command adminchat = Command.Find("AdminChat");
            Command opchat    = Command.Find("OpChat");

            Entities.GlobalDespawn(p, false);

            p.hidden = !p.hidden;
            if (p.hidden)
            {
                p.hideRank = data.Rank;
                AnnounceOps(p, "To Ops -λNICK%S- is now &finvisible");

                if (!silent)
                {
                    string leaveM = "&c- λFULL %S" + PlayerDB.GetLogoutMessage(p);
                    Chat.MessageFrom(p, leaveM, null, true);
                }

                if (!p.opchat)
                {
                    opchat.Use(p, "", data);
                }
                Server.hidden.AddUnique(p.name);
            }
            else
            {
                AnnounceOps(p, "To Ops -λNICK%S- is now &fvisible");
                p.hideRank = LevelPermission.Banned;

                if (!silent)
                {
                    string joinM = "&a+ λFULL %S" + PlayerDB.GetLoginMessage(p);
                    Chat.MessageFrom(p, joinM, null, true);
                }

                if (p.opchat)
                {
                    opchat.Use(p, "", data);
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, "", data);
                }
                Server.hidden.Remove(p.name);
            }

            Entities.GlobalSpawn(p, false);
            TabList.Add(p, p, Entities.SelfID);
            Server.hidden.Save(false);
        }
Ejemplo n.º 9
0
 internal static void RespawnPlayer(Player p)
 {
     Entities.GlobalRespawn(p, false);
     TabList.Add(p, p, Entities.SelfID);
 }
Ejemplo n.º 10
0
 public void AddTab()
 {
     TabList.Add(new TabViewModel(TabList.Count));
     SelectedTab = TabList[TabList.Count - 1];
     OnPropertyChanged(nameof(SelectedTab));
 }
Ejemplo n.º 11
0
        public override void Use(Player p, string message)
        {
            if (message.Length > 0 && p.possess.Length > 0)
            {
                Player.Message(p, "Stop your current possession first."); return;
            }
            bool announceToOps = true;

            if (message.CaselessEq("silent"))
            {
                if (!CheckExtraPerm(p, 1))
                {
                    return;
                }
                announceToOps = false;
            }

            Command adminchat = Command.all.FindByName("AdminChat");
            Command opchat    = Command.all.FindByName("OpChat");

            Entities.GlobalDespawn(p, false);

            p.hidden = !p.hidden;
            //Possible to use /hide myrank, but it accomplishes the same as regular /hide if you use it on yourself.
            if (message.CaselessEq("myrank"))
            {
                p.otherRankHidden = !p.otherRankHidden;
                p.hidden          = p.otherRankHidden;
            }

            if (p.hidden)
            {
                if (announceToOps && !p.otherRankHidden)
                {
                    Chat.MessageOps("To Ops -" + p.ColoredName + "%S- is now &finvisible%S.");
                }

                string discMsg = PlayerDB.GetLogoutMessage(p);
                Chat.MessageGlobal(p, "&c- " + p.FullName + " %S" + discMsg, false);
                Server.IRC.Say(p.DisplayName + " %Sleft the game (disconnected%S)");
                if (announceToOps && !p.opchat)
                {
                    opchat.Use(p, "");
                }
                Server.hidden.AddIfNotExists(p.name);
            }
            else
            {
                p.otherRankHidden = false;
                p.oHideRank       = LevelPermission.Null;
                if (announceToOps)
                {
                    Chat.MessageOps("To Ops -" + p.ColoredName + "%S- is now &fvisible%S.");
                }

                Chat.MessageGlobal(p, "&a+ " + p.FullName + " %S" + PlayerDB.GetLoginMessage(p), false);
                Server.IRC.Say(p.DisplayName + " %Sjoined the game");
                if (p.opchat)
                {
                    opchat.Use(p, "");
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, "");
                }
                Server.hidden.Remove(p.name);
            }

            Entities.GlobalSpawn(p, false);
            TabList.Add(p, p, Entities.SelfID);
            Server.hidden.Save(false);
        }
Ejemplo n.º 12
0
        public override void Use(Player p, string message)
        {
            if (Player.IsSuper(p))
            {
                MessageInGameOnly(p); return;
            }
            if (message == "check")
            {
                string state = p.hidden ? "" : "not ";
                Player.Message(p, "You are " + state + "currently hidden!"); return;
            }
            if (message != "" && p.possess != "")
            {
                Player.Message(p, "Stop your current possession first."); return;
            }
            bool messageOps = true;

            if (message.CaselessEq("silent"))
            {
                if (!CheckExtraPerm(p))
                {
                    MessageNeedExtra(p, "hide silently"); return;
                }
                messageOps = false;
            }

            Command opchat    = Command.all.Find("opchat");
            Command adminchat = Command.all.Find("adminchat");

            p.hidden = !p.hidden;

            //Possible to use /hide myrank, but it accomplishes the same as regular /hide if you use it on yourself.
            if (message.CaselessEq("myrank"))
            {
                p.otherRankHidden = !p.otherRankHidden;
                p.hidden          = p.otherRankHidden;
            }

            if (p.hidden)
            {
                Entities.GlobalDespawn(p, false);
                if (messageOps && !p.otherRankHidden)
                {
                    Chat.MessageOps("To Ops -" + p.ColoredName + "%S- is now &finvisible%S.");
                }

                string discMsg = PlayerDB.GetLogoutMessage(p);
                Player.SendChatFrom(p, "&c- " + p.FullName + " %S" + discMsg, false);
                Server.IRC.Say(p.DisplayName + " %Sleft the game (" + discMsg + "%S)");
                if (messageOps && !p.opchat)
                {
                    opchat.Use(p, message);
                }
                Server.hidden.AddIfNotExists(p.name);
            }
            else
            {
                Entities.GlobalSpawn(p, false);
                p.otherRankHidden = false;
                p.oHideRank       = LevelPermission.Null;
                if (messageOps)
                {
                    Chat.MessageAdmins("To Admins -" + p.ColoredName + "%S- is now &fvisible%S.");
                }

                Player.SendChatFrom(p, "&a+ " + p.FullName + " %S" + PlayerDB.GetLoginMessage(p), false);
                Server.IRC.Say(p.DisplayName + " %Sjoined the game");
                if (messageOps && p.opchat)
                {
                    opchat.Use(p, message);
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, message);
                }
                Server.hidden.Remove(p.name);
            }

            TabList.Add(p, p, Entities.SelfID);
            Server.hidden.Save(false);
        }