bool Wave5() { if (EnemyList.Count != 0) { if (counter >= 30) { for (int i = 0; i <= 5; i++) { EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 0), new Vector2(0, rand.Next(5)))); EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 0), new Vector2(0, rand.Next(5)))); EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 0), new Vector2(0, rand.Next(5)))); EnemyBulletList.Add(new Bullet.Clear(new Vector2(rand.Next(1024), 0), new Vector2(0, rand.Next(5)))); } counter = 0; } counter++; return(false); } else { for (int i = 100; i <= 550; i += 80) { EnemyList.Add(new Enemy.Smiley(this, 1300, i)); } counter = 0; return(true); } }
/// <summary> /// Representing the first wave. /// </summary> /// <returns></returns> bool Wave1() { if (EnemyList.Count != 0) { if (counter >= 15) { EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 0), new Vector2(0, 2))); EnemyBulletList.Add(new Bullet.Clear(new Vector2(rand.Next(1024), 0), new Vector2(0, 4))); EnemyBulletList.Add(new Bullet.Cross(new Vector2(rand.Next(1024), 0), new Vector2(0, 3))); if (rand.NextDouble() <= 0.05) { EnemyBulletList.Add(new Bullet.Life(new Vector2(rand.Next(1024), 0), new Vector2(0, 5))); } counter = 0; } counter++; return(false); } else { counter = 0; for (int i = 630; i <= 1200; i += 100) { EnemyList.Add(new Enemy.Seahorse(this, 300, i)); EnemyList.Add(new Enemy.Seahorse(this, 824, i)); } return(true); } }
bool Wave9() { if (EnemyList.Count != 0) { if (counter >= 50) { EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 0), new Vector2(0, rand.Next(4)))); EnemyBulletList.Add(new Bullet.Clear(new Vector2(rand.Next(1024), 0), new Vector2(0, rand.Next(4)))); counter = 0; } counter++; if (counter2 >= 200) { EnemyBulletList.Add(new Bullet.Life(new Vector2(1054, rand.Next(50, 600)), new Vector2(-3, 0))); counter2 = 0; } counter2++; return(false); } else { EnemyList.Add(new Enemy.TrackingShooterFish3(this, 325)); return(true); } }
bool Wave5() { if (EnemyList.Count == 0) { EnemyList.Add(new Enemy.Epsilon(this, 50, true)); EnemyList.Add(new Enemy.Epsilon(this, 974, false)); EnemyList.Add(new Enemy.Delta(this, 100, true)); EnemyList.Add(new Enemy.Delta(this, 550, false)); return(true); } else { if (counter >= 55) { EnemyBulletList.Add(new Bullet.Add(new Vector2(rand.Next(1024), 620), new Vector2(1, -2))); EnemyBulletList.Add(new Bullet.Add(new Vector2(rand.Next(1024), 30), new Vector2(1, 1), true)); EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 30), new Vector2(1, 3))); EnemyBulletList.Add(new Bullet.Garble(new Vector2(rand.Next(1024), 620), new Vector2(-1.5f, -3))); counter = 0; } counter++; return(false); } }
bool Wave1() { if (EnemyList.Count == 0) { EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(256, 200), 0, false)); EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(512, 200), 0, false)); EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(768, 200), 0, false)); counter = 0; return(true); } if (counter >= 40) { for (int i = 0; i <= 10; i++) { EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 10), new Vector2(0, rand.Next(3, 6)))); } EnemyBulletList.Add(new Bullet.Add(new Vector2(rand.Next(1024), 10), new Vector2(0, rand.Next(3, 6)))); EnemyBulletList.Add(new Bullet.Add(new Vector2(rand.Next(1024), 10), new Vector2(0, rand.Next(3, 6)), true)); counter = 0; } counter++; return(false); }
bool Wave2() { if (counter >= 10) { EnemyBulletList.Add(new Bullet.Add(new Vector2(rand.Next(1024), 10), new Vector2(0, rand.Next(3, 6)), true)); counter = 0; } counter++; if (EnemyList.Count == 0) { EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(612, 300), 1074, true)); EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(412, 300), 1074, true)); EnemyList.Add(new Enemy.HorizontalSaucer(this, new Vector2(300, 400), -25, true)); EnemyList.Add(new Enemy.HorizontalSaucer(this, new Vector2(512, 200), -25, true)); EnemyList.Add(new Enemy.HorizontalSaucer(this, new Vector2(624, 100), -25, true)); EnemyList.Add(new Enemy.EvilEel2(this, 100)); EnemyList.Add(new Enemy.EvilEel2(this, 1124, 200)); EnemyList.Add(new Enemy.EvilEel2(this, 1224, 300)); EnemyList.Add(new Enemy.EvilEel2(this, 1324, 400)); EnemyList.Add(new Enemy.EvilEel2(this, 1424, 500)); return(true); } else { return(false); } }
public void CopyRoomObjects(RoomObj room) { foreach (var current in room.TerrainObjList) { TerrainObjList.Add(current.Clone() as TerrainObj); } foreach (var current2 in room.GameObjList) { GameObjList.Add(current2.Clone() as GameObj); } foreach (var current3 in room.DoorList) { var doorObj = current3.Clone() as DoorObj; doorObj.Room = this; DoorList.Add(doorObj); } foreach (var current4 in room.EnemyList) { EnemyList.Add(current4.Clone() as EnemyObj); } foreach (var current5 in room.BorderList) { BorderList.Add(current5.Clone() as BorderObj); } }
bool Wave3() { if (EnemyList.Count != 0) { if (counter >= 15) { EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), 630), new Vector2(0, -2))); EnemyBulletList.Add(new Bullet.Clear(new Vector2(rand.Next(1024), 630), new Vector2(0, -2))); if (rand.NextDouble() <= 0.01) { EnemyBulletList.Add(new Bullet.Life(new Vector2(rand.Next(1024), 0), new Vector2(0, 5))); } counter = 0; } counter++; return(false); } else { EnemyList.Add(new Enemy.Kitty1(this)); return(true); } }
public override void createEnemies(Ambient ambient) { MonsterFactory oFactory = new MonsterFactory(); Monster Enemy; Enemy = oFactory.CreateMonster(monsterName, 5); Enemy.setID(0); EnemyList.Add(Enemy); }
/// <summary> /// Adds enemies to a list. /// </summary> public void EnemyStart() { for (int i = 0; i < 2; i++) { EnemyList.Add(_enemyFactory.GetSlowEnemy()); EnemyList.Add(_enemyFactory.GetMediumEnemy()); EnemyList.Add(_enemyFactory.GetFastEnemy()); } }
bool Wave13() { for (int i = 1044; i <= 2500; i += 100) { EnemyList.Add(new Enemy.TrackingShooterFish(this, i, 250)); EnemyList.Add(new Enemy.TrackingShooterFish(this, i, 450)); } return(true); }
bool Wave10() { if (EnemyList.Count == 0) { EnemyList.Add(new Enemy.Kitty3(this)); return(true); } return(false); }
bool Wave9() { for (int i = 1044; i <= 3000; i += 200) { EnemyList.Add(new Enemy.TrackingShooterFish(this, i, 80)); EnemyList.Add(new Enemy.TrackingShooterFish(this, i, 520)); } return(true); }
bool Wave4() { if (counter >= 10) { counter = 0; EnemyBulletList.Add(new Bullet.Blocky(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } counter++; if (counter2 >= 40) { counter2 = 0; EnemyBulletList.Add(new Bullet.Add(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } counter2++; if (counter3 >= 50) { double num = rand.NextDouble(); if (num < 0.1) { EnemyBulletList.Add(new Bullet.Life(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } else if (num >= 0.1 && num <= 0.5) { EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } else { EnemyBulletList.Add(new Bullet.Clear(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } counter3 = 0; } counter3++; if (this.EnemyList.Count == 0) { EnemyList.Add(new Enemy.TrackingShooterFish(this, 200)); EnemyList.Add(new Enemy.TrackingShooterFish(this, 300)); EnemyList.Add(new Enemy.TrackingShooterFish(this, 500)); EnemyList.Add(new Enemy.TrackingShooterFish(this, 600)); EnemyList.Add(new Enemy.EvilEel(this, 350)); counter = 0; counter2 = 0; counter3 = 0; return(true); } return(false); }
/// <summary> /// Helps to prepare the level. /// </summary> protected override void PrepareLevel() { EnemyList.Add(new Enemy.EvilEel2(this, 200)); EnemyList.Add(new Enemy.EvilEel2(this, 500)); WaveList.Enqueue(Wave1); WaveList.Enqueue(Wave2); WaveList.Enqueue(Wave3); WaveList.Enqueue(Wave4); WaveList.Enqueue(Wave5); WaveList.Enqueue(Wave6); WaveList.Enqueue(Wave7); }
public void CreateEnemy() { var enemy = GetCharacter(EnemyPrefab, Enemy_OnAttack, null, null, null, null, Enemy_OnDie); enemy.transform.parent = EnemyObjectRoot.transform; enemy.transform.position = enemySpawnPoints[currentEnemySpawnIndex++].position; if (currentEnemySpawnIndex >= enemySpawnPoints.Count) { currentEnemySpawnIndex = 0; } EnemyList.Add(enemy); enemy.name += enemyNum++.ToString(); }
public override void createEnemies() { MonsterFactory oFactory = new MonsterFactory(); Monster Enemy; int rand = random.Next(5, 8); for (int i = 0; i < rand; i++) { Enemy = oFactory.CreateMonster("GigantSpider", 1); Enemy.setID(i); EnemyList.Add(Enemy); System.Threading.Thread.Sleep(100); } }
void GenerateEnemies(int enemyAmount) { int currentEnemies = EnemyList.Count; for (int i = 0; i < enemyAmount; i++) { if (i > currentEnemies - 1) { Enemy enemy = new Enemy(); EnemyList.Add(enemy); //TestEnemies.Add(enemy); } } }
public override void createEnemies(Ambient ambient) { MonsterFactory oFactory = new MonsterFactory(); Monster Enemy; int rand = random.Next(5, 8); for (int i = 0; i < rand; i++) { string generatedMonster = ambient.getRandomMonster(); Enemy = oFactory.CreateMonster(generatedMonster, 1); Enemy.setID(i); EnemyList.Add(Enemy); System.Threading.Thread.Sleep(100); } }
protected override void OnAttachServant(DisableNotifyMonoBehaviour servant) { base.OnAttachServant(servant); if (servant is StageObject) { StageObject stageObject = servant as StageObject; objectList.Add(stageObject); if (stageObject is Character) { characterList.Add(stageObject); if (stageObject is Player) { playerList.Add(stageObject); if (stageObject is NonPlayer) { nonplayerList.Add(stageObject); } if (stageObject is Self && self == null) { self = (stageObject as Self); } } else if (stageObject is Enemy) { Enemy enemy = stageObject as Enemy; enemyList.Add(stageObject); EnemyList.Add(enemy); if (boss == null && enemy.isBoss) { boss = enemy; } } } if (stageObject is GimmickObject) { gimmickList.Add(stageObject); } if (stageObject is DecoyBulletObject) { decoyList.Add(stageObject); } if (stageObject is FieldWaveTargetObject) { waveTargetList.Add(stageObject); } } }
bool Wave3() { if (counter >= 20) { counter = 0; EnemyBulletList.Add(new Bullet.Blocky(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } counter++; if (counter2 >= 40) { counter2 = 0; EnemyBulletList.Add(new Bullet.Add(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } counter2++; if (counter3 >= 50) { if (rand.NextDouble() < 0.3) { EnemyBulletList.Add(new Bullet.Life(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } else { EnemyBulletList.Add(new Bullet.HPP(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); } counter3 = 0; } counter3++; if (this.EnemyList.Count == 0) { EnemyList.Add(new Enemy.TrackingShooterFish(this, 200)); EnemyList.Add(new Enemy.TrackingShooterFish(this, 300)); EnemyList.Add(new Enemy.TrackingShooterFish(this, 500)); EnemyList.Add(new Enemy.TrackingShooterFish(this, 600)); EnemyList.Add(new Enemy.TrackingShooterFish(this, 100)); counter = 0; counter2 = 0; return(true); } return(false); }
/// <summary> /// Adds a new enemy of the same type if destroyed by a collision. /// </summary> /// <param name="DestroyedEnemy">The type of enemy that was destroy.</param> public void AddEnemyIfRemoved(Bitmap DestroyedEnemy) { if (DestroyedEnemy == SwinGame.BitmapNamed("enemy1")) { EnemyList.Add(_enemyFactory.GetSlowEnemy()); } else if (DestroyedEnemy == SwinGame.BitmapNamed("enemy2")) { EnemyList.Add(_enemyFactory.GetMediumEnemy()); } else if (DestroyedEnemy == SwinGame.BitmapNamed("enemy3")) { EnemyList.Add(_enemyFactory.GetFastEnemy()); } }
/// <summary> /// 添加敌人 /// </summary> /// <returns></returns> public void AddEnemy(EnemyData enemy) { if (enemy == null) { return; } var findv = EnemyList.Find(t => (t.UserId == enemy.UserId)); if (findv == null) { if (EnemyList.Count >= DataHelper.CombatLogCountMax) { EnemyList.RemoveAt(0); } EnemyList.Add(enemy); } }
bool Wave3() { if (EnemyList.Count == 0) { EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(256, 300), 1074, true)); EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(512, 300), 1074, true)); EnemyList.Add(new Enemy.VerticalSaucer(this, new Vector2(768, 300), 1074, true)); EnemyList.Add(new Enemy.HorizontalSaucer(this, new Vector2(300, 400), -25, true)); EnemyList.Add(new Enemy.HorizontalSaucer(this, new Vector2(512, 200), -25, true)); EnemyList.Add(new Enemy.HorizontalSaucer(this, new Vector2(624, 100), -25, true)); return(true); } else { return(false); } }
/// <summary> /// Represent the second wave of the enemy. /// </summary> /// <returns></returns> bool Wave2() { if (EnemyList.Count != 0) { return(false); } else { EnemyList.Add(new Enemy.Smiley(this, 1300, 225)); EnemyList.Add(new Enemy.Smiley(this, 1300, 325)); EnemyList.Add(new Enemy.Smiley(this, 1300, 425)); EnemyList.Add(new Enemy.Smiley(this, 1200, 325)); EnemyList.Add(new Enemy.Smiley(this, 1400, 325)); return(true); } }
bool Wave7() { if (EnemyList.Count != 0) { return(false); } else { for (int y = 0; y <= 2; y++) { for (int x = 50; x <= 1024; x += 100) { EnemyList.Add(new Enemy.Seahorse(this, x, (int)(0.5 * (float)x + 800 + 700 * y))); } } return(true); } }
/// <summary> /// Helps to restart the level. /// </summary> protected override void PrepareLevel() { EnemyList.Add(new Enemy.Seahorse(this, 100, 700)); EnemyList.Add(new Enemy.Seahorse(this, 400, 600)); EnemyList.Add(new Enemy.Seahorse(this, 300, 800)); EnemyList.Add(new Enemy.Seahorse(this, 1000, 850)); EnemyList.Add(new Enemy.TrackingShooterFish3(this, 1200, 100)); EnemyList.Add(new Enemy.TrackingShooterFish3(this, 1200, 200)); EnemyList.Add(new Enemy.TrackingShooterFish3(this, 1200, 500)); EnemyList.Add(new Enemy.Cloud(this, new Vector2(1100, 200))); EnemyList.Add(new Enemy.Cloud(this, new Vector2(1100, 210))); EnemyList.Add(new Enemy.Cloud(this, new Vector2(1140, 190))); EnemyList.Add(new Enemy.Cloud(this, new Vector2(1400, 250))); EnemyList.Add(new Enemy.Cloud(this, new Vector2(1350, 200))); EnemyList.Add(new Enemy.Cloud(this, new Vector2(1200, 190))); EnemyList.Add(new Enemy.Smiley(this, 1300, 325)); EnemyList.Add(new Enemy.Smiley(this, 1650, 325)); EnemyList.Add(new Enemy.Cloud(this, new Vector2(2000, 250))); EnemyList.Add(new Enemy.Cloud(this, new Vector2(2150, 200))); EnemyList.Add(new Enemy.Cloud(this, new Vector2(2250, 230))); EnemyList.Add(new Enemy.Seahorse(this, 100, 2000)); EnemyList.Add(new Enemy.Seahorse(this, 400, 2100)); EnemyList.Add(new Enemy.Seahorse(this, 300, 2200)); EnemyList.Add(new Enemy.Seahorse(this, 1000, 2150)); WaveList.Enqueue(Wave1); WaveList.Enqueue(Wave2); WaveList.Enqueue(Wave3); WaveList.Enqueue(Wave4); WaveList.Enqueue(Wave5); WaveList.Enqueue(Wave6); WaveList.Enqueue(Wave7); WaveList.Enqueue(Wave8); WaveList.Enqueue(Wave9); WaveList.Enqueue(Wave10); WaveList.Enqueue(Wave11); }
private static EnemyList GreedilyFindBestEnemyCombination(List <EnemyTypes> availableEnemyTypes, List <double> partialInput, double pointsAvailable) { var enemyList = new EnemyList(); var minPointValue = availableEnemyTypes.Min(e => e.PointValue()); while (pointsAvailable >= minPointValue && enemyList.TotalEnemies < MaxEnemies) { var bestFitnessImprovement = 0.0; var bestEnemyType = availableEnemyTypes.MinBy(e => e.PointValue()); var currentFitness = enemyList.TotalEnemies == 0 ? 0 : ScoreEnemyList(enemyList, partialInput); foreach (var enemyType in availableEnemyTypes) { var enemyPointValue = enemyType.PointValue(); if (enemyPointValue > pointsAvailable) { continue; } var tempEnemyList = enemyList.DeepClone(); tempEnemyList.Add(enemyType); var fitnessOfList = ScoreEnemyList(tempEnemyList, partialInput); var enemyFitnessImprovement = fitnessOfList - currentFitness; enemyFitnessImprovement /= enemyPointValue; if (enemyFitnessImprovement < bestFitnessImprovement) { continue; } bestEnemyType = enemyType; bestFitnessImprovement = enemyFitnessImprovement; } pointsAvailable -= bestEnemyType.PointValue(); enemyList.Add(bestEnemyType); } return(enemyList); }
bool Wave1() { if (counter >= 40) { EnemyBulletList.Add(new Bullet.Blocky(new Vector2(rand.Next(1024), -20), new Vector2(-1, 3))); counter = 0; } counter++; if (this.EnemyList.Count == 0) { EnemyList.Add(new Enemy.ShooterFish(this, 200)); EnemyList.Add(new Enemy.ShooterFish(this, 400)); EnemyList.Add(new Enemy.ShooterFish(this, 500)); counter = 0; return(true); } return(false); }
bool Wave4() { if (EnemyList.Count != 0) { return(false); } else { for (int i = 1200; i <= 3000; i += 150) { EnemyList.Add(new Enemy.Cloud(this, new Vector2(i, 100))); } for (int i = 1400; i <= 3000; i += 600) { EnemyList.Add(new Enemy.Smiley(this, i, 300)); } return(true); } }