Module cast_projectile

Source
Expand description

Native ports for the cast_projectile category — projectile scripts (the CastProjectile event handler, run via run_event in logic::fighting::handle_cast_projectile, returning Vec<OverlordEvent>).

Every shipped projectile script is ctx.attack(CasterEntity, TargetEntity, #{ ... }) with a per-projectile param map, resolved from a sibling ability’s get_ability_info(<ability_id>, ProjectileLevel):

  • plain damage: #{ power: ability_info.damage }
  • DoT split: #{ power: ability_info.damage, dot_power: ability_info.dot }
  • vampiric: attack{power}, then if (damage > 0) heal_entity(caster, damage * vampiric)
  • counterattack: #{ power: balance::COUNTERATTACK_POWER, no_counterattack: true }

§RNG

attack consumes the authoritative Random (evasion / counterattack / deceit / crit / block throws).

§Scope

CasterEntity, TargetEntity, Fight, Random, ProjectileLevel, CustomEventData, CurrentTick, FightDurationTicks, the event.

Structs§

CastProjectileCtx
Inputs available to a cast_projectile native fn.

Functions§

arcane_missiles_attack
0196a6b3-...attack(#{ power }), info from ability 019589e6.
attack_power_dot
01966cbc-...attack(#{ power: damage, dot_power: dot }), info from ability 01958172.
attack_vampiric
0196a6b4-... — vampiric: attack(#{ power }); if damage dealt (> 0 in
bat_attack
019a0244-aad4-...attack(#{ power }), info from ability 019a0246-cf87.
chipmunk_attack
019a0244-7a0a-...attack(#{ power }), info from ability 019a0246-5aaf.
counterattack
019aeeed-... — counterattack: attack(#{ power: COUNTERATTACK_POWER, no_counterattack: true }). No get_ability_info.
damage_target_5
Port of the test projectile script Result.push(OverlordEventDamage(TargetEntity.id, unsigned(5), CustomEventData())); — raw 5 damage to the target. RNG-free; used by test_fighting_abilities.
mushroom_attack
019a0244-4675-...attack(#{ power }), info from ability 019a0245.
pet_night_pounce_attack
79f90288-... — pet Night Pounce delivery: attack(#{ power, crit_chance_bonus }), info from ability 019584aa (the Strike the pet ult clones). Same math as the instant ability_crit_strike, moved onto a projectile so the cast is readable in combat.
pet_odd_flame_attack
432f231c-... — pet Odd Flame delivery: attack(#{ dot_power }), info from ability 01958efd (the Immolate the pet ult clones). Same math as the instant ability_dot_strike, moved onto a projectile.
pet_rust_wave_attack
1ce4597d-... — pet Rust Wave delivery: one shared crit throw, then attack every enemy in the caster’s forward 3-cell x-band with { power, is_crit }, info from ability 019584f4 (the Nova the pet ult clones). Same math as the instant ability_cone_strike; the cone resolves on projectile arrival.
register
Register this category’s native fns.
shot_attack
019c009c-...attack(#{ power }), info from ability 019c00a4.

Type Aliases§

CastProjectileFn
Signature of a cast_projectile native fn.