Beispiel #1
0
        static void SetPhase(HordePhase phase)
        {
            string screenMsg;

            switch (phase)
            {
            case HordePhase.WarmUp:
                screenMsg = "warmup";
                break;

            case HordePhase.Fight:
                screenMsg = "Fight!";
                break;

            case HordePhase.Stand:
                screenMsg = "Stand";
                break;

            case HordePhase.Victory:
                screenMsg = "Sieg!";
                HordeBoardScreen.Instance.Open();
                break;

            case HordePhase.Lost:
                screenMsg = "Niederlage!";
                HordeBoardScreen.Instance.Open();
                break;

            default: return;
            }

            Phase = phase;
            ScreenScrollText.AddText(screenMsg, GUI.GUCView.Fonts.Menu);
            OnPhaseChange?.Invoke(phase);
        }
Beispiel #2
0
        void DoUnconstuff(NPCInst hero)
        {
            if (hero?.Environment == null || hero?.BaseInst?.gAI == null)
            {
                return;
            }

            var env = hero.Environment;

            if (env.WaterLevel < 0.2f)
            {
                if (env.InAir)
                {
                    return;
                }
                var gAi = hero.BaseInst.gAI;
                if (!gAi.CheckEnoughSpaceMoveForward(false))
                {
                    return;
                }
                if (!gAi.CheckEnoughSpaceMoveBackward(false))
                {
                    return;
                }
                if (!gAi.CheckEnoughSpaceMoveLeft(false))
                {
                    return;
                }
                if (!gAi.CheckEnoughSpaceMoveRight(false))
                {
                    return;
                }

                _LastValidPos = hero.GetPosition();
            }
            else
            {
                if (!hero.IsUnconscious && env.WaterLevel > 0.3f && _SwimTimer.IsReady)
                {
                    ScreenScrollText.AddText("Du kannst ja gar nicht schwimmen!?!");
                }

                if (!hero.IsUnconscious)
                {
                    _DoneUncon = false;
                }

                if (!_DoneUncon && hero.IsUnconscious)
                {
                    hero.BaseInst.SetPhysics(false);
                    var rb = WinApi.Process.ReadInt(hero.BaseInst.gVob.Address + 224);
                    using (var vec = Vec3f.Null.CreateGVec())
                        WinApi.Process.THISCALL <WinApi.NullReturnCall>(rb, 0x5B66D0, vec);
                    Vec3f.Null.SetGVec(hero.BaseInst.gAI.Velocity);
                    hero.SetPosition(_LastValidPos);
                    _DoneUncon = true;
                }
            }
        }
Beispiel #3
0
 static void TOMessage(string text)
 {
     //ChatMenu.Menu.AddMessage(ChatMode.Private, text);
     if (GUCMenu.GetActiveMenus().FirstOrDefault(m => m is Sumpfkraut.Menus.MainMenus.GUCMainMenu) == null)
     {
         ScreenScrollText.AddText(text, GUI.GUCView.Fonts.Menu);
     }
     Log.Logger.Log(text);
 }
Beispiel #4
0
        public static void ReadWinMessage(PacketReader stream)
        {
            var teams = ActiveMode.Scenario.Teams;

            int        winnerCount = stream.ReadByte();
            List <int> winners     = new List <int>(winnerCount);

            for (int i = 0; i < winnerCount; i++)
            {
                winners.Add(stream.ReadByte());
            }

            if (winnerCount == teams.Length)
            {
                DoVictoryStuff(true, "UNENTSCHIEDEN!");
                return;
            }
            else
            {
                if (PlayerInfo.HeroInfo.TeamID >= TeamIdent.GMPlayer)
                {
                    DoVictoryStuff(winners.Contains((int)PlayerInfo.HeroInfo.TeamID));
                }

                if (winners.Count > 1)
                {
                    foreach (int i in winners)
                    {
                        if (i < teams.Length)
                        {
                            ScreenScrollText.AddText(teams[i].Name + " hat gewonnen.", GUI.GUCView.Fonts.Menu, teams[i].Color, 20 * TimeSpan.TicksPerSecond);
                        }
                    }
                }
            }
        }