107 lines
1.9 KiB
C#
107 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using Godot;
|
|
using Godot.Bridge;
|
|
using Godot.NativeInterop;
|
|
|
|
[ScriptPath("res://Scripts/Battle/BulletBoards.cs")]
|
|
public partial class BulletBoards : Node2D
|
|
{
|
|
public enum SoulType
|
|
{
|
|
Current = -1,
|
|
Yellow,
|
|
Blue,
|
|
Shoot
|
|
}
|
|
|
|
public enum Target
|
|
{
|
|
OnlyOne,
|
|
RandomAll,
|
|
All
|
|
}
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public float damageMult = 1f;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public int id;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public bool cantKill;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public bool noReparent;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public bool special;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public bool flipRandomly;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public float timer = 300f;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public float randomRotation;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public float growTime = 20f;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public Target target;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public SoulType soulType = SoulType.Current;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public float[] data;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public Vector2 boardSize = new Vector2(80f, 80f);
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public Vector2 soulStartOffset;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
public Vector2 boardStartOffset;
|
|
|
|
public int[] targeted;
|
|
|
|
public Battlers caller;
|
|
|
|
private bool first;
|
|
|
|
private List<IBullet> bullets = new List<IBullet>();
|
|
|
|
public override void _EnterTree()
|
|
{
|
|
base.Visible = true;
|
|
base.ZIndex = 4096;
|
|
base.RotationDegrees = Main.RandomRange(0f, randomRotation);
|
|
foreach (Node child in GetChildren())
|
|
{
|
|
if (child is IBullet item)
|
|
{
|
|
bullets.Add(item);
|
|
}
|
|
}
|
|
if (flipRandomly && Main.RandomRange(0, 100) < 50)
|
|
{
|
|
base.Scale = new Vector2(-1f, 1f);
|
|
}
|
|
}
|
|
|
|
public static void UpdateCenter()
|
|
{
|
|
DWMenu.instance.bulletBoard.PivotOffset = DWMenu.instance.bulletBoard.Size / 2f;
|
|
}
|
|
|
|
public void End()
|
|
{
|
|
timer = 0f;
|
|
}
|
|
|
|
}
|