Weapons/WeaponData.cs
[GameResource( "Weapon", "weapon", "FP4 Weapon Statistics", Icon = "sports_kabaddi", IconBgColor = "#3a2a5a", IconFgColor = "#c0aaff" )]
public partial class WeaponData : GameResource
{
[Category( "General" )]
public string WeaponName { get; set; } = "Unnamed Weapon";
[Category( "General" )]
public WeaponSlot Slot { get; set; } = WeaponSlot.Primary;
[Category( "General" )]
public FiringMode Mode { get; set; } = FiringMode.Hitscan;
// ── Hitscan stats ────────────────────────────────────────────────────────
[Category( "Damage" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public float BaseDamage { get; set; } = 10f;
[Category( "Firing" )]
public float FireDelay { get; set; } = 0.1f;
[Category( "Firing" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public float BulletRange { get; set; } = 5000f;
[Category( "Firing" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public int BulletCount { get; set; } = 1;
[Category( "Firing" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public float BulletSpread { get; set; } = 0f;
[Category( "Firing" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public float BulletForce { get; set; } = 1f;
[Category( "Firing" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public float BulletSize { get; set; } = 2f;
[Category( "Firing" ), ResourceType( "prefab" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public string ProjectilePrefab { get; set; }
[Category( "Firing" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public bool DisableBulletImpacts { get; set; } = false;
// ── Visuals ──────────────────────────────────────────────────────────────
[Category( "Visuals" ), ResourceType( "prefab" )]
public string MuzzleFlashPrefab { get; set; }
// ── Hitscan visuals ──────────────────────────────────────────────────────
[Category( "Hitscan Visuals" ), ResourceType( "prefab" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public string ShootEffectPrefab { get; set; }
[Category( "Hitscan Visuals" ), ResourceType( "prefab" ), ShowIf( nameof(Mode), FiringMode.Hitscan )]
public string ImpactEffectPrefab { get; set; }
[Hide]
public bool HasShootEffect => !string.IsNullOrEmpty( ShootEffectPrefab );
[Category( "Hitscan Visuals" ), ShowIf( nameof(Mode), FiringMode.Hitscan ), HideIf( nameof(HasShootEffect), true )]
public Color TracerColor { get; set; } = Color.Yellow;
[Category( "Hitscan Visuals" ), ShowIf( nameof(Mode), FiringMode.Hitscan ), HideIf( nameof(HasShootEffect), true )]
public float TracerSpeed { get; set; } = 8000f;
[Category( "Hitscan Visuals" ), ShowIf( nameof(Mode), FiringMode.Hitscan ), HideIf( nameof(HasShootEffect), true )]
public float TracerLength { get; set; } = 300f;
[Category( "Sounds" ), ResourceType( "sound" )]
public SoundEvent FireSound { get; set; }
[Category( "Sounds" )]
public bool FireSoundLoop { get; set; } = false;
[Category( "Sounds" ), HideIf( nameof(FireSoundLoop), true )]
public bool FireSoundOnlyOnStart { get; set; } = false;
[Category( "Sounds" ), ResourceType( "sound" )]
public string ActivateSound { get; set; }
[Category( "Sounds" ), ResourceType( "sound" )]
public string DryFireSound { get; set; }
// ── Projectile stats ─────────────────────────────────────────────────────
[Category( "Projectile" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public float ExplosionDamage { get; set; } = 100f;
[Category( "Projectile" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public float ExplosionRadius { get; set; } = 512f;
[Category( "Projectile" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public float InitialForceForward { get; set; } = 3000f;
[Category( "Projectile" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public float InitialForceUp { get; set; } = 0f;
[Category( "Projectile" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public float Lifetime { get; set; } = 5f;
// ── Projectile visuals ───────────────────────────────────────────────────
[Category( "Projectile Visuals" ), ResourceType( "sound" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public string ProjectileActiveSound { get; set; }
[Category( "Projectile Visuals" ), ResourceType( "vpcf" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public string ExplosionParticle { get; set; }
[Category( "Projectile Visuals" ), ResourceType( "sound" ), ShowIf( nameof(Mode), FiringMode.Projectile )]
public string ExplosionSound { get; set; }
public enum WeaponSlot
{
Primary,
Secondary
}
public enum FiringMode
{
Hitscan,
Projectile
}
}