2025-05-13 19:22:01 +08:00

55 lines
1.0 KiB
C#

using System.Collections.Generic;
using System.ComponentModel;
using Godot;
using Godot.Bridge;
using Godot.NativeInterop;
[ScriptPath("res://Scripts/Bullets/GearDuo.cs")]
public partial class GearDuo : Control
{
[Export(PropertyHint.None, "")]
private Node2D warning;
[Export(PropertyHint.None, "")]
private Node2D gearObj;
[Export(PropertyHint.None, "")]
private AnimationPlayer gearAnim;
[Export(PropertyHint.None, "")]
private float time = 25f;
private float cd;
public override void _EnterTree()
{
base.Size = new Vector2(BattleDR.current.activeBoard.boardSize.X - 6f, BattleDR.current.activeBoard.boardSize.Y - 6f);
base.Position = base.Size / -2f;
}
public override void _Process(double delta)
{
if (cd > 0f)
{
cd -= Main.deltaTime;
}
else if (cd > -50f)
{
cd = -100f;
gearObj.GlobalPosition = new Vector2(gearObj.GlobalPosition.X, BattleDR.current.soul.GlobalPosition.Y);
gearAnim.Play("Gear");
}
}
public void ResetTimer()
{
cd = time;
}
public void Shake()
{
CameraController.Shake(10f);
}
}