cirnogodot/Scripts/Components/BulletInfo.cs

52 lines
No EOL
2 KiB
C#

using System.Collections.Generic;
using Cirno.Scripts.Actors._3D;
using Cirno.Scripts.Resources;
using Cirno.Scripts.Utils;
using Godot;
namespace Cirno.Scripts.Components;
public class BulletInfo(BulletResource originalBulletResource)
{
public BulletResource OriginalBulletResource { get; set; } = originalBulletResource;
public Vector2 Position { get; set; }
public Vector2 Direction { get; set; }
public float Speed { get; set; }
public float LifeTime { get; set; }
public bool DestroyOnCollision => Attributes.HasNoFlags(BulletFlags.Piercing);
public BulletOwner Owner { get; set; }
public DamageType DamageType { get; set; }
public float Damage { get; set; }
public float Knockback { get; set; }
public int BulletCount { get; set; }
public float RotationSpeed { get; set; }
public float RotationOffset { get; set; }
//public double Time { get; set; }
public float Spread { get; set; }
public bool RotateSprite => Attributes.HasFlag(BulletFlags.Rotateable);
public bool Controllabe => Attributes.HasFlag(BulletFlags.Controllable);
public bool Freezable => Attributes.HasFlag(BulletFlags.Freezable);
public PackedScene BulletScene { get; set; }
public PackedScene DestructionParticlesScene { get; set; }
public IBulletModifier Modifier { get; set; }
public List<TimeModifier> TimeModifiers { get; set; } = new List<TimeModifier>();
public bool Grazeable => Attributes.HasFlag(BulletFlags.Grazeable);
public float GrazeValue { get; set; }
public BulletFlags Attributes { get; set; }
#region Laser
public bool IsLaser { get; set; }
public LaserConfig LaserConfig { get; set; } // For 3D lasers
// 2D Laser properties (legacy support)
public float SpawnDelay { get; set; } = 0.3f;
public float PreFireTime { get; set; } = 0.5f;
public float LethalTime { get; set; } = 1.5f;
public Color PreFireColor { get; set; } = new Color(1, 0, 0, 0.5f);
public Color LethalColor { get; set; } = new Color(1, 0, 0, 1.0f);
#endregion
}