public void Fallout() { OnReceiveAttack?.Invoke(); playerInfo.CurrentHealthPoint -= 100; playerInfo.CurrentKnockdownPoint = 0f; playerController.Fallout(); OnReceiveCrit?.Invoke(); }
public void ReceiveAttack(CombatInfo combatInfo, float enemyXPosition) { if (Invincible) { return; } OnReceiveAttack?.Invoke(); GetComponent <AudioSource>().clip = combatInfo.hitClip; GetComponent <AudioSource>().Play(); playerInfo.CurrentHealthPoint -= combatInfo.damage; if (combatInfo.isCrit) { OnReceiveCrit?.Invoke(); } if (combatInfo.stateType == StateType.Combat) { playerInfo.CurrentKnockdownPoint += combatInfo.damage; } if (combatInfo.isKnockDown || playerInfo.IsDead) { playerInfo.CurrentKnockdownPoint = 0f; playerController.Damaged(combatInfo.applyVelocity, combatInfo.stiffTime, true, enemyXPosition); } else if (playerInfo.IsKnockdown) { playerInfo.CurrentKnockdownPoint = 0f; playerController.Damaged(combatInfo.applyVelocity, 0, true, enemyXPosition); } else { playerController.Damaged(combatInfo.applyVelocity, combatInfo.stiffTime, false, enemyXPosition); } }