Exemple #1
0
        void Spectate()
        {
            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.SpectateTeam);
            ArenaClient.SendScriptMessage(stream, NetPriority.Low, NetReliability.Reliable);
            Close();
        }
Exemple #2
0
        static void SendRequest(ArenaClient requester, ArenaClient target)
        {
            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.DuelRequest);
            stream.Write((ushort)requester.Character.ID);
            stream.Write((ushort)target.Character.ID);
            requester.SendScriptMessage(stream, NetPriority.Low, NetReliability.Reliable);
            target.SendScriptMessage(stream, NetPriority.Low, NetReliability.Reliable);
        }
Exemple #3
0
        public override void Close()
        {
            base.Close();
            arrow.Hide();

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.TOTeamCount);
            ArenaClient.SendScriptMessage(stream, NetPriority.Low, NetReliability.Reliable);

            TeamMode.OnPhaseChange -= TOPhaseChanged;
        }
Exemple #4
0
        public static void SendRequest(NPCInst target)
        {
            if (!requestTime.IsReady)
            {
                return;
            }

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.DuelRequest);
            stream.Write((ushort)target.ID);
            ArenaClient.SendScriptMessage(stream, NetPriority.Low, NetReliability.Unreliable);
        }
Exemple #5
0
        static void DuelEnd(ArenaClient client)
        {
            if (!client.IsDueling)
            {
                return;
            }

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.DuelEnd);
            client.SendScriptMessage(stream, NetPriority.Low, NetReliability.ReliableOrdered);
            client.DuelEnemy.SendScriptMessage(stream, NetPriority.Low, NetReliability.ReliableOrdered);

            client.DuelEnemy.DuelEnemy = null;
            client.DuelEnemy           = null;
        }
Exemple #6
0
        static void DuelStart(ArenaClient player1, ArenaClient player2)
        {
            player1.DuelEnemy = player2;
            player2.DuelEnemy = player1;

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.DuelStart);
            stream.Write((ushort)player2.Character.ID);
            player1.SendScriptMessage(stream, NetPriority.Low, NetReliability.ReliableOrdered);

            stream = ArenaClient.GetScriptMessageStream();
            stream.Write((byte)ScriptMessages.DuelStart);
            stream.Write((ushort)player1.Character.ID);
            player2.SendScriptMessage(stream, NetPriority.Low, NetReliability.ReliableOrdered);
        }
Exemple #7
0
        public override void Open()
        {
            if (!TeamMode.IsRunning)
            {
                return;
            }

            base.Open();

            SetTexts();

            tdmName.Text = TeamMode.ActiveTODef.Name.ToUpper();

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.TOTeamCount);
            ArenaClient.SendScriptMessage(stream, NetPriority.Low, NetReliability.Reliable);

            TeamMode.OnPhaseChange += TOPhaseChanged;
        }
Exemple #8
0
        void SelectClass(int index)
        {
            if (TeamMode.TeamDef == null || TeamMode.Phase == TOPhases.None || TeamMode.Phase == TOPhases.Finish)
            {
                Sumpfkraut.Menus.ScreenScrollText.AddText("TeamObjective ist vorüber.", GUCView.Fonts.Menu);
                Close();
                return;
            }

            var classDef = TeamMode.TeamDef.ClassDefs.ElementAtOrDefault(index);

            if (classDef == null)
            {
                return;
            }

            if (classDef == ArenaClient.Client.TOClass)
            {
                Close();
                return;
            }

            if (!lockTimer.IsReady)
            {
                return;
            }

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.TOSelectClass);
            stream.Write((byte)index);
            ArenaClient.SendScriptMessage(stream, NetPriority.Low, NetReliability.Reliable);

            ArenaClient.Client.TOClass = classDef;

            Close();
        }
Exemple #9
0
        void SelectTeam(int index)
        {
            if (!TeamMode.IsRunning || TeamMode.Phase == TOPhases.Finish || TeamMode.Phase == TOPhases.None)
            {
                if (TeamMode.TeamDef == null)
                {
                    Sumpfkraut.Menus.ScreenScrollText.AddText("TeamObjective ist vorüber.", GUCView.Fonts.Menu);
                }
                Close();
                return;
            }

            var team = TeamMode.ActiveTODef.Teams.ElementAtOrDefault(index);

            if (team == null)
            {
                return;
            }

            if (team == TeamMode.TeamDef)
            {
                TOClassMenu.Menu.Open();
                Close();
                return;
            }

            if (!lockTimer.IsReady)
            {
                return;
            }

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.TOJoinTeam);
            stream.Write((byte)index);
            ArenaClient.SendScriptMessage(stream, NetPriority.Low, NetReliability.Reliable);
        }