Exemple #1
0
        private void OnTick()
        {
            if (!OnGoing && DateTime.UtcNow > NextStart && Region != null && Region.GetPlayerCount() > 0)
            {
                NextStart = DateTime.MaxValue;
                OnGoing   = true;
                VoidType  = (VoidType)Utility.Random(5);
                PoolHits  = PoolStartHits;
                Wave      = 0;

                if (CurrentScore != null)
                {
                    CurrentScore.Clear();
                }

                if (Waves != null)
                {
                    Waves.Clear();
                    Waves.TrimExcess();
                }

                CurrentScore = new Dictionary <Mobile, long>();
                Waves        = new List <WaveInfo>();

                Region.SendRegionMessage(1152527, 0x2B);                 // The battle for the Void Pool is beginning now!

                if (WaypointACount != WaypointsA.Count || WaypointBCount != WaypointsB.Count)
                {
                    Generate.AddWaypoints();
                }

                SpawnWave();
            }
            else if (OnGoing)
            {
                if (DateTime.UtcNow > NextWave)
                {
                    SpawnWave();
                }

                IPooledEnumerable eable = this.Map.GetMobilesInBounds(PoolWalls);
                foreach (Mobile m in eable)
                {
                    if (!OnGoing)
                    {
                        break;
                    }

                    if (m is BaseCreature && !((BaseCreature)m).Controlled && !((BaseCreature)m).Summoned && Utility.RandomDouble() > 0.25)
                    {
                        OnVoidWallDamaged(m);
                    }
                }
                eable.Free();
            }
        }
Exemple #2
0
    void start()
    {
        player.freeze(false);
        Debug.Log("secondChanceScore " + secondChanceScore);
        currentScore.Clear(secondChanceScore);
        secondChanceScore = -1;
        CancelInvoke();
        InvokeRepeating("addScore", 0f, scoreDelta);

        spikeGenerator.onStart();
        myCamera.isMoving = true;
        player.firstJump();
    }