private IEnumerator MovingSkills() { while (!movingSkillRunning) { switch (Random.Range(0, 3)) { case 0: Skill om = new OrionMove(); om_Behaviour.Use(Enemy); movingSkillRunning = true; yield return(new WaitForSeconds(om.SkillCoolDown)); movingSkillRunning = false; break; case 1: Skill tel = new Teleporter(); tel_Behaviour.Use(Enemy); movingSkillRunning = true; yield return(new WaitForSeconds(tel.SkillCoolDown)); movingSkillRunning = false; break; case 2: Skill cir = new CircleMove(); StartCoroutine(circle_Move_Behaviour.Use(Enemy)); movingSkillRunning = true; yield return(new WaitForSeconds(cir.SkillCoolDown)); movingSkillRunning = false; break; } } }
IEnumerator EnemySpawnPhase() { RandomStart = Random.Range(-3.4f, 3.4f); if (DificultySelect.easyLevel) { Amount = Random.Range(1, 5); } if (DificultySelect.medLevel) { Amount = Random.Range(1, 9); } if (DificultySelect.HardLevel) { Amount = Random.Range(1, 12); } yield return(new WaitForSeconds(1f)); for (int i = 0; i < Amount; i++) { Debug.Log(" Random Spawn :" + RandomSpawn); GameObject obj = (GameObject)Instantiate(Ship [RandomSpawn], transform.position, transform.rotation); obj.transform.parent = transform; PlaceShip(obj, i, Amount); CircleMove sc = obj.GetComponent <CircleMove> (); float angle = Vector3.Angle(obj.transform.localPosition, transform.forward); Vector3 cross = Vector3.Cross(obj.transform.localPosition, transform.forward); if (cross.y < 0) { angle = -angle; } sc.phase = angle * Mathf.Deg2Rad; } }
public WarperSpaceship() { SpaceshipClassName = "Warper"; SpaceshipClassDescription = "BALLANCED"; Base_attack = 15; Base_def = 4; MaxHealth = 1000; CurrentHealth = MaxHealth; QSkill = new BasicAttack(); WSkill = new SteeringMissile(); ESkill = new BlasterOrb(); ASkill = new OrionMove(); SSkill = new Teleporter(); DSkill = new CircleMove(); ZSkill = new Invisible(); XSkill = new ElectricCharge(); CSkill = new BlackHole(); }
public OrionSpaceship() { SpaceshipClassName = "Orion"; SpaceshipClassDescription = "GOOD DEF, WEAK ATTACK"; Base_attack = 10; Base_def = 8; MaxHealth = 1200; CurrentHealth = MaxHealth; QSkill = new BasicAttack(); WSkill = new SteeringMissile(); ESkill = new BlasterOrb(); ASkill = new OrionMove(); SSkill = new Teleporter(); DSkill = new CircleMove(); ZSkill = new Shield(); XSkill = new AirForceCall(); CSkill = new Revind(); }
public ScalpelSpaceship() { SpaceshipClassName = "Scalpel"; SpaceshipClassDescription = "STRONG ATTACK"; Base_attack = 12; Base_def = 2; MaxHealth = 800; CurrentHealth = MaxHealth; QSkill = new BasicAttack(); WSkill = new SteeringMissile(); ESkill = new BlasterOrb(); ASkill = new OrionMove(); SSkill = new Teleporter(); DSkill = new CircleMove(); ZSkill = new MirrorShield(); XSkill = new Desant(); CSkill = new LaserBeam(); }
/** * init the right strategy (selected by dropdown in the inspector) */ private IMoveBehaviorStrategy SetStrategyByDropDown() { IMoveBehaviorStrategy strategy = null; switch (_behave) { case MoveBehaviorEnum.Circle: strategy = new CircleMove(); break; case MoveBehaviorEnum.Straight_Line: strategy = new StraightMove(); break; default: Debug.LogError("Something went wrong with the strategy enum"); break; } return(strategy); }