Skip to main content

Aoeweapon Leap

Based on game build 714014 | Last updated: 2026-03-20

Overview

Aoeweapon_Leap is a combat component that extends AOEWeapon_Base to enable leap-based area-of-effect attacks. When triggered via DoLeap, it damages all valid entities within a radius around the target position and can toss lightweight inventory items. This component is typically attached to weapons or abilities that perform jumping attacks, working alongside the combat and weapon components to modify damage output during the leap sequence.

Usage example

local inst = CreateEntity()
inst:AddComponent("aoeweapon_leap")
inst.components.aoeweapon_leap:SetAOERadius(5)
inst.components.aoeweapon_leap:SetOnPreLeapFn(function(inst, doer, start, target)
-- Prepare leap animation
end)
inst.components.aoeweapon_leap:DoLeap(doer, start_pos, target_pos)

Dependencies & tags

Components used: aoeweapon_base (parent), combat, health, weapon Tags: Adds aoeweapon_leap to the entity instance.

Properties

PropertyTypeDefault ValueDescription
aoeradiusnumber4Radius in world units for area damage detection.
physicspaddingnumber3Additional padding added to radius for physics calculations.
onpreleapfnfunctionnilCallback function invoked before leap execution.
onleaptfnfunctionnilCallback function invoked after leap completion.
damagenumberinheritedDamage value inherited from parent class.
notagstableinheritedEntity tags to exclude from targeting.
combinedtagstableinheritedEntity tags to include for targeting.

Main functions

SetAOERadius(radius)

  • Description: Configures the area-of-effect radius for the leap attack.
  • Parameters: radius (number) - The new radius value in world units.
  • Returns: Nothing.

SetOnPreLeapFn(fn)

  • Description: Registers a callback function to execute before the leap begins.
  • Parameters: fn (function) - Function with signature (inst, doer, startingpos, targetpos).
  • Returns: Nothing.

SetOnLeaptFn(fn)

  • Description: Registers a callback function to execute after the leap completes.
  • Parameters: fn (function) - Function with signature (inst, doer, startingpos, targetpos).
  • Returns: Nothing.

DoLeap(doer, startingpos, targetpos)

  • Description: Executes the leap attack, dealing area damage to entities near the target position and tossing eligible inventory items. Temporarily disables area damage on the doer's combat component during execution.
  • Parameters:
    • doer (entity) - The entity performing the leap (must have combat component).
    • startingpos (table) - Starting position table with x, y, z fields.
    • targetpos (table) - Target landing position table with x, y, z fields.
  • Returns: true on successful execution, false if validation fails.
  • Error states: Returns false if startingpos, targetpos, or doer is nil, or if doer lacks a combat component.

Events & listeners

None identified. This component does not register any event listeners via ListenForEvent nor push custom events via PushEvent.