Class CombatRules

Namespace
SurvivorsMaker.Simulation
Assembly
SurvivorsMaker.Simulation.dll

Shared hit rules. Death collection belongs to the end of the tick.

public sealed class CombatRules : ICombat
Inheritance
CombatRules
Implements
Inherited Members

Constructors

CombatRules()

public CombatRules()

Methods

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

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