public void Push(IAttackHitbox hitbox) { Vector2 launchVector = SmashCalculator.ShieldKnockbackVector(hitbox, this); Debug.Log(launchVector); character.Velocity = launchVector; }
public void ShieldStun(IAttackHitbox hitbox) { if (!hitbox.Stats.HitStun) { return; } if (!IsShieldStunned) //If not shield stunned before { IsShieldStunned = true; character.IgnoreInput(true); } shieldStunFrameLeft = SmashCalculator.ShieldStunFrame(hitbox, this); }
public void Launch(IAttackHitbox hitbox) { Vector2 launchVector = SmashCalculator.LaunchVector(hitbox, this); IsLaunched = SmashCalculator.Tumble(hitbox, this); if (IsLaunched) { statusManager.AddStatus(launchStatus); } Debug.Log("Launched! " + launchVector); character.Velocity = launchVector; //Release from grab if launched with high enough velocity if (character.GetGrabber() != null && SmashCalculator.GrabRelease(hitbox, this)) { character.GetGrabber().GetComponent <ICharacter>().GrabRelease(); } }
public void HitStun(IAttackHitbox hitbox) { if (!hitbox.Stats.HitStun) { return; } EventManager.instance.InvokeOnHitStunEvent(hitbox, this.gameObject); if (!IsHitStunned) //If not hitstunned before { IsHitStunned = true; character.IgnoreInput(true); character.EnableAirDeceleration(false); character.UnPreventWalkOffLedge(); } hitStunFrameLeft = SmashCalculator.HitStunDuration(hitbox, this); if (character.IsTumbling) { character.StopTumbling(); } if (character.IsTumbled) { character.UnTumble(); } }