//Combat override public void DeductHealth(Damage dmg) { IC.PopUpText(dmg); if (dmg.Crit) { Animator Anim = VisualHolder.GetComponent <Animator>(); Anim.Play("crit"); //if (dmg.SFX_Update) // AudioSource.PlayClipAtPoint(crit_hurt, transform.position, GameManager.SFX_Volume); } //} else { // if (dmg.SFX_Update) // AudioSource.PlayClipAtPoint(hurt, transform.position, GameManager.SFX_Volume); //} if (CurrStats.Get(STATSTYPE.HEALTH) - dmg.Amount <= 0 && Alive) { ON_DEATH_UPDATE += Die; ON_DEATH_UPDATE(); ON_DEATH_UPDATE -= Die; } else { CurrStats.Dec(STATSTYPE.HEALTH, dmg.Amount); } }
//-------helper protected void UpdateStats() { ResetBounuses(); InitMaxStats(); ApplyEquipmentsUtilities(); ReloadWeaponWC(); InitOnCallEvent(); ApplyBounuses(); InitPassives(); for (int i = 0; i < Stats.Size; i++) { if ((int)STATSTYPE.HEALTH == i) { if (CurrStats.Get(i) > MaxStats.Get(i)) { CurrStats.Set(i, MaxStats.Get(i)); } } else if ((int)STATSTYPE.ESSENSE == i) { if (CurrStats.Get(i) > MaxStats.Get(i)) { CurrStats.Set(i, MaxStats.Get(i)); } } else { CurrStats.Set(i, MaxStats.Get(i)); } } }