Expand description
Native ports for the cast_ability category — ability scripts (the
CastAbility event handler, run via run_event in
logic::fighting::handle_cast_ability, returning
Vec<OverlordEvent>).
These are the combat effect of casting an ability: most call
ctx.on_cast(CasterEntity) then either launch a projectile
(Result.push(OverlordEventStartCastProjectile(...))) or apply combat
primitives (ctx.attack, ctx.spell_heal, ctx.apply_entity_effect).
§RNG
Ability scripts consume the authoritative Random (via on_cast’s
bravery throw, attack’s evasion/counterattack/deceit/crit/block throws,
and stat_throw).
§Effect callbacks
on_cast / apply_entity_effect dispatch the applied effect’s on_apply
reaction. For the shipped effects those reactions push add_entity_stat_mod
(empower/weakness/protection/vulnerability) events; the native path
must replicate them, so we pass OverlordEffectCb rather than
NoopEffectCb.
§Scope (per the handle_cast_ability run_event call site)
CasterEntity, TargetEntity, Fight, Random, AbilityLevel,
AbilitySlotLevel, CurrentTick, FightDurationTicks, and the event.
Structs§
- Cast
Ability Ctx - ability
scriptscope the shipped scripts read.
Functions§
- apply_
bloodleak_ effect - Port of the
50260b1c-...test abilityscript: RNG-free; used bytest_effects::test_effect_with_interval. - apply_
low_ hp_ heal_ effect - Port of the
41ee5532-...test abilityscript:Result.push(OverlordEventEntityApplyEffect(Event.by_entity_id, uuid("3b136901-...")));Event.by_entity_idis the caster, so the effect is applied to the caster. RNG-free; used bytest_effects::test_effect_with_subscribe. - apply_
test_ effect 01955be6-...—ctx.apply_entity_effect(CasterEntity, "test_effect", 3). Noon_cast.test_effect’son_applyisprint-only (no events).- bare_
projectile_ bat 019a0246-cf87-...— bare push projectile019a0244-aad4.- bare_
projectile_ chipmunk 019a0246-5aaf-...— bare push projectile019a0244-7a0a.- bare_
projectile_ mushroom 019a0245-ff0c-...— bare push projectile019a0244-4675.- bare_
projectile_ shot 019c00a4-...— bare push projectile019c009c.- cone_
strike 019584f4-...— cone/AoE: on_cast, roll one shared crit, then attack every enemy in a forward 3-cell x-band with{ power, is_crit }.- crit_
strike 019584aa-...— on_cast + attack { power, crit_chance_bonus * 10000.0 }.- damage_
target_ 5 - Port of the shared test ability
script(generate_ability_script):Result.push(OverlordEventDamage(TargetEntity.id, unsigned(5), CustomEventData()));RNG-free; used by the test-config gacha/class abilities. - dot_
strike 01958efd-...— on_cast + attack { dot_power: ability_info.damage } (no instant power; pure DoT application).- fireball_
cast 01958172-...— on_cast + launch projectile01966cbc.- fireball_
projectile_ cast 019dfc4c-.../019dfc4f/019dfcfb/019dfcfe/019dfd00/019dfd01/019dfd02-0c6a/019dfd02-add4— all identical: on_cast + launch projectile01966cbc. (One shared native fn; config points all eight abilityscript_nativerefs at it.)- melee_
strike 0194d64e-...— on_cast + attack { power }.- mob_
melee_ average 019cc465-14b8-...— on_cast + attack { power }.- mob_
melee_ quick 019cc464-...— on_cast + attack { power }.- mob_
melee_ slow 019cc465-2f63-...— on_cast + attack { power }.- multi_
projectile 019589e6-...— on_cast + launchability_info.projectilesprojectiles, each delayedi * 150.- register
- Register this category’s native fns.
- self_
hot_ heal 01958ed0-...— on_cast +spell_heal(caster, caster, #{ hot_power }).- strike_
then_ empower 01958a30-...— on_cast + attack { power }; if damage dealt (!= ()), applyempowerforability_info.effect_duration.- strike_
then_ vulnerability 01958ef2-...— on_cast + attack { power }; if damage dealt, applyvulnerabilityon the TARGET forability_info.effect_duration.- sword_
slash 019bff40-...— on_cast + attack { power }.- vampiric_
touch_ cast 019589f7-...— on_cast + launch projectile0196a6b4(vampiric strike).
Type Aliases§
- Cast
Ability Fn - Signature of a
cast_abilitynative fn.