Пример #1
0
        protected virtual void Fight()
        {
            if (this.SpawnWorld != null)
            {
                var oldWorld = this.SpawnWorld;
                this.SpawnWorld = null;
                // move to real world
                foreach (ArenaClient c in players)
                {
                    if (c.IsCharacter)
                    {
                        InitialSpawnClient(c, false);
                    }
                    else
                    {
                        JoinAsSpectator(c);
                    }
                }

                oldWorld.Delete();
            }

            SetPhase(GamePhase.Fight);

            phaseTimer.SetInterval(Scenario.FightDuration);
            phaseTimer.SetCallback(FadeOut);
            phaseTimer.Restart();
        }
Пример #2
0
 public void StartInactivityTimer()
 {
     if (chatInactivityTimer.Started)
     {
         chatInactivityTimer.Restart();
     }
     else
     {
         chatInactivityTimer.Start();
     }
 }
Пример #3
0
        static void EndHorde(bool victory)
        {
            if (victory)
            {
                SetPhase(HordePhase.Victory);
                players.ForEach(p => p.Character.LiftUnconsciousness());
            }
            else
            {
                SetPhase(HordePhase.Lost);
                players.ForEach(p => p.Character.SetHealth(0));
            }

            gameTimer.SetCallback(StartHorde);
            gameTimer.SetInterval(30 * TimeSpan.TicksPerSecond);
            gameTimer.Restart();
        }