//-------------------------------------------------------------- // *** PICKUP *** public void OnPickup(Char_Geomancer necromancer) { switch (_Type) { // MINION SHIELD case PickupType.AddToShield: { AddToShield(necromancer); break; } // HEALTHPACK case PickupType.Healthpack: { Healthpack(necromancer); break; } // SPEED BOOST case PickupType.SpeedBoost: { SpeedBoost(necromancer); break; } // INVINCIBILITY case PickupType.Invincibility: { Invincibility(necromancer); break; } default: { break; } } }
public void SpeedBoost(Char_Geomancer geomancer) { geomancer.ActivateSpeedBoost(DeviceManager._pInstance._SpeedBoostModifier, DeviceManager._pInstance._SpeedBoostTime); // Play pickup sound SoundManager._pInstance.PlayPickupSpeedBoost(); // Destroy tag Destroy(gameObject); }
public void Invincibility(Char_Geomancer geomancer) { // Activate invincibility (or reset the timer if already invincible) geomancer.ActivateInvincibility(); // Play pickup sound SoundManager._pInstance.PlayPickupInvincibility(); // Destroy tag Destroy(gameObject); }
public void Healthpack(Char_Geomancer geomancer) { // Determine if whether the tag can be picked up or not // Check if there's any missing health if (geomancer.GetHealth() < geomancer.GetStartingHealth()) { // Add health to necromancer geomancer.AddHealth(DeviceManager._pInstance._HealthAddAmount); // Play pickup sound SoundManager._pInstance.PlayPickupHealthpack(); } // Destroy tag Destroy(gameObject); }
public void AddToShield(Char_Geomancer geomancer) { // Determine if whether the necromancer can be picked up or not // Get minion count int minionCount = geomancer.GetSpecialWeapon().GetComponent <Wep_Shield>().GetMinionCount(); // Check against max size float MaxSize = geomancer.GetSpecialWeapon().GetComponent <Wep_Shield>().GetMaxMinions() * 0.65f; if (minionCount < MaxSize) { // Add to meat shield geomancer.GetSpecialWeapon().GetComponent <Wep_Shield>().AddMinion(_Crystal); // Play pickup sound SoundManager._pInstance.PlayPickupMinion(); // Destroy tag Destroy(gameObject); } }