Repository navigation
API Game state
| Import | from proleak import game |
Read-only view of the game: players and units. Main thread only.
| Class | |
|---|---|
UnitDict |
A unit as unit and units give it. |
| Returns | Function | |
|---|---|---|
int |
local_player() |
The player slot you control (1 to 8). |
UnitDict | None |
unit(unit_id: int) |
The unit with this id, or None. |
list[UnitDict] |
units() |
Every unit on the map. |
str |
version() |
The running game's version (gameversion.txt), such as 26.10a. |
str |
built_for() |
The game version this ProLeak was built for. |
Literal[True] | str |
available(name: str) |
True when an event, an action (actions.hire) or a ProLeak feature (world) runs on this game. |
local_player() -> int
The player slot you control (1 to 8).
unit(unit_id: int) -> UnitDict | None
The unit with this id, or None.
In a wave a placed fighter sends a separate unit to fight: wave_fighter is that unit for a
placed fighter and placed is the placed fighter for a wave fighter; both are -1 otherwise.
units() -> list[UnitDict]
Every unit on the map.
version() -> str
The running game's version (gameversion.txt), such as 26.10a.
built_for() -> str
The game version this ProLeak was built for.
available(name: str) -> Literal[True] | str
True when an event, an action (actions.hire) or a ProLeak feature (world) runs on this game.
Otherwise the reason, as a string: what it depends on changed in the game, or is missing.
The player can run a changed one anyway from Mods > Advanced > Game version.
A unit as unit and units give it.
A plain dict with these keys.
| Type | Key | |
|---|---|---|
int |
id |
Its id. |
str |
type |
Its unit type id, such as peewee_unit_id. |
int |
owner |
Its owner's slot. |
float |
x |
Map x position. |
float |
z |
Map z position. |
bool |
alive |
True while it is alive. |
int |
placed |
For a wave fighter, the id of the placed fighter it fights for; else -1. |
int |
wave_fighter |
For a placed fighter, the id of the unit that fights for it during a wave; else -1. |
id: int
Its id.
type: str
Its unit type id, such as peewee_unit_id.
owner: int
Its owner's slot.
x: float
Map x position.
z: float
Map z position.
alive: bool
True while it is alive.
placed: int
For a wave fighter, the id of the placed fighter it fights for; else -1.
wave_fighter: int
For a placed fighter, the id of the unit that fights for it during a wave; else -1.
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