minor change for testing, still a bunch to do. someh=thing that popped up, should hostile and friendly pegs go at the same time or staggered

This commit is contained in:
2026-07-02 03:51:22 -04:00
parent cbdca6f3cb
commit 0231c9d136
4 changed files with 15 additions and 6 deletions
+6 -4
View File
@@ -8,7 +8,7 @@ public partial class ThrustSpear : PegAction
base._Ready();
_category = "attack";
_priority = 1;
_cost = 2;
_cost = 1;
_range = 1;
_usesMax = 1;
_usesRemaining = _usesMax;
@@ -16,16 +16,18 @@ 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;
Tween subtween = CreateTween();
subtween.TweenProperty(_image, "visible", true, 0.0f);
subtween.TweenProperty(_image, "rotation", PEG.GetAngleTo(pegTarget.GlobalPosition), 0.0f);
subtween.TweenProperty(_image, "position", pegTarget, 0.5f);
subtween.TweenProperty(_image, "rotation", PEG.GetAngleTo(target), 0.0f);
subtween.TweenProperty(_image, "global_position", target, 0.5f);
subtween.TweenCallback(Callable.From(() =>
{
pegTarget.ChangeHealth(-2);
pegTarget.ChangeHealth(-1);
_image.Position = Vector2.Zero;
_image.Visible = false;
}));