public void TakeDamage(float damage, Vector2 attackPos, bool shouldPunchUp) { if (m_canTakeDamage && !m_isShielding && !m_isDodging) { m_Character.m_Grounded = false; m_canTakeDamage = false; currentHealthPercent += damage; //Using chance based on remaining health, determine whether or not this attack was big, knocking them down if (UnityEngine.Random.Range(0.0f, (200.0f * (speedScale * 2))) < currentHealthPercent) { m_wasHitBig = true; if (shouldPunchUp) { m_Character.StopMovement(); m_Character.AddPunchUpForce(attackPos, (((1.5f * damage) + ((damage * currentHealthPercent) / 100)) / speedScale)); m_wasPunchedUp = true; } else { m_Character.PushAwayFromPoint(attackPos, (((1.5f * damage) + ((damage * currentHealthPercent) / 100)) / speedScale)); } } else { m_wasHitSmall = true; if (shouldPunchUp) { m_Character.StopMovement(); m_Character.AddPunchUpForce(attackPos, (((1.5f * damage) + ((damage * currentHealthPercent) / 100)) / speedScale)); } else { m_Character.PushAwayFromPoint(attackPos, (((1.5f * damage) + ((damage * currentHealthPercent) / 100)) / speedScale)); } } } }