Skip to content
EvilEngine.Formats.Records

WeaponAttachments record

public sealed record WeaponAttachments

The attachments on a weapon’s models its looks come from: the muzzle its flash, tracers and sounds start at, and the port its casings leave. A weapon record’s attachments table names them, and so can each of its modes, whose own win name by name. Tracers, flashes and casings come from the view model’s attachment in first person, and from the world model’s by the same name in third person, or the hand when it has none.

attachments = { muzzle = "barrel_tip", eject = "port" }
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

WeaponAttachments constructor

public WeaponAttachments()

Makes a set naming no attachments, the same as None, for setting what you need.

None field

public static readonly WeaponAttachments None

No attachments named, what a record without an attachments table has, so the defaults are used.

DefaultMuzzle field

public const string DefaultMuzzle = "muzzle"

"muzzle", the attachment the muzzle is when Muzzle is null.

DefaultEject field

public const string DefaultEject = "eject"

"eject", the attachment casings leave from when Eject is null.

Muzzle property

public string? Muzzle { get; init; }

The muzzle attachment’s name, from muzzle, or null for DefaultMuzzle. An event’s own at wins over it. It can’t be empty.

Eject property

public string? Eject { get; init; }

The eject port attachment’s name, from eject, or null for DefaultEject. An event’s own at wins over it. It can’t be empty.

IsEmpty property

public bool IsEmpty { get; }

Whether neither attachment is named.

Over method

public WeaponAttachments Over(WeaponAttachments under)

This set over under: each name this one sets wins, and the rest come from under.