cirnogodot/Scripts/Components/BulletInfo.cs
2025-09-24 16:51:47 +02:00

48 lines
No EOL
2 KiB
C#

using System.Collections.Generic;
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 float SpawnDelay { get; set; } = 0.3f; // Delay before beam appears
public float PreFireTime { get; set; } = 0.5f; // Time before laser becomes lethal
public float LethalTime { get; set; } = 1.5f; // Time laser remains lethal
public Color PreFireColor { get; set; } = new Color(1, 0, 0, 0.5f); // Thin red beam
public Color LethalColor { get; set; } = new Color(1, 0, 0, 1.0f); // Thicker beam
#endregion
}