continuing to switch to MapCell orientation

This commit is contained in:
2026-07-03 02:16:29 -04:00
parent e6355167e3
commit 336b72e4cb
13 changed files with 81 additions and 82 deletions
+5 -8
View File
@@ -16,25 +16,22 @@ public partial class ThrustSpear : PegAction
public override Tween CreateAnimation(Peg PEG)
{
GD.Print(Name);
Map map = PEG._pegController._playArea._map;
Peg pegTarget = map._addressOccupants[Target(PEG)];
Vector2 target = pegTarget.GlobalPosition;
MapCell target = Target(PEG);
Tween subtween = CreateTween();
subtween.TweenProperty(_image, "visible", true, 0.0f);
subtween.TweenProperty(_image, "rotation", PEG.GetAngleTo(target), 0.0f);
subtween.TweenProperty(_image, "global_position", target, 0.5f);
subtween.TweenProperty(_image, "rotation", PEG.GetAngleTo(target.GlobalPosition), 0.0f);
subtween.TweenProperty(_image, "global_position", target.GlobalPosition, 0.5f);
subtween.TweenCallback(Callable.From(() =>
{
pegTarget.ChangeHealth(-1);
((Peg)target._occupant).ChangeHealth(-1);
_image.Position = Vector2.Zero;
_image.Visible = false;
}));
return subtween;
}
public override Vector2I Target(Peg PEG)
public override MapCell Target(Peg PEG)
{
return PEG.Goal();
}