dao::tactics
Declared in dao/Tactics.h.
Classes
| Class | |
|---|---|
| Condition | A condition the screen offers, with the follower it names for one per follower. |
| Slot | A slot of a follower’s tactics, as the screen shows it. |
| Target | A target the screen offers, with the follower it names for a “Follower” target. |
Enumerations
Refusal
enum class Refusal : std::uint8_t
Why a slot was not set, or None if it was.
| Value | |
|---|---|
None |
|
NotFollower |
the creature has no tactics |
NoSuchSlot |
the slot is not one of its |
NotOffered |
the screen offers no such target, condition, command, ability, item or jump there |
Functions
Abilities()
std::vector<std::int32_t> Abilities(ObjectId creature, std::int32_t target, std::int32_t baseCondition)
AiOn()
std::optional<bool> AiOn(ObjectId creature)
Returns whether a follower’s AI runs its tactics, as the screen’s switch shows it.
BaseConditions()
std::vector<std::int32_t> BaseConditions(std::int32_t target)
BaseOf()
std::int32_t BaseOf(std::int32_t condition)
Returns a condition’s base, the group the screen lists it under.
Commands()
std::vector<std::int32_t> Commands(ObjectId creature, std::int32_t target, std::int32_t baseCondition)
Conditions()
std::vector<Condition> Conditions(std::int32_t baseCondition, std::int32_t target)
Items()
std::vector<ObjectId> Items(std::int32_t target)
LoadPreset()
bool LoadPreset(ObjectId creature, std::int32_t type, std::int32_t index)
Loads a preset into a follower’s slots, as the screen’s preset picker does.
| Parameter | |
|---|---|
type |
0 the AI off, 1 a custom slot, 2 a preset of the game’s |
index |
the custom slot or the place among the presets, from 0 |
ModalAbilities()
std::vector<std::int32_t> ModalAbilities(ObjectId creature)
SavePreset()
bool SavePreset(ObjectId creature, std::int32_t slot)
Saves a follower’s slots into a custom slot, as the screen’s Save does.
SetAiOn()
bool SetAiOn(ObjectId creature, bool on)
Switches a follower’s AI on or off, as the screen’s switch does.
SetBehaviour()
bool SetBehaviour(ObjectId creature, std::int32_t behaviour)
Sets a follower’s behaviour, a row of the aibehaviors table, as the screen’s picker does.
SetCommand()
Refusal SetCommand(ObjectId creature, std::int32_t slot, std::int32_t command, std::int32_t parameter=0, ObjectId item=kInvalidObject)
Sets a slot’s command as the screen’s action picker does, with its ability, its sustained ability, the slot to jump to, or (for kUseItem) its item.
Command 0 is the picker’s Clear. Refused NotOffered for a slot with no target, whose action the screen disables.
SetCondition()
Refusal SetCondition(ObjectId creature, std::int32_t slot, Target target, Condition condition)
Sets a slot’s target and condition as the screen’s condition picker does, the engine then checking the command against them.
Target and condition 0 are the picker’s Clear, which leaves the command: to empty a slot as the screen does, clear its command first (SetCommand with 0), since the screen offers no command to a slot with no target.
SetOn()
Refusal SetOn(ObjectId creature, std::int32_t slot, bool on)
Switches a slot on or off, as its own switch does.
Slots()
std::vector<Slot> Slots(ObjectId creature)
Returns a follower’s slots, whether or not its AI is on.
Call it, and the rest, on the game thread.
Returns none for a creature with no tactics, one that has never been a follower
Targets()
std::vector<Target> Targets(ObjectId creature)
What the screen offers a follower’s slots, as its pickers list them.
Variables
kActivateMode
constexpr std::int32_t kActivateMode = 5
a sustained ability
kDeactivateMode
constexpr std::int32_t kDeactivateMode = 6
a sustained ability
kJumpToTactic
constexpr std::int32_t kJumpToTactic = 10
a later slot, from 0
kUseAbility
constexpr std::int32_t kUseAbility = 4
Commands with a parameter of their own, as rows of the tactics commands table.
the ability, a row of abi_base
kUseItem
constexpr std::int32_t kUseItem = 7
the item, given apart