# WeaponEffects record

> 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.

Namespace `EvilEngine.Formats.Records`, assembly `EvilEngine.Formats`. Engine commit 4ff877b1.

```csharp
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](/docs/plugins/weapons#effects)). Every player's game draws them from these records, so the weapon looks the same to everyone.

```toml
effects = { muzzle = "pulse:effect/flash", tracer = "pulse:tracer/pulse", impact = "pulse:effect/hit", casing = "pulse:casing/cell" }
```

## Members

### WeaponEffects (constructor)

```csharp
public WeaponEffects()
```

Makes a set with no looks, the same as [None](#none), for setting what you need.

### None (field)

```csharp
public static readonly WeaponEffects None
```

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

### MuzzleSlot (field)

```csharp
public const string MuzzleSlot = "muzzle"
```

`"muzzle"`, the key and the event slot name of [Muzzle](#muzzle).

### ImpactSlot (field)

```csharp
public const string ImpactSlot = "impact"
```

`"impact"`, the key and the event slot name of [Impact](#impact).

### TracerSlot (field)

```csharp
public const string TracerSlot = "tracer"
```

`"tracer"`, the key of [Tracer](#tracer).

### CasingSlot (field)

```csharp
public const string CasingSlot = "casing"
```

`"casing"`, the key and the event slot name of [Casing](#casing).

### Muzzle (property)

```csharp
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](/docs/api/weaponbullets#muzzle) wins over it.

### Impact (property)

```csharp
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](/docs/api/weaponbullets#impact) wins over it.

### Tracer (property)

```csharp
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](/docs/api/weaponbullets#tracer) wins over it.

### Casing (property)

```csharp
public ContentId? Casing { get; init; }
```

The `casing` record ejected from the eject attachment, from `casing`. `null` ejects nothing, unless [IWeaponHolder.Eject](/docs/api/iweaponholder#eject) names a casing of its own.

### IsEmpty (property)

```csharp
public bool IsEmpty { get; }
```

Whether no slot is set.

### Over (method)

```csharp
public WeaponEffects Over(WeaponEffects under)
```

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

### Slot (method)

```csharp
public ContentId? Slot(string slot)
```

The id in the slot named `slot`, one of [MuzzleSlot](#muzzleslot), [ImpactSlot](#impactslot), [TracerSlot](#tracerslot) and [CasingSlot](#casingslot), or `null` when it's empty or the name is none of them.
