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.
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.