public void RpcPowerupFailed() { if (m_bStartPowerupSequence && bComplete) { eRandomPowerup = (POWERTYPES)UnityEngine.Random.Range(0, 4); GivePlayerPowerup(eRandomPowerup); fPowerCount = fPowerTime; bHasPowerup = true; Debug.Log("WON IT BOI"); CS_SoundTest.PlaySoundOnObject(gameObject, "SFX/Powerups/PowerWin"); } else if (m_bStartPowerupSequence && !bComplete) { Debug.Log("LOST IT BOI"); CS_SoundTest.PlaySoundOnObject(gameObject, "SFX/Powerups/PowerLose"); } for (int i = 0; i < iRandLength - 1; ++i) { PlayerArrows[i].enabled = false; } bComplete = false; bIsTrig = false; m_bStartPowerupSequence = false; }
private void GivePlayerPowerup(POWERTYPES a_ePowerType) { CS_FirstPersonController playerRef = GetComponent <CS_FirstPersonController>(); switch (a_ePowerType) { case POWERTYPES.DAMAGEUP: { Debug.Log("DAMAGEUP"); fPowerOldDamage = playerRef.GetDamage(); playerRef.SetDamage(50); playerRef.SetText("INCREASE DAMAGE"); break; } case POWERTYPES.HEALTHUP: { Debug.Log("HEALTHUP"); playerRef.SetText("HEALTH"); fPowerOldHealth = playerRef.GetHealth(); playerRef.SetHealth(180); break; } case POWERTYPES.INVINCIBILITY: { Debug.Log("INVINCIBILITY"); playerRef.SetText("INVINCIBILITY"); fPowerOldHealth = playerRef.GetHealth(); fPowerOldMaxHealth = playerRef.GetMaxHealth(); playerRef.SetMaxHealth(1000); playerRef.SetHealth(999); break; } case POWERTYPES.SPEEDUP: { Debug.Log("SPEEDUP"); playerRef.SetText("SPEED UP"); fPowerOldSpeed = playerRef.GetWalkSpeed(); playerRef.SetWalkSpeed(15); break; } } }
private void TakePlayerPowerup(POWERTYPES a_ePowerType) { CS_FirstPersonController playerRef = GetComponent <CS_FirstPersonController>(); switch (a_ePowerType) { case POWERTYPES.DAMAGEUP: { Debug.Log("DAMAGEUP"); playerRef.SetDamage((int)fPowerOldDamage); //hey bby break; } case POWERTYPES.HEALTHUP: { Debug.Log("HEALTHUP"); playerRef.SetHealth((int)fPowerOldHealth); break; } case POWERTYPES.INVINCIBILITY: { Debug.Log("INVINCIBILITY"); playerRef.SetHealth((int)fPowerOldHealth); playerRef.SetMaxHealth((int)fPowerOldMaxHealth); break; } case POWERTYPES.SPEEDUP: { Debug.Log("SPEEDUP"); GetComponent <CS_FirstPersonController>().SetWalkSpeed((int)fPowerOldSpeed); break; } } }