Namespace in reactor_fight_tactical.js

AI

8 functions in 3 groups · hide internal

A Tactical battle on a 2D map.

Quick Reference

Getting Information 1

at() Where a unit stands, for the AI: its character, or null when it has none (fallen and faded, removed).

Actions 2

begin() Begin.
forget() The next think starts over (the field changed under the plan).

Other 5

turncoats() Turncoats.
scoreCell() Weigh one cell: every action the unit has, from there.
approach() With nothing to use from anywhere in reach: the way toward the fight (a healer toward whoever is hurt most).
prune() A think lasts several frames, and the battle goes on between them: a unit that fell just before fades and is…
think() Think.

Getting Information

at

static source
AI.at(fight, unit)

Where a unit stands, for the AI: its character, or null when it has none (fallen and faded, removed).

Details

Where a unit stands, for the AI: its character, or null when it has none (fallen and faded, removed). Every use checks.

Actions

begin

static source
AI.begin(fight, unit, character, battler)

Begin.

forget

static source
AI.forget()

The next think starts over (the field changed under the plan).

Other

turncoats

static source
AI.turncoats(fight)

Turncoats.

scoreCell

static source
AI.scoreCell(fight, unit, index, deadline)

Weigh one cell: every action the unit has, from there.

Details

Weigh one cell: every action the unit has, from there. With a deadline (a clock time) a cell with many actions is weighed an action at a time: false comes back when the clock ran out with actions still to weigh, and the same call goes on with the next. Without one the whole cell is weighed. Returns true when it is done.

approach

static source
AI.approach(fight, unit, character, deadline)

With nothing to use from anywhere in reach: the way toward the fight (a healer toward whoever is hurt most).

prune

static source
AI.prune(fight)

A think lasts several frames, and the battle goes on between them: a unit that fell just before fades and is erased, one may be removed.

Details

A think lasts several frames, and the battle goes on between them: a unit that fell just before fades and is erased, one may be removed. Each time the think resumes, everyone who has no place on the map any more leaves the pools (with what was kept beside them), so nothing below meets a unit without a character.

think

static source
AI.think(fight, unit, character)

Think.