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

70 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using Godot;
using Godot.Bridge;
using Godot.NativeInterop;
[ScriptPath("res://Scripts/Bullets/Blank.cs")]
public partial class Blank : Node2D, IBullet
{
[Export(PropertyHint.None, "")]
private float randomRotation;
[Export(PropertyHint.None, "")]
private float rotationOverTime;
[Export(PropertyHint.None, "")]
private float easeIn;
private float easing;
[Export(PropertyHint.None, "")]
public bool grazed { get; set; }
[Export(PropertyHint.None, "")]
public int HP { get; set; } = 1;
public Node2D node { get; set; }
public Action<Node> onShot { get; set; }
public AnimationPlayer anim { get; set; }
public BulletGenerator generatedFrom { get; set; }
[Export(PropertyHint.None, "")]
public IBullet.Type type { get; set; }
public override void _Ready()
{
if (randomRotation > 0f)
{
base.RotationDegrees = Main.RandomRange(0f, randomRotation);
}
node = this;
if (easeIn == 0f)
{
easing = 1f;
easeIn = 1f;
}
}
public override void _Process(double delta)
{
if (rotationOverTime != 0f)
{
base.RotationDegrees += rotationOverTime * Main.deltaTime * easing / easeIn;
}
if (easing < easeIn)
{
easing += Main.deltaTime;
}
}
public void ShotAt()
{
}
}