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 conditionBuilders
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.WeaponSwap()builder
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.Kennel(order [, skill_id])builder
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.Cancel(skill_id [, kind])builder
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
builder:enabled(fn)builder
Turns the node on and off:
fn() returns a boolean, checked first. :enabled(settings, "key") reads settings.key instead, every time.builder:when(fn)builder
A condition that must hold. Add as many as you need; all must hold (Rust's
.and).builder:when_any(fn)builder
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.
builder:pre_execute(fn)builder
Runs
fn(target) just before the node runs, such as util.face_target for skills that go where you face.builder:dbg()builder
Prints why the node can't run, and when it runs.
:dbg_condition() and :dbg_execution() print one of the two. See Debugging.builder:clone()builder
A copy. Never needed, since every method already returns one; kept for code ported from Rust.
Range and facing
builder:skill_range([range])builder
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.builder:skill_distance0()builder
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.builder:min_range(range)builder
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
builder:targeted()builder
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.TARGETThe target, or the nearest spot whose radius still reaches it.
Ground.TARGET_CENTERAlways the target's position.
Ground.ALWAYS_SELFAlways your position.
Ground.MINIMIZE_DISTANCEThe spot nearest to you that still reaches the target.
Ground.MAXIMIZE_DISTANCEPast the target, as far as the skill reaches.
Ground.MOUSE_DIRECTIONJust in front of you, towards the mouse.
Ground.BEST_BOONThe player with the most allies within the skill's radius.
Ground.BEST_HEALThe player with the most missing health around them.
Target.DEFAULTThe skill decides: ground-targeted skills on the ground, others at the target. A node's default.
Target.TARGETAt 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.
builder:insta_cast([value])builder
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.builder:single_insta_cast()builder
An instant cast of which only the highest priority one runs each tick, instead of all of them.
builder:will_cancel()builder
Using the skill would cut the current cast short, so it waits for the cast to end.
builder:cannot_cancel()builder
This skill's cast mustn't be cut short: nothing else is sent until it's done.
builder:queue_after()builder
Lands behind whatever else is queued: it's sent again a few times over the next 100 ms, and later skills wait for it.
builder:no_ready_check()builder
Skips the cooldown check.
builder:no_casting_check()builder
May be sent again while it's being cast. Auto attacks need it.
builder:post_face()builder
Turns back to the target once the cast is done, for skills cast facing elsewhere.
builder:overrideable_by(ids)builder
While this skill waits in the queue, any skill in
ids may take its place. :overrideable_by_all() lets any skill.builder:actual_skill_id(id)builder
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:
builder:cast_time(ms)builder
The cast takes
ms milliseconds.builder:custom_trigger(ms)builder
The skill has done its work after
ms milliseconds (two thirds of that under quickness).builder:hits(count)builder
The skill has done its work after
count hits.builder:last_trigger_idx(i)builder
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.