Module effect_cb

Source
Expand description

script ports (behaviors::cast_ability / cast_projectile).

ones push add_entity_stat_mod(owner, stat, value), which the engine lowers to add_entity_attr(owner, "{stat}.mod", value) → an EntityIncrAttribute those reactions here, keyed by effect code (stable across ids):

codeon_apply
empoweradd_entity_stat_mod(attack, +5000)
weaknessadd_entity_stat_mod(attack, -5000)
protectionadd_entity_stat_mod(received_damage, -5000)
vulnerabilityadd_entity_stat_mod(received_damage, +5000)
test_effect / stun / shieldprint(...) — no events
(others)no on_apply at all — no events

on_change is only dispatched by remove_entity_effect (with new_stacks = 0, old_stacks = current). That path is currently reached from a behaviors native script — so the native on_change is, in practice, not exercised today. It is nonetheless ported faithfully below (rather than left a no-op) so that any future native caller stays

|—————|——————————————————| | empower | add_entity_stat_mod(attack, (new-old)*500) | | weakness | add_entity_stat_mod(attack, (new-old)*-500) | | vulnerability| add_entity_stat_mod(received_damage, (new-old)*500)| | protection | add_entity_stat_mod(received_damage, -5000) (flat) | | (others) | no on_change — no events |

If a new effect with an event-producing reaction ships, extend the matches below.

Structs§

OverlordEffectCb
Native effect-callback dispatcher keyed by effect code. Stateless.