Skip to content

rq.ChooseCtx ​

since 2.38.0

What rq.battle.on_choose gets on an enemy's or the familiar's turn.

Fields ​

NameTypeDescription
iicintegerThe actor's roster slot: 1 to 5 for an enemy, 10 for the familiar.
unitintegerThe actor's battle number.
side"enemy"|"familiar"Whose turn it is.
rankintegerThe enemy's rank, 1 to 5; 0 for the familiar.
turnintegerThe fight's action count (◆戦闘ターン), as rq.battle.on_turn's.
skillintegerThe skill about to be used: the game's choice, then what the callback before left. Write a skill number to change it.
target (optional)integerThe target's roster slot: the game's roll, then what the callback before left. Write a slot to change it, or nil to let the game pick. nil for a skill with no single target (all, a row, all allies); the actor for a self skill.
rolledintegerThe skill the game's draw gave, before its Standby rule.
standbybooleantrue when skill is Standby (384) because of the game's rule: a skill that reaches only the front row, from the back row, while an enemy stands in the front row.
chargedbooleantrue on the turn a skill charged the turn before is released: only target can change then.
skillsrq.ChooseSkill []The actor's list as it is now.

Functions ​

NameSummary
rq.ChooseCtx:targetsThe units a skill may aim at from this actor, by the rules on_choose checks a target with.

rq.ChooseCtx:targets ​

lua
rq.ChooseCtx:targets(skill) -> integer[]

since 2.38.0

The units a skill may aim at from this actor, by the rules on_choose checks a target with.

A unit standing on the side the skill's target kind names (the other side for melee, ranged and random targets; the actor's own for an ally skill), with no hidden ally (a hiding rate, as Stealth gives) and, for a melee skill, only the front row (ranks 1 to 3) while one stands there. The actor alone for a self skill; empty for a skill with no single target.

lua
local t = ctx:targets(FIREBALL)
if #t > 0 then ctx.skill, ctx.target = FIREBALL, t[1] end
ParameterTypeDescription
skill (optional)integerThe skill. Default: ctx.skill.
ReturnsTypeDescription
targetsinteger[]The roster slots, in rank order.

Used by ​

rq.battle.on_choose