ACRs

Nodes and builders

Skill, WeaponSwap, Evade, Kennel and Cancel, and the checks a node can have.

A node is one thing the rotation can do, with the checks it must pass first. Nodes are made with builders: start with Skill(id) (or another builder below) and chain methods onto it. Every method returns a new builder and leaves the old one as it was, so one builder can be the base of several nodes:

local rifle_4 = Skill(RIFLE_4):will_cancel():skill_range():facing_check()

self.root = NodeGroup()
    :push(10, rifle_4:when(function() return util.has_buff(FIRE_BUFF) end))
self.cc_group = NodeGroup()
    :push(9, rifle_4)   -- without the condition

Builders

Skill(id)builder
Casts a skill. Skill({id, id...}) makes one node per id, all with the same settings, for skills that replace each other on the bar. The skill must be on the bar.
Swaps weapons. Waits for the current cast to end; :will_not_cancel() lets it go right away. :range(r) only swaps within r of the target.
Dodges: a combat.EVADE_* direction, Evade.MOUSE (towards the mouse) or Evade.SPECIAL (the profession's special evade). Needs min_endurance endurance, 50 by default. Takes :will_not_cancel() and :range(r) like WeaponSwap.
A pet or mech order: Kennel.SKILL_1, SKILL_2, SKILL_3, ATTACK, RETURN or SWAP. With the pet skill's id, it also checks that the skill is on the pet's bar, ready and in range. Takes :insta_cast, :skill_range and :skill_radius.
Cuts the skill's cast short once it has done its work: by cancelling it (Cancel.CANCEL, the default) or by stowing weapons (Cancel.STOW). Takes :cast_time, :custom_trigger, :last_trigger_idx and :last_trigger_of_type to say when that is.

Every builder

Turns the node on and off: fn() returns a boolean, checked first. :enabled(settings, "key") reads settings.key instead, every time.
A condition that must hold. Add as many as you need; all must hold (Rust's .and).
A condition of which at least one must hold (Rust's .or).
Only when every skill in the list is on cooldown or being cast.
Runs fn(target) just before the node runs, such as util.face_target for skills that go where you face.
Prints why the node can't run, and when it runs. :dbg_condition() and :dbg_execution() print one of the two. See Debugging.
A copy. Never needed, since every method already returns one; kept for code ported from Rust.

Range and facing

Only when the target is in the skill's range, or within range units.
Counts the skill's radius (or radius units) as reach, for skills that hit around where they land.
Uses the skill's first distance value as its range, for skills whose range isn't in the range field. :skill_distance1() uses the second.
Only when the target is at least range away.
Only while facing the target, within max_angle radians (util.FACING_DEFAULT by default).
Only while the target is in your cone, angle radians wide and length long.
Only when a dash towards the mouse, width wide and length long, goes through the target.

Where to cast

Always casts at the target, even a ground-targeted skill.
Casts on the ground, at the spot kind picks (Ground.TARGET by default).
Picks where when the node runs: fn() returns an acr.Target.* or acr.Ground.*.
acr.Ground and acr.Target
Ground.TARGET
The target, or the nearest spot whose radius still reaches it.
Ground.TARGET_CENTER
Always the target's position.
Ground.ALWAYS_SELF
Always your position.
Ground.MINIMIZE_DISTANCE
The spot nearest to you that still reaches the target.
Ground.MAXIMIZE_DISTANCE
Past the target, as far as the skill reaches.
Ground.MOUSE_DIRECTION
Just in front of you, towards the mouse.
Ground.BEST_BOON
The player with the most allies within the skill's radius.
Ground.BEST_HEAL
The player with the most missing health around them.
Target.DEFAULT
The skill decides: ground-targeted skills on the ground, others at the target. A node's default.
Target.TARGET
At the target, as :targeted().

Casting

These say how a skill fits in with the cast before and after it. Most skills need none of them.

Treats the skill as an instant cast (or not, with false), whatever its definition says. Instant casts run next to the normal skill; see what runs.
An instant cast of which only the highest priority one runs each tick, instead of all of them.
Using the skill would cut the current cast short, so it waits for the cast to end.
This skill's cast mustn't be cut short: nothing else is sent until it's done.
Lands behind whatever else is queued: it's sent again a few times over the next 100 ms, and later skills wait for it.
Skips the cooldown check.
May be sent again while it's being cast. Auto attacks need it.
Turns back to the target once the cast is done, for skills cast facing elsewhere.
While this skill waits in the queue, any skill in ids may take its place. :overrideable_by_all() lets any skill.
The skill the game says you're casting when you use this one, for skills that turn into another.

When a cast is done

The engine counts a cast as done (and sends the next skill) at the end of its cast time. These move that moment:

The cast takes ms milliseconds.
The skill has done its work after ms milliseconds (two thirds of that under quickness).
The skill has done its work after count hits.
The skill has done its work at its trigger i (from 0), from combat.skill_triggers.
The skill has done its work at its last trigger of this type.