// Use this for initialization public void initializeShip(enemyConfiguration ec, bool offensive) { owner = Owner.Enemy; weightclass = ec.weightClass; hull = ec.hull; engineType = ec.engineType; shieldType = ec.shieldType; powerGeneratorType = ec.powerGeneratorType; pdsType = ec.pdsType; hullBonus = ec.hullBonus; shieldBonus = ec.shieldBonus; hullColor = ec.color; setHull(); hullRef = GetComponentInChildren<Hull>(); shieldRef = GetComponentInChildren<Shield>(); shieldRef.controller = this; defensiveSystems.Add(shieldRef);//HACKY I Don't know why the f**k it doesn't already have shields in defensive sysstems setMass(); powerGenerator = GetComponentInChildren<PowerGenerator>(); powerGenerator.Start(); StartCoroutine(initialize()); if(offensive) Invoke("setOffensiveProfile",2f); if (hull == eHull.boss1 || hull == eHull.boss2 || hull == eHull.spaceStation) StartCoroutine(setUpBossSpawnPoints()); }
public void generateEnemies()//called by initialize mission during loading screen { if (type == MissionType.Boss) objective = generateBoss(); if (type == MissionType.BaseAssault) objective = generateSpaceStation(); enemiesToSpawn = new List<enemyConfiguration>(); for (int i = 0; i < numberOfWaves; i++) { numberOfT1Enemies = 0; numberOfT2Enemies = 0; numberOfT3Enemies = 0; for (int j = 0; j < baseNumberOfEnemies + i; j++ ) { float value = Random.Range(0, 1f); if (value <= t1Ratio ) numberOfT1Enemies++; if (value > t1Ratio) { if(value <= t1Ratio + t2Ratio) { numberOfT2Enemies++; } else { numberOfT3Enemies++; } } } for (int j = 0; j < numberOfT1Enemies; j++) { enemiesToSpawn.Add(generateEnemy(enemyConfiguration.Tier.t1)); } for (int j = 0; j < numberOfT2Enemies; j++) { enemiesToSpawn.Add(generateEnemy(enemyConfiguration.Tier.t2)); } for (int j = 0; j < numberOfT3Enemies; j++) { enemiesToSpawn.Add(generateEnemy(enemyConfiguration.Tier.t3)); } } if (type == MissionType.Boss) boss = generateBoss(); }
private void generateSpecialEnemies() { for(int i = 0; i < bonusObjectives.Length; i++) { switch (difficulty) { case Difficulty.Easy: bonusObjectives[i] = new enemyConfiguration(EnemyController.eHull.medium, Controller.WeightClass.Medium, Controller.EngineType.enemyEngine3, Controller.ShieldType.enemyShield2, Controller.PowerGeneratorType.enemyPGType3, Controller.PDSType.enemyPDSType3,0,0, Color.yellow); break; case Difficulty.Medium: bonusObjectives[i] = new enemyConfiguration(EnemyController.eHull.large, Controller.WeightClass.Heavy, Controller.EngineType.enemyEngine3, Controller.ShieldType.enemyShield3, Controller.PowerGeneratorType.enemyPGType3, Controller.PDSType.enemyPDSType3, 40, 70, Color.yellow); break; case Difficulty.Hard: bonusObjectives[i] = new enemyConfiguration(EnemyController.eHull.large, Controller.WeightClass.Heavy, Controller.EngineType.enemyEngine3, Controller.ShieldType.enemyShield3, Controller.PowerGeneratorType.enemyPGType3, Controller.PDSType.enemyPDSType3, 50, 70, Color.yellow); break; } } }
private enemyConfiguration generateEnemy(enemyConfiguration.Tier t) { enemyConfiguration eConfig; switch (t) { case enemyConfiguration.Tier.t1: eConfig = new enemyConfiguration(EnemyController.eHull.small, Controller.WeightClass.Light, Controller.EngineType.enemyEngine1, Controller.ShieldType.enemyShield1, Controller.PowerGeneratorType.enemyPGType1, Controller.PDSType.enemyPDSType1, 0, 0, Color.white); return eConfig; case enemyConfiguration.Tier.t2: eConfig = new enemyConfiguration(EnemyController.eHull.medium, Controller.WeightClass.Medium, Controller.EngineType.enemyEngine2, Controller.ShieldType.enemyShield2, Controller.PowerGeneratorType.enemyPGType2, Controller.PDSType.enemyPDSType2, 0, 0, Color.white); return eConfig; case enemyConfiguration.Tier.t3: eConfig = new enemyConfiguration(EnemyController.eHull.large, Controller.WeightClass.Heavy, Controller.EngineType.enemyEngine3, Controller.ShieldType.enemyShield3, Controller.PowerGeneratorType.enemyPGType3, Controller.PDSType.enemyPDSType3, 0, 0, Color.white); return eConfig; } return null; }
private enemyConfiguration generateSpaceStation() { enemyConfiguration eConfig; switch (difficulty) { case Difficulty.Easy: eConfig = new enemyConfiguration(EnemyController.eHull.spaceStation, Controller.WeightClass.spaceStation, Controller.EngineType.enemyEngine1, Controller.ShieldType.enemyShield1, Controller.PowerGeneratorType.enemyPGType2, Controller.PDSType.enemyPDSType1, 0, 0, Color.white); return eConfig; case Difficulty.Medium: eConfig = new enemyConfiguration(EnemyController.eHull.spaceStation, Controller.WeightClass.spaceStation, Controller.EngineType.enemyEngine1, Controller.ShieldType.enemyShield2, Controller.PowerGeneratorType.enemyPGType3, Controller.PDSType.enemyPDSType1, 0, 0, Color.white); return eConfig; case Difficulty.Hard: eConfig = new enemyConfiguration(EnemyController.eHull.spaceStation, Controller.WeightClass.spaceStation, Controller.EngineType.enemyEngine1, Controller.ShieldType.enemyShield3, Controller.PowerGeneratorType.boss1, Controller.PDSType.enemyPDSType1, 0, 0, Color.white); return eConfig; } return null; }
private enemyConfiguration generateBoss() { enemyConfiguration eConfig; switch (difficulty) { case Difficulty.Medium: eConfig = new enemyConfiguration(EnemyController.eHull.boss1, Controller.WeightClass.boss1, Controller.EngineType.boss1, Controller.ShieldType.boss1, Controller.PowerGeneratorType.boss1, Controller.PDSType.boss1, 0, 0, Color.white); return eConfig; case Difficulty.Hard: eConfig = new enemyConfiguration(EnemyController.eHull.boss2, Controller.WeightClass.boss2, Controller.EngineType.boss2, Controller.ShieldType.boss2, Controller.PowerGeneratorType.boss2, Controller.PDSType.boss2, 0, 0, Color.white); return eConfig; } return null; }