answer
Answers the game's current question or popup by submitting a choice, such as an item name, button number, or accept/refuse, and returns the outcome and whatever gate comes next.
Instructions
Answer what the game is asking: choice is the item's name (a TECH_, UNIT_, BUILDING_, POLICY_, PROMOTION_, BELIEF_ or goody name; liberate / annex / puppet / raze; a dig's choice number), a popup's or leader screen's button number, or on a leader screen accept / refuse (a deal on the table), leave (close it), accept_friendship. args carries the rest the popup needs (a promotion's unit_id, a dig's x and y, a stolen tech's player_id, a religion's beliefs and city). Dispatches on the gate: question() shows which question is up. Returns {ok, ...} with the popup's outcome and the gate that follows (still_pending and next when another leader waits), or {ok: false, err, choices}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | what the popup needs beyond the choice: unit_id, x and y, player_id, beliefs, city | |
| choice | Yes | the `answers` row's choice: an item name, a button number, or accept / refuse / leave / accept_friendship | |
| action_id | No | a token of my choosing: a retry with the same action_id replays the stored result |