private void HandleOnHit(AttackPackage attack, AttackResult result) { _state._hitPoints -= result._finalDamage; _state._endurance -= result._finalFatigue; if (result._finalDamage > 0) { _hitFlash.Flash(); } if (_state._hitPoints <= 0) { _animator.SetBool(BossFSMData.Stat.Death, true); } }
private void HandleOnHit(AttackPackage attack, AttackResult result) { if (_animator.GetCurrentAnimation().name == GhoulAnimationData.Anim.Death_Ground) { return; } _flash.Flash(); _mover.Knockback(attack._fromDirection * attack._knockback); _state._hitPoints -= result._finalDamage; _state._endurance -= result._finalFatigue; if (_state._hitPoints < 0) { Dying(); } if (_state._endurance <= 0) { _state._endurance.Current = 0; _animator.SetToggle(attack._staggerAnimation, true); _launcher.Interrupt(); } }
private void HandleOnHit(AttackPackage attack, AttackResult result) { if (_animator.GetCurrentAnimation().name == PlayerFSMData.Anim.Death) { return; } _state._hitPoints -= result._finalDamage; _state._endurance -= result._finalFatigue; if (attack._move != null && result._isWeakspot) { TimeManager.Instance.FrozenFrame(attack._move.FrameFrozen); ShakeScreen.Instance.Shake(attack._move.ScreenShakeParam); } if (result._finalDamage > 0) { _hitFlash.Flash(); } if (result._finalFatigue > 0) { _enduranceRecoverTimer = 0; } if (attack._knockback != 0) { _mover.Knockback(attack._fromDirection * attack._knockback); } if (_state._hitPoints <= 0) { CancelAnimation(); _animator.SetToggle(PlayerFSMData.Stat.Death, true); print("Player Dead"); _mover.ResetMovement(); _weaponSystem.ResetWeapon(); } if (_state._endurance <= 0) { var input = _input as PlayerInput; var mInput = _input as MPlayerInput; if (input) { input.ResetDelayInput(); } else { mInput.ResetDelayInput(); } CancelAnimation(); _state._endurance.Current = 0; _animator.SetToggle(attack._staggerAnimation, true); SetBlockInput(true); SetFrozen(true); } }