Skip to content
EvilEngine.Formats.Records

WeaponEffects record

public sealed record WeaponEffects

A weapon’s looks: its muzzle flash, its impact, its tracer and its spent casing, each a record by id. A weapon record’s effects table holds them, and so can each of its modes, whose own win slot by slot (Effects). Every player’s game draws them from these records, so the weapon looks the same to everyone.

effects = { muzzle = "pulse:effect/flash", tracer = "pulse:tracer/pulse", impact = "pulse:effect/hit", casing = "pulse:casing/cell" }
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

WeaponEffects constructor

public WeaponEffects()

Makes a set with no looks, the same as None, for setting what you need.

None field

public static readonly WeaponEffects None

No looks at all, what a record without an effects table has.

MuzzleSlot field

public const string MuzzleSlot = "muzzle"

"muzzle", the key and the event slot name of Muzzle.

ImpactSlot field

public const string ImpactSlot = "impact"

"impact", the key and the event slot name of Impact.

TracerSlot field

public const string TracerSlot = "tracer"

"tracer", the key of Tracer.

CasingSlot field

public const string CasingSlot = "casing"

"casing", the key and the event slot name of Casing.

Muzzle property

public ContentId? Muzzle { get; init; }

The effect record flashed at the muzzle attachment, from muzzle. null falls back on evil:effect/muzzle. A shot’s own WeaponBullets.Muzzle wins over it.

Impact property

public ContentId? Impact { get; init; }

The effect record played where a bullet or a hit lands, from impact. null falls back on the struck surface’s bullet effect, then evil:effect/impact. A shot’s own WeaponBullets.Impact wins over it.

Tracer property

public ContentId? Tracer { get; init; }

The tracer record the weapon’s tracers draw, from tracer. null draws the engine’s evil:tracer/bullet. A shot’s own WeaponBullets.Tracer wins over it.

Casing property

public ContentId? Casing { get; init; }

The casing record ejected from the eject attachment, from casing. null ejects nothing, unless IWeaponHolder.Eject names a casing of its own.

IsEmpty property

public bool IsEmpty { get; }

Whether no slot is set.

Over method

public WeaponEffects Over(WeaponEffects under)

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

Slot method

public ContentId? Slot(string slot)

The id in the slot named slot, one of MuzzleSlot, ImpactSlot, TracerSlot and CasingSlot, or null when it’s empty or the name is none of them.