Class CombatTap

Namespace
SurvivorsMaker.Presentation
Assembly
SurvivorsMaker.Presentation.dll

Read-only wrapper around the run's ICombat: forwards every call unchanged (same order, same random numbers) and reports the damage actually applied to a CombatLedger, attributed to the weapon from HitSource or the hit's slot. Player damage is split into contact and enemy projectiles.

public sealed class CombatTap : ICombat
Inheritance
CombatTap
Implements
Inherited Members

Constructors

CombatTap(ICombat)

public CombatTap(ICombat inner)

Parameters

inner ICombat

Properties

Inner

public ICombat Inner { get; }

Property Value

ICombat

Ledger

Where damage goes. Null = pass-through only.

public CombatLedger Ledger { get; set; }

Property Value

CombatLedger

WeaponIdOf

Weapon definition → owned item id (for display names). Null = Id.

public Func<WeaponDef, string> WeaponIdOf { get; set; }

Property Value

Func<WeaponDef, string>

Methods

AfterTick(SimWorld)

After a tick: learns the enemies that appeared, so damage from a dead shooter's projectile keeps its source.

public void AfterTick(SimWorld world)

Parameters

world SimWorld

BeginWave(SimWorld)

Forgets entity ids of the previous wave and learns the enemies already present.

public void BeginWave(SimWorld world)

Parameters

world SimWorld

DamageEnemy(SimWorld, Enemy, int, SimEventKind)

Damage that is not a weapon hit (status ticks, explosions, chains, trigger effects): applies damage (elite armor and boss invulnerability included) and emits kind (EnemyDamaged or StatusDamage). No on-hit heal, knockback, hit effects or OnHit triggers. HitSource is set by the caller when a weapon is behind it.

public void DamageEnemy(SimWorld world, Enemy target, int damage, SimEventKind kind)

Parameters

world SimWorld
target Enemy
damage int
kind SimEventKind

EnemyIdOf(int)

Enemy definition id of an entity id seen this wave, or "".

public string EnemyIdOf(int entityId)

Parameters

entityId int

Returns

string

HealPlayer(SimWorld, int)

Heals a living player up to max health. Returns the amount healed.

public int HealPlayer(SimWorld world, int amount)

Parameters

world SimWorld
amount int

Returns

int

HitEnemy(SimWorld, Enemy, int, bool, int, Vec2, float)

A weapon hit: applies damage, emits EnemyDamaged, rolls on-hit heal, applies knockback in knockbackDirection. Death is collected later in the tick.

public void HitEnemy(SimWorld world, Enemy target, int damage, bool crit, int slot, Vec2 knockbackDirection, float knockback)

Parameters

world SimWorld
target Enemy
damage int
crit bool
slot int
knockbackDirection Vec2
knockback float

HitPlayer(SimWorld, int, int)

Contact or enemy projectile: dodge roll, armor, damage, events. Raw ≤ 0 does nothing.

public void HitPlayer(SimWorld world, int rawDamage, int sourceId)

Parameters

world SimWorld
rawDamage int
sourceId int