public void AddHP(int bonus) { HP += bonus; ObserverHP.ChangeHP(HP); DrawChange(); if (HP > 50) { SteamAchievementsScript.Instance?.UnlockAchievment("ACH_VERY_MANY_HP"); } }
public void GetClearDamage(int damage) { HP = (damage < HP) ? HP - damage : 0; CreateBlood(); DrawChange(); ObserverHP.ChangeHP(HP); if (HP == 0) { StartDeath(); } }
public void AddMonet(int bonus) { score += bonus; if (score >= 10) { score -= 10; HP += 1; ObserverHP.ChangeHP(HP); } DrawChange(); }
public void GetDamage(int damage, bool isFacingRight) { if ((isblock) && (GetComponent <RoosterScriptWizard>())) { damage = 0; staminaController.DecreaseBlockStamina(); } if (Evasion > 0) { if (UnityEngine.Random.Range(0, 100) < Evasion) { damage = 0; } } if (GetComponent <RoosterScriptWithShield>()) { if ((isblock) && (isFacingRight == GetComponent <RoosterScriptWithShield>().isFacingRight)) { damage = (damage > 3) ? damage - 3 : 0; staminaController.DecreaseBlockStamina(); audioSource.PlayOneShot(AStrikeInBlock); } } damage = (damage > armor) ? damage - armor : 0; if (damage > 0) { staminaController.DecreaseStamina(damage / 2); if (Information.Instance.CauseOfDeath.Equals("Rogue") && score > 0) { score--; } HP = (damage < HP) ? HP - damage : 0; Jump(damage, isFacingRight); DrawChange(); } ObserverHP.ChangeHP(HP); if (HP == 0) { StartDeath(); } }