Interface IDamageHook
- Namespace
- TDMaker.Core
- Assembly
- TDMaker.Core.dll
Damage hooks run in registration order. Implementations must not allocate or recursively request damage in BeforeDamage.
public interface IDamageHook
Examples
public void BeforeDamage(Simulation sim, ref DamageContext hit) { hit.Amount *= 0.8f; }
Methods
AfterDamage(Simulation, in DamageResult)
Observes each accepted request after resolution, even when it applied zero damage.
void AfterDamage(Simulation simulation, in DamageResult result)
Parameters
simulationSimulationresultDamageResult
BeforeDamage(Simulation, ref DamageContext)
Adjusts or cancels a request immediately before it enters the FIFO.
void BeforeDamage(Simulation simulation, ref DamageContext request)
Parameters
simulationSimulationrequestDamageContext