void CastSpell() { if (heroEquipment.paused == false) { //If the spell cast is not on cooldown if (!heroCooldowns.spellCooling) { if (heroLight.currentLight < 20) { Camera.main.SendMessage("ScreenShake"); return; } heroEquipment.EmberLoseDurability(); heroLight.LoseLight(20); playersLight.intensity = 5.5f; ///Instantiate(castParticles, transform.position, transform.rotation); heroCooldowns.spellCooling = true; anim.CrossFade("Spellcasting", 0.01f); shoot = true; if (heroEquipment.equippedAccessory == accessory.BoltOfLight) { audioPlayer.PlayOneShot(boltAudio); } else if (heroEquipment.equippedAccessory == accessory.OrbOfLight) { audioPlayer.PlayOneShot(orbAudio); } } else { UICD.FlashCooldown(0); } } }
void CollectLight() { if (!heroCooldowns.collectorCooling) { Instantiate(ping, transform.position, transform.rotation); Instantiate(ping2, transform.position, transform.rotation); heroCooldowns.collectorCooling = true; Shadow = GameObject.FindGameObjectsWithTag("Enemy"); if (Shadow != null) { for (int i = 0; i < Shadow.Length; i++) { // if (Shadow[i].name == "ShadowSpawn" || Shadow[i].name == "ShadowSpawn(Clone)") Shadow[i].SendMessage("BlindedByTheLight", SendMessageOptions.DontRequireReceiver); } } } else { UICD.FlashCooldown(2); } }
void Dash() { //If the player isnt already dashing, begin dashing if (!heroCooldowns.dashCooling) { if (heroLight.currentLight < 10) { return; } theoptions.AddToDash(); //Make the player spend light heroLight.LoseLight(10); heroEquipment.EmberLoseDurability(); heroCooldowns.dashCooling = true; timeRemaining = dashDuration; if (heroEquipment.equippedBoot != boot.Whirlwind && heroEquipment.equippedBoot != boot.Decoy) { //Change the animation state into dashing anim.CrossFade("PlayerDashing", 0.01f); } //Set up the local variables trailBlazerDropTimer = 0.1f; lockRot = transform.rotation; if (heroEquipment.equippedBoot == boot.Trailblazer) { aPlayer.PlayOneShot(trail); } if (heroEquipment.equippedBoot == boot.Charge) { aPlayer.PlayOneShot(charge); oldPos = transform.position; once = true; //No ember equipped if (heroEquipment.equippedEmber == ember.None) { Instantiate(LightCharge, transform.position, new Quaternion(0, 0, 0, 0)); } //Ice ember equipped else if (heroEquipment.equippedEmber == ember.Ice) { Instantiate(IceCharge, transform.position, new Quaternion(0, 0, 0, 0)); } //Fire ember equipped else if (heroEquipment.equippedEmber == ember.Fire) { Instantiate(FireCharge, transform.position, new Quaternion(0, 0, 0, 0)); } //Wind ember equipped else if (heroEquipment.equippedEmber == ember.Wind) { Instantiate(WindCharge, transform.position, new Quaternion(0, 0, 0, 0)); } //Life ember equipped else if (heroEquipment.equippedEmber == ember.Life) { Instantiate(LifeCharge, transform.position, new Quaternion(0, 0, 0, 0)); } else if (heroEquipment.equippedEmber == ember.Death) { Instantiate(DeathCharge, transform.position, new Quaternion(0, 0, 0, 0)); } else if (heroEquipment.equippedEmber == ember.Earth) { Instantiate(EarthCharge, transform.position, new Quaternion(0, 0, 0, 0)); } } if (heroEquipment.equippedBoot == boot.Blink) { aPlayer.PlayOneShot(blink); oldPos = transform.position; once = true; Vector3 temp = (transform.TransformDirection(Vector3.up.normalized) * 3.0f) + transform.position; //No ember equipped if (heroEquipment.equippedEmber == ember.None) { Instantiate(LightBlink, temp, new Quaternion(0, 0, 0, 0)); } //Ice ember equipped else if (heroEquipment.equippedEmber == ember.Ice) { Instantiate(IceBlink, temp, new Quaternion(0, 0, 0, 0)); } //Fire ember equipped else if (heroEquipment.equippedEmber == ember.Fire) { Instantiate(FireBlink, temp, new Quaternion(0, 0, 0, 0)); } //Wind ember equipped else if (heroEquipment.equippedEmber == ember.Wind) { Instantiate(WindBlink, temp, new Quaternion(0, 0, 0, 0)); } //Life ember equipped else if (heroEquipment.equippedEmber == ember.Life) { Instantiate(LifeBlink, temp, new Quaternion(0, 0, 0, 0)); } else if (heroEquipment.equippedEmber == ember.Death) { Instantiate(DeathBlink, temp, new Quaternion(0, 0, 0, 0)); } else if (heroEquipment.equippedEmber == ember.Earth) { Instantiate(EarthBlink, temp, new Quaternion(0, 0, 0, 0)); } } if (heroEquipment.equippedBoot == boot.Whirlwind) { aPlayer.PlayOneShot(whirl); oldPos = transform.position; once = true; //No ember equipped if (heroEquipment.equippedEmber == ember.None) { Instantiate(lightWhirl, transform.position, transform.rotation); } //Ice ember equipped else if (heroEquipment.equippedEmber == ember.Ice) { Instantiate(iceWhirl, transform.position, transform.rotation); } //Fire ember equipped else if (heroEquipment.equippedEmber == ember.Fire) { Instantiate(fireWhirl, transform.position, transform.rotation); } //Wind ember equipped else if (heroEquipment.equippedEmber == ember.Wind) { Instantiate(windWhirl, transform.position, transform.rotation); } //Life ember equipped else if (heroEquipment.equippedEmber == ember.Life) { Instantiate(lifeWhirl, transform.position, transform.rotation); } //Death ember equipped else if (heroEquipment.equippedEmber == ember.Death) { Instantiate(deathWhirl, transform.position, transform.rotation); } //Earth ember equipped else if (heroEquipment.equippedEmber == ember.Earth) { Instantiate(earthWhirl, transform.position, transform.rotation); } } if (heroEquipment.equippedBoot == boot.Decoy) { aPlayer.PlayOneShot(decoy); oldPos = transform.position; Vector3 temp = (transform.TransformDirection(Vector3.up.normalized)); controller.Move(temp); //No ember equipped if (heroEquipment.equippedEmber == ember.None) { Instantiate(lightDecoy, oldPos, transform.rotation); } //Ice ember equipped else if (heroEquipment.equippedEmber == ember.Ice) { Instantiate(iceDecoy, oldPos, transform.rotation); } //Fire ember equipped else if (heroEquipment.equippedEmber == ember.Fire) { Instantiate(fireDecoy, oldPos, transform.rotation); } //Wind ember equipped else if (heroEquipment.equippedEmber == ember.Wind) { Instantiate(windDecoy, oldPos, transform.rotation); } //Life ember equipped else if (heroEquipment.equippedEmber == ember.Life) { Instantiate(lifeDecoy, oldPos, transform.rotation); } //Death ember equipped else if (heroEquipment.equippedEmber == ember.Death) { Instantiate(deathDecoy, oldPos, transform.rotation); } //Earth ember equipped else if (heroEquipment.equippedEmber == ember.Earth) { Instantiate(earthDecoy, oldPos, transform.rotation); } } } else { UICD.FlashCooldown(1); } }