void MutilateHandler() { if (currentAttack != null) { return; } if (C.MutilateDown) { //Start Mutilate mutilateStartTime = Time.time; attackState = e_AttackState.Mutilating; } else if (mutilateStartTime != null) { if (C.MutilateHeld) { if (mutilateStartTime + mutilateCastTime > Time.time) { //Mutilate progress PostProcess.SetMutilatePP((Time.time - (float)mutilateStartTime) / mutilateCastTime); } else if (mutilateStartTime + mutilateCastTime + mutilateRecoverTime > Time.time) { //Reset mutilate if (attackState != e_AttackState.MutilateRecover) { if (PB.CurHealth > mutilateHealthCost) { PB.AddHealth(-mutilateHealthCost); PB.AddBlood(mutilateMinBloodGain + mutilateBloodGain); } else { if (PB.CurHealth > 1) { PB.AddBlood(mutilateBloodGain * ((PB.CurHealth - 1) / mutilateHealthCost)); PB.AddHealth(-PB.CurHealth + 1); } PB.AddBlood(mutilateMinBloodGain); } PB.AddMadness(mutilateMadnessGain); PostProcess.SetMutilatePP(0); FX.SpawnHitFX(BodyRaycastOrigin.position + Visual.forward * BodyColl.radius, Visual.forward, transform); attackState = e_AttackState.MutilateRecover; } } else { PostProcess.SetMutilatePP(0); attackState = e_AttackState.None; mutilateStartTime = null; } } else if (attackState != e_AttackState.MutilateRecover || (float)mutilateStartTime + mutilateCastTime + mutilateRecoverTime <= Time.time) { PostProcess.SetMutilatePP(0); attackState = e_AttackState.None; mutilateStartTime = null; } } }