councilors
Data model and query module for councilors and the player's hiring pool.
tiargus.councilors
Data model and SavegameModule for councilors.
Provides:
Councilor— an individual councilor, including its profession, traits, and whether the player can currently hire it.CouncilorModule(key:"councilors") — parses every councilor from the save and flags the ones in the player faction's hiring pool.
Example
from tiargus import TerraInvictaSave, CouncilorModule
save = TerraInvictaSave("Autosave.gz", CouncilorModule)
for c in save.get_module(CouncilorModule).councilors.values():
if c.hireable:
print(c.display_name, c.profession, sorted(c.traits))
Councilor
dataclass
A councilor as recorded in the save file.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Numeric game-state ID. |
display_name |
str
|
Councilor name as shown in-game (e.g. |
hireable |
bool
|
|
profession |
str
|
Internal profession identifier ( |
traits |
frozenset[str]
|
Set of internal trait identifiers ( |
missions |
frozenset[str]
|
Internal identifiers of the missions this councilor can currently perform, derived from its profession, traits, and assigned orgs (plus the universal base missions, minus any trait restrictions). Note: a few missions are additionally research- or faction-gated (e.g. alien missions) and are not modelled here. |
persuasion |
int
|
Ability to shape the opinions of others to your own. |
investigation |
int
|
Ability to discover information someone would prefer to keep hidden. |
espionage |
int
|
Ability to move in secret and conduct covert operations. |
command |
int
|
Ability to organize and lead combat operations. |
administration |
int
|
Ability to manage large organizations. |
science |
int
|
Ability to investigate and analyze phenomena to derive new understandings of the universe. |
security |
int
|
Ability to survive violence. |
loyalty |
int
|
How likely the councilor is to betray their faction — the
councilor's true loyalty value ( |
apparent_loyalty |
int
|
The estimate of loyalty before the true loyalty is fully revealed. |
Source code in src/tiargus/councilors.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
CouncilorAttribute
Bases: AliasedStrEnum
One of a councilor's eight core attributes.
Each member's value is the corresponding Councilor
field name, so getattr(councilor, CouncilorAttribute.PERSUASION) reads
that councilor's score. Members subclass str and so compare and hash
equal to that field name (e.g. CouncilorAttribute.COMMAND == "command").
Each member also carries the in-game three-letter abbreviation as a curated synonym for interactive (REPL) use:
| Member | Field | Synonym |
|---|---|---|
PERSUASION |
persuasion |
PER |
INVESTIGATION |
investigation |
INV |
ESPIONAGE |
espionage |
ESP |
COMMAND |
command |
CMD |
ADMINISTRATION |
administration |
ADM |
SCIENCE |
science |
SCI |
SECURITY |
security |
SEC |
LOYALTY |
loyalty |
LOY |
Use from_alias to resolve any field name, member name, or abbreviation (case- and separator-insensitively) to a member, and the aliases property to list every accepted spelling for a member.
Members are declared as NAME = (field_name, abbreviation).
Source code in src/tiargus/councilors.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
aliases
property
Every spelling that resolves to this member, in declaration order.
Comprises the raw value, the member name, and the curated synonyms,
de-duplicated. Handy for listing accepted inputs in a REPL.
synonyms
property
The curated friendly aliases for this member (excludes value & name).
from_alias(name)
classmethod
Resolve a flexible alias to its canonical member.
Lookup is case- and separator-insensitive (spaces, underscores, and
hyphens are ignored) and a trailing "bonus" is optional. A
member's raw value, its name, and its curated synonyms are all valid
aliases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The alias to resolve. |
required |
Returns:
| Type | Description |
|---|---|
_AS
|
The matching member. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no member matches the normalized alias. |
Source code in src/tiargus/_aliased_enum.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
CouncilorModule
Bases: SavegameModule
Parses all councilors and flags those in the player's hiring pool.
Depends on FactionModule to identify
the player faction; a councilor is hireable iff its ID appears in that
faction's availableCouncilors list.
Source code in src/tiargus/councilors.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
councilors
property
All councilors keyed by their numeric game-state ID.
__init_subclass__(**kwargs)
Register subclasses in _REGISTRY at definition time.
Raises:
| Type | Description |
|---|---|
TypeError
|
If a subclass does not define |
Source code in src/tiargus/savegame.py
141 142 143 144 145 146 147 148 149 150 | |