continuing to switch to MapCell orientation
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user