Skip to content

API Game data

Alexandre 'kidev' Poumaroux edited this page Oct 21, 2026 · 4 revisions

Game data

Import from proleak import data

The game's data: units, legions, waves, mercenaries, legion spells, masterminds, king upgrades.

Classes

Class
UnitInfo A unit type: a fighter, a mercenary, a wave unit, a worker or a king.
LegionInfo A legion (Element, Grove, ... Mastermind).
WaveInfo One of the waves: its number, name, unit type and count.
SpellInfo A legion spell, offered at wave 11.
MastermindInfo A Mastermind playstyle (Lock-In, Greed, Redraw, ...).
KingUpgradeInfo One of the three king upgrades: attack, regen or spell.

Functions

Returns Function
UnitInfo | None unit(unit_type: str) The UnitInfo of unit_type (an id such as peewee_unit_id), or None.
list[UnitInfo] units(kind: str | None = None, name: str | None = None, legion: str | None = None, tier: int | None = None, role: str | None = None, attack_type: str | None = None, armor_type: str | None = None, where: Callable[[UnitInfo], bool] | None = None) Every unit type that matches each filter given.
LegionInfo | None legion(legion_id: str) A LegionInfo by id or name, or None.
list[LegionInfo] legions() Every legion.
list[WaveInfo] waves() Every wave, by number (the tables' template row, level 0, is left out).
WaveInfo | None wave(number: int) The WaveInfo of wave number, or None.
list[UnitInfo] mercenaries() Every mercenary a player can send, cheapest first.
SpellInfo | None spell(spell_id: str) A SpellInfo by id or name, or None.
list[SpellInfo] spells() Every legion spell.
MastermindInfo | None mastermind(mastermind_id: str) A MastermindInfo by id or name, or None.
list[MastermindInfo] masterminds() Every Mastermind playstyle.
list[KingUpgradeInfo] king_upgrades() The three king upgrades.

Detailed description

Values come from the game's own data tables, so they follow balance patches. Records are cached for the session. Before the game has loaded its tables (early in the main menu) lookups return None or empty lists.

Function documentation

unit

unit(unit_type: str) -> UnitInfo | None

The UnitInfo of unit_type (an id such as peewee_unit_id), or None.

units

units(kind: str | None = None, name: str | None = None, legion: str | None = None, tier: int | None = None, role: str | None = None, attack_type: str | None = None, armor_type: str | None = None, where: Callable[[UnitInfo], bool] | None = None) -> list[UnitInfo]

Every unit type that matches each filter given.

kind is a unit_class of UnitInfo; name matches a name or an id; legion takes a legion id or name. Text filters ignore case. where is called with each unit type that passed the others and keeps those it returns True for.

legion

legion(legion_id: str) -> LegionInfo | None

A LegionInfo by id or name, or None.

legions

legions() -> list[LegionInfo]

Every legion.

waves

waves() -> list[WaveInfo]

Every wave, by number (the tables' template row, level 0, is left out).

wave

wave(number: int) -> WaveInfo | None

The WaveInfo of wave number, or None.

mercenaries

mercenaries() -> list[UnitInfo]

Every mercenary a player can send, cheapest first.

spell

spell(spell_id: str) -> SpellInfo | None

A SpellInfo by id or name, or None.

spells

spells() -> list[SpellInfo]

Every legion spell.

mastermind

mastermind(mastermind_id: str) -> MastermindInfo | None

A MastermindInfo by id or name, or None.

masterminds

masterminds() -> list[MastermindInfo]

Every Mastermind playstyle.

king_upgrades

king_upgrades() -> list[KingUpgradeInfo]

The three king upgrades.

UnitInfo class

A unit type: a fighter, a mercenary, a wave unit, a worker or a king.

Type Property
str id Its id, such as peewee_unit_id.
str name Its name in the game, such as Peewee.
str legion Its legion's id; empty for a unit of no legion.
int tier Its tier, 1 to 6; 0 for a unit with none.
str role The game's inforole field; empty when the game sets none.
str unit_class "fighter", "mercenary", "wave", "worker", "king" or "other".
int gold_cost Gold to build or upgrade into it.
int mythium_cost Mythium to send it (a mercenary).
int food_cost Food it takes.
int value Its value with the upgrades that lead to it.
int income Income it gives when sent (a mercenary).
str attack_type Its attack type, such as atk_pierce.
str armor_type Its armor type, such as arm_fortified.
list[str] abilities The ids of its abilities.
list[UnitInfo] evolves_to read-only The units this one upgrades into (a branch has several).
list[UnitInfo] evolves_from read-only The units that upgrade into this one.

Property documentation

id

id: str

Its id, such as peewee_unit_id.

name

name: str

Its name in the game, such as Peewee.

legion

legion: str

Its legion's id; empty for a unit of no legion.

tier

tier: int

Its tier, 1 to 6; 0 for a unit with none.

role

role: str

The game's inforole field; empty when the game sets none.

unit_class

unit_class: str

"fighter", "mercenary", "wave", "worker", "king" or "other".

gold_cost

gold_cost: int

Gold to build or upgrade into it.

mythium_cost

mythium_cost: int

Mythium to send it (a mercenary).

food_cost

food_cost: int

Food it takes.

value

value: int

Its value with the upgrades that lead to it.

income

income: int

Income it gives when sent (a mercenary).

attack_type

attack_type: str

Its attack type, such as atk_pierce.

armor_type

armor_type: str

Its armor type, such as arm_fortified.

abilities

abilities: list[str]

The ids of its abilities.

evolves_to

evolves_to: list[UnitInfo] [read-only]

The units this one upgrades into (a branch has several).

evolves_from

evolves_from: list[UnitInfo] [read-only]

The units that upgrade into this one.

LegionInfo class

A legion (Element, Grove, ... Mastermind).

Type Property
str id Its id, such as element_legion_id.
str name Its name in the game.
bool playable Whether a player can pick it.
Returns Method
list[UnitInfo] fighters() Every fighter of this legion, base units and upgrades.

Property documentation

id

id: str

Its id, such as element_legion_id.

name

name: str

Its name in the game.

playable

playable: bool

Whether a player can pick it.

Method documentation

fighters

fighters() -> list[UnitInfo]

Every fighter of this legion, base units and upgrades.

WaveInfo class

One of the waves: its number, name, unit type and count.

Type Property
int number Its number, from 1.
str name Its name in the game, such as Crabs.
UnitInfo | None unit The unit type it sends.
int count How many units it sends a lane.
int recommended_value The value the game recommends a player hold for it.

Property documentation

number

number: int

Its number, from 1.

name

name: str

Its name in the game, such as Crabs.

unit

unit: UnitInfo | None

The unit type it sends.

count

count: int

How many units it sends a lane.

recommended_value

recommended_value: int

The value the game recommends a player hold for it.

SpellInfo class

A legion spell, offered at wave 11.

Type Property
str id Its id.
str name Its name in the game.
str description Its text in the game.
str category Its category in the game's spell picker.
str ability The ability it puts on a fighter; empty for a spell put on none.
bool targets_fighter Whether it is put on one fighter.

Property documentation

id

id: str

Its id.

name

name: str

Its name in the game.

description

description: str

Its text in the game.

category

category: str

Its category in the game's spell picker.

ability

ability: str

The ability it puts on a fighter; empty for a spell put on none.

targets_fighter

targets_fighter: bool

Whether it is put on one fighter.

MastermindInfo class

A Mastermind playstyle (Lock-In, Greed, Redraw, ...).

Type Property
str id Its id.
str name Its name in the game.
str description Its text in the game.

Property documentation

id

id: str

Its id.

name

name: str

Its name in the game.

description

description: str

Its text in the game.

KingUpgradeInfo class

One of the three king upgrades: attack, regen or spell.

Type Property
str id "attack", "regen" or "spell".
str research The game's research id for it.
str name Its name in the game.

Property documentation

id

id: str

"attack", "regen" or "spell".

research

research: str

The game's research id for it.

name

name: str

Its name in the game.


Previous: Errors | Next: Game modes

Clone this wiki locally