/// <summary>
        /// スポナー読み込み
        /// </summary>
        /// <param name="count"></param>
        public static void Load(ref int count)
        {
            try
            {
                Spawners.ClearOnScheduler();
                foreach (Coordinate coor in _spawnerCoordinates)
                {
                    // 実際の座標と画像のピクセル数から画像上のスポナー位置を計算
                    // 画像のサイズが変わると壊れます()
                    var X = (coor.X + 1502.5) / 1664;
                    var Z = (coor.Z + 114.5) / 247;

                    var isBroken = new Spawner(coor, World.WorldData).IsBroken;

                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        Spawners.Add(new SpawnerPointer()
                        {
                            Center   = new Point(X, Z),
                            IsBroken = isBroken
                        });

                        BrokenCount.Value = Spawners.Where(x => x.IsBroken).Count();
                        BrokenRate.Value  = (BrokenCount.Value / 247.0) * 100;
                    });

                    World.LoadingProgress.Value = (++count / 297.0) * 100;
                }
            }
            catch
            {
                Reset();
                throw;
            }
        }
Exemplo n.º 2
0
 public override void Create(List <IGameObject> avoidObjects, bool avoidSelf = true)
 {
     for (int i = 0; i < SpawnersAmount; i++)
     {
         Spawner spawner = new Spawner(gridSize, minBorderMargin, minMarginBetween, avoidObjects);
         Spawners.Add(spawner);
         if (avoidSelf)
         {
             avoidObjects.Add(spawner);
         }
     }
 }
Exemplo n.º 3
0
 public void AddSpawner(Spawner spawner)
 {
     Spawners.Add(spawner);
 }
Exemplo n.º 4
0
 public static void AddSpawner(GEntity Spawner)
 {
     Spawners.Add(Spawner);
 }
Exemplo n.º 5
0
        private void FirstWave()
        {
            //First greeting enemy (plan is to display a greeting message using black_old_face.png within the UI)
            Spawners.Add
            (
                new EnemySpawner
                (
                    x: (float)Field.Size.Width / 2
                    , y: 20
                    , remainingEnemies: 1
                    , spawnCallback: spawner => spawner.PlaceActor(new Lakebeam())
                )
            );

            //First Bomb to give Player some small target to fire on
            AddDualSpawner
            (
                percentDelay: 2
                , enemies: 1
                , spawnCallback: spawner =>
            {
                var enemy = new Doomday(Field.Player);
                spawner.PlaceActor(enemy);
            }
            );

            //Wave of Lakebeams for the opportunity of quickly upgrading the basic weapon
            AddDualSpawner
            (
                percentDelay: 6
                , enemies: 4
                , spawnCallback: spawner =>
            {
                var enemy = new Lakebeam();
                spawner.PlaceActor(enemy);
            }
            );

            //Wave of bombs
            AddDualSpawner
            (
                percentDelay: 16
                , enemies: 5
                , spawnCallback: spawner =>
            {
                var enemy = new Doomday(Field.Player);
                spawner.PlaceActor(enemy);
            }
            );

            //Two Venomflares to make it more interesting
            Spawners.Add
            (
                new DelayedStart
                (
                    actsDelay: 0
                    , percentDelay: 26
                    , spawner: new EnemySpawner
                    (
                        //Spawns in the 1/3 of the Field
                        x: (float)Field.Size.Width / 3
                        , y: 0
                        , remainingEnemies: 1
                        , spawnCallback: spawner => spawner.PlaceActor(new Venomflare())
                    )
                )
            );
            Spawners.Add
            (
                new DelayedStart
                (
                    actsDelay: 0
                    , percentDelay: 26
                    , spawner: new EnemySpawner
                    (
                        //Spawns in the 2/3 of the Field
                        x: 2 * (float)Field.Size.Width / 3
                        , y: 0
                        , remainingEnemies: 1
                        , spawnCallback: spawner => spawner.PlaceActor(new Venomflare())
                    )
                )
            );

            //Waveghosts that will rotate around
            AddDualSpawner
            (
                percentDelay: 36
                , y: (float)Field.Size.Height / 2
                , enemies: 2
                , spawnCallback: spawner => spawner.PlaceActor(new Waveghost())
            );

            //Larger wave of Lakebeams
            AddDualSpawner
            (
                percentDelay: 50
                , enemies: 8
                , spawnCallback: spawner =>
            {
                var enemy = new Lakebeam();
                spawner.PlaceActor(enemy);
            }
            );

            //Last small wave of bombs
            AddDualSpawner
            (
                percentDelay: 60
                , enemies: 4
                , spawnCallback: spawner =>
            {
                var enemy = new Doomday(Field.Player);
                spawner.PlaceActor(enemy);
            }
            );

            //Final battle before boss appears
            AddDualSpawner
            (
                percentDelay: 75
                , y: (float)Field.Size.Height / 2
                , enemies: 4
                , spawnCallback: spawner => spawner.PlaceActor(new Waveghost())
            );

            //The Boss
            Spawners.Add
            (
                new DelayedStart
                (
                    actsDelay: 0
                    , percentDelay: 95
                    , spawner: new EnemySpawner
                    (
                        x: (float)Field.Size.Width / 2
                        , y: 0
                        , remainingEnemies: 1
                        , spawnCallback: spawner =>
            {
                var boss = new DarkspringTheTwisted();
                spawner.PlaceActor(boss);
                //Boss will be spawned outside of the field and comes in afterwards
                boss.Y -= (float)boss.Height / 2;
            }
                    )
                )
            );
        }
Exemplo n.º 6
0
 private void InitializeSpawners()
 {
     Spawners.Add(Cardboard.Spawner);
 }