fix: fixed some dash issues, there's still some
This commit is contained in:
@ -233,7 +233,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
|
||||
public void OnInputAimPressed()
|
||||
{
|
||||
GD.Print("InputAimPressed");
|
||||
_playerState.SendEvent("aim_pressed");
|
||||
}
|
||||
public void OnInputAimDown()
|
||||
@ -379,16 +378,18 @@ public partial class PlayerController : CharacterBody3D
|
||||
_timeAfterDashingTimer.Start();
|
||||
if (WeaponSystem.FlyingState.Active)
|
||||
{
|
||||
DashSystem.DashResolve = new DashResolveRecord(false, WeaponSystem.GlobalPosition, Vector3.Zero);
|
||||
DashSystem.ShouldMantle = false;
|
||||
DashSystem.PlannedPlayerLocation = WeaponSystem.GlobalPosition;
|
||||
}
|
||||
else if (WeaponSystem.PlantedState.Active)
|
||||
{
|
||||
DashSystem.ShouldMantle = false;
|
||||
// Should we try to resolve with mantle?
|
||||
var dashLocation =
|
||||
DashSystem.ComputeDashLocationForPlayerShape(WeaponSystem.PlantLocation, WeaponSystem.PlantNormal);
|
||||
DashSystem.DashResolve = new DashResolveRecord(false, dashLocation, Vector3.Zero);
|
||||
DashSystem.PlannedPlayerLocation = dashLocation;
|
||||
}
|
||||
_dashDirection = (DashSystem.DashResolve.DashLocation - GlobalPosition).Normalized();
|
||||
_dashDirection = (DashSystem.PlannedPlayerLocation - GlobalPosition).Normalized();
|
||||
DashSystem.Dash();
|
||||
}
|
||||
public void OnDashEnded()
|
||||
@ -436,12 +437,15 @@ public partial class PlayerController : CharacterBody3D
|
||||
RemoveChild(WeaponRoot);
|
||||
GetTree().GetRoot().AddChild(WeaponRoot);
|
||||
WeaponRoot.SetGlobalPosition(GlobalPosition);
|
||||
|
||||
var (hasHit, location, collisionPoint, collisionNormal) = DashSystem.DashComputation;
|
||||
var (endWithMantle, dashLocation, mantleLocation) = DashSystem.DashResolve;
|
||||
|
||||
DashSystem.CancelDash();
|
||||
WeaponSystem.ThrowWeapon(location, hasHit, collisionPoint, collisionNormal);
|
||||
|
||||
var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.TargetLocation;
|
||||
WeaponSystem.ThrowWeapon(
|
||||
weaponTargetLocation,
|
||||
DashSystem.HasHit,
|
||||
DashSystem.CollisionPoint,
|
||||
DashSystem.CollisionNormal);
|
||||
}
|
||||
public void OnAimingEntered()
|
||||
{
|
||||
|
Reference in New Issue
Block a user