Loadout

Group
bank
Methods
7
Fields
None

Getting one

bank:newLoadout(…)

Methods

MethodReturnsDescription
run()(RunStatus, string?)Advance the trip one step: open the bank, answer the prompt an equip opens, deposit what the goal does not want, withdraw and equip what it…
intent()stringWhat run would do next, in words, for a log. The words are not a contract.
step()LoadoutStepThe step it is on, for a status line.
isReady()booleanWhether the player already wears and carries the goal, so no bank trip is needed. It answers with the bank shut, and counts at least the go…
isAvailable()booleanWhether the goal could be assembled from what the player has and the open bank holds. false whenever the bank is shut, whatever is rememb…
deficit(){ LoadoutRequirement }What the inventory goal still lacks or carries too much of, as rows; the bank's side read from what is remembered. It leaves out what is wo…
reset()()Forget the trip, and what blocked it, and start again towards the same goal.

Returned by

MethodReturnsDescription
Bank.newLoadoutLoadoutA bank trip towards a goal: open the bank, deposit what the goal does not want, withdraw and equip what it does. The goal is fixed here, an…

Method details

run

run: (Loadout) -> (RunStatus, string?)

Advance the trip one step: open the bank, answer the prompt an equip opens, deposit what the goal does not want, withdraw and equip what it does. Stop calling it once it answers "done": with the bank shut, a further call opens it again.

local status, reason = trip:run()
Returns
"done" when the goal is worn and carried with the bank open. "running" when it acted or is waiting. "blocked" with the reason when no bank is in range or the goal cannot be met from the bank, the inventory and what is worn: that holds until the goal is met or reset(), so fetch what it lacks and reset.

intent

intent: (Loadout) -> string

What run would do next, in words, for a log. The words are not a contract.

isReady

isReady: (Loadout) -> boolean

Whether the player already wears and carries the goal, so no bank trip is needed. It answers with the bank shut, and counts at least the goal's quantities; with the bank open it also says false while something unwanted is carried.

isAvailable

isAvailable: (Loadout) -> boolean

Whether the goal could be assembled from what the player has and the open bank holds. false whenever the bank is shut, whatever is remembered: open it first.

deficit

deficit: (Loadout) -> { LoadoutRequirement }

What the inventory goal still lacks or carries too much of, as rows; the bank's side read from what is remembered. It leaves out what is worn, and what nothing can supply.

reset

reset: (Loadout) -> ()

Forget the trip, and what blocked it, and start again towards the same goal.