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
innerICombat
Properties
Inner
public ICombat Inner { get; }
Property Value
Ledger
Where damage goes. Null = pass-through only.
public CombatLedger Ledger { get; set; }
Property Value
WeaponIdOf
Weapon definition → owned item id (for display names). Null = Id.
public Func<WeaponDef, string> WeaponIdOf { get; set; }
Property Value
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
worldSimWorld
BeginWave(SimWorld)
Forgets entity ids of the previous wave and learns the enemies already present.
public void BeginWave(SimWorld world)
Parameters
worldSimWorld
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
worldSimWorldtargetEnemydamageintkindSimEventKind
EnemyIdOf(int)
Enemy definition id of an entity id seen this wave, or "".
public string EnemyIdOf(int entityId)
Parameters
entityIdint
Returns
HealPlayer(SimWorld, int)
Heals a living player up to max health. Returns the amount healed.
public int HealPlayer(SimWorld world, int amount)
Parameters
Returns
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
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)