fix: a stagger cancels the form's attack
A form swing waits for its clip's hit event and lands on a timeout if none comes, so a stagger that cut the clip short still dealt the blow. Attacks are marked as they start (TrySpendStamina, Ravager AttackRoutine) and their hits are dropped if a stagger began since. No attack or Cultist breath starts while staggered.
This commit is contained in:
parent
dd92bdf345
commit
beffd0bee6
5 changed files with 28 additions and 7 deletions
|
|
@ -726,7 +726,7 @@ namespace RacesOfValheim
|
|||
|
||||
private void ExecuteClawDamage(float baseDamage)
|
||||
{
|
||||
if (Player.m_localPlayer == null) return;
|
||||
if (Player.m_localPlayer == null || FormStagger.AttackInterrupted) return;
|
||||
|
||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 1f;
|
||||
|
|
@ -842,7 +842,7 @@ namespace RacesOfValheim
|
|||
bool canAct = RaceInput.Allowed;
|
||||
|
||||
// Fire attack on Right Click
|
||||
if (canAct && RaceInput.AttackHeld(1))
|
||||
if (canAct && RaceInput.AttackHeld(1) && !Player.m_localPlayer.IsStaggering())
|
||||
{
|
||||
if (Player.m_localPlayer.GetEitr() > 0)
|
||||
{
|
||||
|
|
@ -1161,7 +1161,7 @@ namespace RacesOfValheim
|
|||
|
||||
private void ExecuteClawDamage(float baseDamage)
|
||||
{
|
||||
if (Player.m_localPlayer == null) return;
|
||||
if (Player.m_localPlayer == null || FormStagger.AttackInterrupted) return;
|
||||
|
||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 1f;
|
||||
|
|
@ -1375,7 +1375,7 @@ namespace RacesOfValheim
|
|||
|
||||
private void ExecuteBiteDamage(float baseDamage)
|
||||
{
|
||||
if (Player.m_localPlayer == null) return;
|
||||
if (Player.m_localPlayer == null || FormStagger.AttackInterrupted) return;
|
||||
|
||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||
// Il lupo è basso, abbassiamo l'altezza dell'attacco
|
||||
|
|
@ -1584,7 +1584,7 @@ namespace RacesOfValheim
|
|||
|
||||
private void ExecuteBiteDamage(float baseDamage)
|
||||
{
|
||||
if (Player.m_localPlayer == null) return;
|
||||
if (Player.m_localPlayer == null || FormStagger.AttackInterrupted) return;
|
||||
|
||||
Vector3 playerPos = Player.m_localPlayer.transform.position;
|
||||
Vector3 attackPoint = playerPos + Player.m_localPlayer.transform.forward * 1.5f + Vector3.up * 0.5f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue