void Shoot() { RaycastHit hitInfo; if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hitInfo, 1000f)) // this will return true if the ray hits something // References of the scripts that the ray could hit { Enemy enemyHit = hitInfo.transform.GetComponent <Enemy>(); DreamKFly dreamKillerHit = hitInfo.transform.GetComponent <DreamKFly>(); Shot shotHit = hitInfo.transform.GetComponent <Shot>(); PowerCarrier powerCarrierHit = hitInfo.transform.GetComponent <PowerCarrier>(); FirstBoss firstBossHit = hitInfo.transform.GetComponent <FirstBoss>(); Spawn spawnHit = hitInfo.transform.GetComponent <Spawn>(); SpawnShot spawnShotHit = hitInfo.transform.GetComponent <SpawnShot>(); if (enemyHit != null) { enemyHit.TakeDamage(damage); } if (dreamKillerHit != null) { dreamKillerHit.TakeDamage(damage); } if (shotHit != null) { shotHit.TakeDamage(damage); } if (powerCarrierHit != null) { powerCarrierHit.TakeDamage(); } if (firstBossHit != null) { firstBossHit.TakeDamage(damage); } if (spawnHit != null) { spawnHit.TakeDamage(); } if (spawnShotHit != null) { spawnShotHit.TakeDamage(); } } //Instantiate(shotGraphics, fpsCam.transform.position, fpsCam.transform.rotation); //Instantiate(impactEffect, hitInfo.point, Quaternion.LookRotation(hitInfo.normal)); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { copy = jumpTimer; boss = animator.GetComponent <FirstBoss>(); if (boss.attackType == 1) { boss.Jump(); } else if (boss.attackType == 2) { boss.SpikeAttack(); } else if (boss.attackType == 3) { boss.ShortAttack(); } else if (boss.attackType == 4) { boss.MeteorAttack(); } }
public void Enter(FirstBoss enemy) { myBoss = enemy; }
// Start is called before the first frame update void Start() { firstBoss = firstBoss.GetComponent <FirstBoss>(); finalBoss = finalBoss.GetComponent <FinalBoss>(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { boss = animator.GetComponent <FirstBoss>(); timer = Random.Range(minTime, maxTime); //animator.SetInteger("AttackType", 0); }
public void Enter(FirstBoss enemy) { myBoss = enemy; myBoss.GetNextPosition(); }
private void Awake() { boss = GameObject.FindGameObjectWithTag("Boss").GetComponent <FirstBoss>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); }
public override Actor createActor(int id, Vector2 position, Microsoft.Xna.Framework.Vector2?velocity = null, double color = -1) { Actor a = null; if ((position.X >= 0 && position.X < world.width * Tile.size && position.Y >= 0 && position.Y < world.height * Tile.size)) { switch (id) { case 0: a = new Player(world, position); return(a); case 1: a = new Octo(world, position); break; case 2: a = new Blob(world, position, velocity ?? Vector2.Zero, color); break; case 3: a = new Sentinel(world, position); break; case 4: a = new Spikon(world, position); break; case 5: a = new Arrow(world, position, velocity ?? Vector2.Zero); return(a); case 6: a = new OctoBall(world, position, velocity ?? Vector2.Zero); return(a); case 7: a = new HealthOrb(world, position, velocity ?? Vector2.Zero); return(a); case 8: a = new FireShuriken(world, position, velocity ?? Vector2.Zero); return(a); case 9: a = new IceSpike(world, position, velocity ?? Vector2.Zero); return(a); case 10: a = new Numbers(world, position, velocity ?? Vector2.Zero); return(a); case 11: a = new FirstBoss(world, position); return(a); case 12: a = new LevelUp(world, position, velocity ?? Vector2.Zero); return(a); case 13: a = new Laser(world, position, velocity ?? Vector2.Zero); return(a); case 14: a = new FirePillar(world, position, velocity ?? Vector2.Zero); return(a); case 15: a = new ManaOrb(world, position, velocity ?? Vector2.Zero); return(a); case 16: a = new Zazzle(world, position); return(a); case 17: a = new ZazzleShot(world, position, velocity ?? Vector2.Zero); return(a); case 18: a = new Basilisk(world, position); return(a); case 19: a = new BlobSpawner(world, position); return(a); case 20: a = new Charger(world, position); return(a); case 21: a = new Grapple(world, position, velocity ?? Vector2.Zero); return(a); case 22: a = new Generator(world, position); return(a); case 23: a = new Explosion(world, position, velocity ?? Vector2.Zero); return(a); case 24: a = new Torch(world, position); return(a); case 25: a = new MagicPrimary(world, position, velocity ?? Vector2.Zero); return(a); case 26: a = new WizBlob(world, position); return(a); case 27: a = new LaserArrow(world, position, velocity ?? Vector2.Zero); return(a); case 28: a = new DiscoBlob(world, position, velocity ?? Vector2.Zero, color, checkpointCount++); break; case 29: a = new FireBlob(world, position, velocity ?? Vector2.Zero); break; case 30: a = new MrHammer(world, position, velocity ?? Vector2.Zero); break; case 31: a = new GigaBlob(world, position, velocity ?? Vector2.Zero); break; case 32: a = new MagicPrimary(world, position, velocity ?? Vector2.Zero); return(a); case 33: a = new DarkLucyPortrait(world, position, velocity ?? Vector2.Zero); return(a); case 34: a = new BloodyArrow(world, position, velocity ?? Vector2.Zero); return(a); case 35: a = new LucyFirePillar(world, position, velocity ?? Vector2.Zero); return(a); case 36: a = new WeddingPhoto(world, position, velocity ?? Vector2.Zero); return(a); case 37: a = new FancyPortrait(world, position, velocity ?? Vector2.Zero); return(a); case 38: a = new CoatOfArms(world, position, velocity ?? Vector2.Zero); return(a); case 39: a = new TandemBike(world, position, velocity ?? Vector2.Zero); return(a); case 40: a = new KnightStatue(world, position, velocity ?? Vector2.Zero); return(a); case 41: a = new SwordSlash(world, position, velocity ?? Vector2.Zero); return(a); } } return(a); }
public void Enter(FirstBoss enemy) { myBoss = enemy; myBoss.StartCoroutine(myBoss.SpawnEggs()); }