Vixen
c7401864
csharp
public record class WeaponDefinition

A weapon, as a designer wrote it.

Read the guide page for this →

Remarks

Doc 28 § Shooting: hitscan and projectile weapons, spread and recoil patterns, ammunition and reload state, penetration and falloff. What a hit does is Vixen.Gameplay.Combat's damage pipeline, because a headshot is a Crit-stage rule and armour is a Mitigate one.

Fields and properties (18)

  • public string DisplayName

    What it is called in the UI.

  • public WeaponKind Kind

    How its shot reaches what it hits.

  • public DamageDefinition? Damage

    What one pellet does.

  • public int Pellets

    How many pellets one shot fires. One is a rifle; eight is a shotgun.

  • public float RoundsPerSecond

    How many shots a second.

  • public bool Automatic

    Whether holding the trigger keeps firing.

  • public int Burst

    How many shots one trigger pull fires. Zero or one is not a burst.

  • public float Range

    How far a shot reaches at all, in metres.

  • public float ProjectileSpeed

    How fast a projectile travels, in metres per second. Ignored by a hitscan.

  • public int Magazine

    How many rounds a magazine holds.

  • public int Reserve

    How many rounds are carried beyond the magazine. Zero is unlimited.

  • public float ReloadTime

    How long a reload takes, in seconds.

  • public bool ReloadsPerRound

    Whether a reload puts rounds in one at a time, so it can be cut short.

  • public FalloffDefinition? Falloff

    How much it loses over distance, or null for none.

  • public SpreadDefinition? Spread

    How wide it goes, or null for perfectly accurate.

  • public RecoilDefinition? Recoil

    How it climbs, or null for none.

  • public PenetrationDefinition? Penetration

    How far it carries on, or null to stop at the first thing.

  • public List<string> Tags

    What this weapon is — Weapon.Rifle.Assault.

Methods (1)

  • public override void CollectTags(ICollection<string> tags)

    Every tag this definition mentions, so the content build can bake the tag table.

Used by (9)

  • ContentVixen.Gameplay.Shooting.Tests
  • ShootingModuleVixen.Gameplay.Shooting
  • TypeRegistrationVixen.Gameplay.Shooting
  • Vixen_Gameplay_Shooting_WeaponDefinitionSerializerVixen.Gameplay.Shooting
  • WeaponLibraryVixen.Gameplay.Shooting
  • WeaponLibraryTestsVixen.Gameplay.Shooting.Tests
  • WeaponStateVixen.Gameplay.Shooting
  • WeaponStateTestsVixen.Gameplay.Shooting.Tests
  • WeaponTemplateVixen.Gameplay.Shooting