Repository navigation
API Game data
| Import | from proleak import data |
The game's data: units, legions, waves, mercenaries, legion spells, masterminds, king upgrades.
| 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. |
| 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. |
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.
unit(unit_type: str) -> UnitInfo | None
The UnitInfo of unit_type (an id such as peewee_unit_id), or None.
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_id: str) -> LegionInfo | None
A LegionInfo by id or name, or None.
legions() -> list[LegionInfo]
Every legion.
waves() -> list[WaveInfo]
Every wave, by number (the tables' template row, level 0, is left out).
wave(number: int) -> WaveInfo | None
The WaveInfo of wave number, or None.
mercenaries() -> list[UnitInfo]
Every mercenary a player can send, cheapest first.
spell(spell_id: str) -> SpellInfo | None
A SpellInfo by id or name, or None.
spells() -> list[SpellInfo]
Every legion spell.
mastermind(mastermind_id: str) -> MastermindInfo | None
A MastermindInfo by id or name, or None.
masterminds() -> list[MastermindInfo]
Every Mastermind playstyle.
king_upgrades() -> list[KingUpgradeInfo]
The three king upgrades.
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. |
id: str
Its id, such as peewee_unit_id.
name: str
Its name in the game, such as Peewee.
legion: str
Its legion's id; empty for a unit of no legion.
tier: int
Its tier, 1 to 6; 0 for a unit with none.
role: str
The game's inforole field; empty when the game sets none.
unit_class: str
"fighter", "mercenary", "wave", "worker", "king" or "other".
gold_cost: int
Gold to build or upgrade into it.
mythium_cost: int
Mythium to send it (a mercenary).
food_cost: int
Food it takes.
value: int
Its value with the upgrades that lead to it.
income: int
Income it gives when sent (a mercenary).
attack_type: str
Its attack type, such as atk_pierce.
armor_type: str
Its armor type, such as arm_fortified.
abilities: list[str]
The ids of its abilities.
evolves_to: list[UnitInfo] [read-only]
The units this one upgrades into (a branch has several).
evolves_from: list[UnitInfo] [read-only]
The units that upgrade into this one.
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. |
id: str
Its id, such as element_legion_id.
name: str
Its name in the game.
playable: bool
Whether a player can pick it.
fighters() -> list[UnitInfo]
Every fighter of this legion, base units and upgrades.
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. |
number: int
Its number, from 1.
name: str
Its name in the game, such as Crabs.
unit: UnitInfo | None
The unit type it sends.
count: int
How many units it sends a lane.
recommended_value: int
The value the game recommends a player hold for it.
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. |
id: str
Its id.
name: str
Its name in the game.
description: str
Its text in the game.
category: str
Its category in the game's spell picker.
ability: str
The ability it puts on a fighter; empty for a spell put on none.
targets_fighter: bool
Whether it is put on one fighter.
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. |
id: str
Its id.
name: str
Its name in the game.
description: str
Its text in the game.
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. |
id: str
"attack", "regen" or "spell".
research: str
The game's research id for it.
name: str
Its name in the game.
Using ProLeak
Features
Tutorial
- Your first plugin
- Plugin basics
- Handling events
- Plugin settings
- User interface
- Players, units and game data
- Purchases, signals and pings
- Chat, camera, input and more
- Cosmetics
- Game modes
- Game updates
- Publishing plugins
Reference