slay.py

  1import json
  2
  3from typing import NamedTuple, Annotated, TypedDict
  4from enum import Enum
  5
  6from slay.data.info.utils import xNumber, xFloat, xBool
  7from slay.data.info.decorate import NicknameColor
  8from slay.utils import Pipe, Undefined
  9
 10ConnectionId = int
 11InGameId = int
 12
 13def SecondsFromGameTicks(ticks: int):
 14    return ticks / 20
 15
 16class Ability(Enum):
 17    INVISIBILITY = 4
 18
 19class HeadDirection(Enum):
 20    DOWN = 0
 21    DOWN_LEFT = 1
 22    LEFT = 2
 23    UP_LEFT = 3
 24    UP = 4
 25    UP_RIGHT = 5
 26    RIGHT = 6
 27    DOWN_RIGHT = 7
 28
 29class MovingDirection(Enum):
 30    UP = 1
 31    DOWN = 2
 32    LEFT = 3
 33    RIGHT = 4
 34
 35class GameMode(Enum):
 36    TEAM_DEATHMATCH = 1
 37    CAPTURE_THE_FLAG = 2
 38    DEATHMATCH = 4
 39    INFECTION = 5
 40
 41    @property
 42    def id(self) -> int:
 43        return self.value
 44
 45    @property
 46    def text(self) -> str:
 47        return self.name.replace("_", " ").title()
 48
 49class GameProfile(NamedTuple):
 50    id: int
 51    map_name: str
 52    player_amount: int
 53    max_player_amount: int
 54    mode: Annotated[GameMode, Pipe(int, GameMode)]
 55    map_height: int
 56    map_witdh: int
 57    tag: str
 58    map_thumbnail_data: str
 59
 60class GameMapData(TypedDict, total=False):
 61    x: int
 62    y: int
 63    maxPlayers: int | Undefined
 64    closed: bool
 65    invisible: bool
 66    defaultTiles: int
 67    tiles: list[dict]
 68    groundTiles: list[dict]
 69    noGridTiles: list[dict]
 70    spawningPoints: list
 71    spawningPointsRed: list
 72    spawningPointsBlue: list
 73    waypoints: list
 74    type: int
 75    ammo: list[dict]
 76    noBorder: bool
 77    thumbnail: str
 78    name: str | Undefined
 79    description: str
 80
 81class Game(NamedTuple):
 82    map_data: Annotated[GameMapData, json.loads]
 83    mode: Annotated[GameMode, Pipe(int, GameMode)]
 84    max_round_ticks: int
 85    current_tick: int
 86    team_1_scores: int
 87    team_2_scores: int
 88    red_flag_x: float
 89    red_flag_y: float
 90    blue_flag_x: float
 91    blue_flag_y: float
 92    max_round_ticks: int
 93    """ To ensure compatibility with the old replay version (<=1) """
 94    current_tick: int
 95    """ To ensure compatibility with the old replay version (<=1) """
 96    game_id: int
 97    """ To ensure compatibility with the old replay version (<=1) """
 98
 99class Player(NamedTuple):
100    in_game_id: int
101    x: int
102    y: int
103    nickname: str
104    hp: float
105    armor: float
106    kills: int
107    deaths: int
108    weapon_id: int
109    moving_to_x: int
110    moving_to_y: int
111    skin_id: int
112    team_id: int
113    is_invisible: int
114    max_hp: float
115    hp_regeneration_rate: float
116    clan_tag: str
117    authentication_level: int
118    souls: float
119    mp_regeneration_rate: float
120    invisible_costing_rate: float
121    score: float
122    is_zombie: int
123    is_fake_corpse: int
124    is_zombie_boss: int
125    id: Annotated[int, xNumber]
126    """ 0 means no id (like guests and bots) """
127    db_id: int
128    nickname_color: Annotated[NicknameColor, Pipe(int, NicknameColor)]
129
130class SummonedZombie(NamedTuple):
131    in_game_id: int
132    x: float
133    y: float
134    hp: float
135    moving_to_x: float
136    moving_to_y: float
137    max_hp: float
138    hp_regeneration_rate: float
139    randomizer: float
140    image_scale: float
141    name: str
142
143class UsedAmmoRespawn(NamedTuple):
144    in_game_id: int
145    ticks_left_to_respawn: int
146    """ Have to minus 2 to get the actual ticks left to respawn """
147
148class ObjectDetail(NamedTuple):
149    ticks_left_to_live: int
150    weapon_id: int = -1
151
152class Object(NamedTuple):
153    in_game_id: int
154    x: float
155    y: float
156    ability_id: int
157    owner_in_game_id: int
158    hp: float
159    max_hp: float
160    ticks_to_live: int
161    aoe_value: float
162    detail: ObjectDetail
163
164class MovableObject(NamedTuple):
165    in_game_id: int
166    x: int
167    y: int
168    moving_to_x: int
169    moving_to_y: int
170    type_id: int
171    hp: float
172
173class Corpse(NamedTuple):
174    x: int
175    y: int
176    in_game_id: int
177
178class GameInitial(NamedTuple):
179    game_data: Game
180    players: list[Player]
181    summoned_zombies: list[SummonedZombie]
182    used_ammo_respawns: list[UsedAmmoRespawn]
183    objects: list[Object]
184    movable_objects: list[MovableObject]
185    corpses: list[Corpse]
186
187class NewPlayer(NamedTuple):
188    in_game_id: int
189    x: int
190    y: int
191    nickname: str
192    hp: float
193    armor: float
194    skin_id: int
195    team_id: int
196    max_hp: int
197    hp_regeneration_rate: float
198    clan_tag: str
199    authentication_level: int
200    mp_regeneration_rate: float
201    invisible_costing_rate: float
202    is_zombie: int
203    uid: int # -> may need to change to id, or change the others to uid
204    """ 0 means no id (like guests and bots) """
205    world_elo: float
206    nickname_color_id: int # -> nickname_color: Annotated[NicknameColor, Pipe(int, NicknameColor)]
207
208class GameStats(NamedTuple):
209    xp_gained: int
210    elo_gained: int
211    gold_gained: int
212    kills: int
213    deaths: int
214    xp: int
215    elo: int
216    gold: int
217    souls: int
218    show: int
219    exit: Annotated[bool, Pipe(int, bool)]
220    chestId: int
221
222class HP(NamedTuple):
223    victim_in_game_id: Annotated[int, xNumber]
224    hp: float
225    armor: float
226    need_create_hit_effect: Annotated[bool, xBool] # can be "undefined"
227    projectile_id: Annotated[int, xNumber]
228    murder_weapon_id: Annotated[int, xNumber]
229    attacker_in_game_id: Annotated[int, xNumber]
230    lifesteal_amount: float = None
231    new_kill_count: Annotated[int, xNumber] = -1
232    new_death_count: Annotated[int, xNumber] = -1 # can be "undefined"
233    multiple_kill_count: Annotated[int, xNumber] = -1 # can be "undefined"
234    kill_streak: Annotated[int, xNumber] = -1
235    victim_kill_streak: str = None
236    killer_souls: float = None
237    victim_souls: Annotated[float, xFloat] = None # can be "undefined"
238    killer_elo: Annotated[float, xFloat] = None
239    victim_elo: Annotated[float, xFloat] = None # can be "undefined"
240    has_splash: Annotated[bool, xBool] = None
241    object_x: float = None
242    object_y: float = None
243    object_aoe: float = None
244    object_id: Annotated[int, xNumber] = -1
245    start_x: float = None
246    start_y: float = None
247    vector_x: float = None
248    vector_y: float = None
249    vector_z: float = None
250
251class PlayerRespawn(NamedTuple):
252    in_game_id: int
253    x: float
254    y: float
255    has_turned_zombie: Annotated[bool, Pipe(int, bool)]
256
257class AbilityCancel(NamedTuple):
258    player_in_game_id: int
259    ability: Annotated[Ability, Pipe(int, Ability)]
260
261class InGameChat(NamedTuple):
262    in_game_id: int
263    message: str
ConnectionId = <class 'int'>
InGameId = <class 'int'>
def SecondsFromGameTicks(ticks: int):
14def SecondsFromGameTicks(ticks: int):
15    return ticks / 20
class Ability(enum.Enum):
17class Ability(Enum):
18    INVISIBILITY = 4
INVISIBILITY = <Ability.INVISIBILITY: 4>
class HeadDirection(enum.Enum):
20class HeadDirection(Enum):
21    DOWN = 0
22    DOWN_LEFT = 1
23    LEFT = 2
24    UP_LEFT = 3
25    UP = 4
26    UP_RIGHT = 5
27    RIGHT = 6
28    DOWN_RIGHT = 7
DOWN = <HeadDirection.DOWN: 0>
DOWN_LEFT = <HeadDirection.DOWN_LEFT: 1>
LEFT = <HeadDirection.LEFT: 2>
UP_LEFT = <HeadDirection.UP_LEFT: 3>
UP = <HeadDirection.UP: 4>
UP_RIGHT = <HeadDirection.UP_RIGHT: 5>
RIGHT = <HeadDirection.RIGHT: 6>
DOWN_RIGHT = <HeadDirection.DOWN_RIGHT: 7>
class MovingDirection(enum.Enum):
30class MovingDirection(Enum):
31    UP = 1
32    DOWN = 2
33    LEFT = 3
34    RIGHT = 4
UP = <MovingDirection.UP: 1>
DOWN = <MovingDirection.DOWN: 2>
LEFT = <MovingDirection.LEFT: 3>
RIGHT = <MovingDirection.RIGHT: 4>
class GameMode(enum.Enum):
36class GameMode(Enum):
37    TEAM_DEATHMATCH = 1
38    CAPTURE_THE_FLAG = 2
39    DEATHMATCH = 4
40    INFECTION = 5
41
42    @property
43    def id(self) -> int:
44        return self.value
45
46    @property
47    def text(self) -> str:
48        return self.name.replace("_", " ").title()
TEAM_DEATHMATCH = <GameMode.TEAM_DEATHMATCH: 1>
CAPTURE_THE_FLAG = <GameMode.CAPTURE_THE_FLAG: 2>
DEATHMATCH = <GameMode.DEATHMATCH: 4>
INFECTION = <GameMode.INFECTION: 5>
id: int
42    @property
43    def id(self) -> int:
44        return self.value
text: str
46    @property
47    def text(self) -> str:
48        return self.name.replace("_", " ").title()
class GameProfile(typing.NamedTuple):
50class GameProfile(NamedTuple):
51    id: int
52    map_name: str
53    player_amount: int
54    max_player_amount: int
55    mode: Annotated[GameMode, Pipe(int, GameMode)]
56    map_height: int
57    map_witdh: int
58    tag: str
59    map_thumbnail_data: str

GameProfile(id, map_name, player_amount, max_player_amount, mode, map_height, map_witdh, tag, map_thumbnail_data)

GameProfile( id: int, map_name: str, player_amount: int, max_player_amount: int, mode: Annotated[GameMode, <slay.utils.Pipe object>], map_height: int, map_witdh: int, tag: str, map_thumbnail_data: str)

Create new instance of GameProfile(id, map_name, player_amount, max_player_amount, mode, map_height, map_witdh, tag, map_thumbnail_data)

id: int

Alias for field number 0

map_name: str

Alias for field number 1

player_amount: int

Alias for field number 2

max_player_amount: int

Alias for field number 3

mode: Annotated[GameMode, <slay.utils.Pipe object at 0x78ee9b642bd0>]

Alias for field number 4

map_height: int

Alias for field number 5

map_witdh: int

Alias for field number 6

tag: str

Alias for field number 7

map_thumbnail_data: str

Alias for field number 8

class GameMapData(typing.TypedDict):
61class GameMapData(TypedDict, total=False):
62    x: int
63    y: int
64    maxPlayers: int | Undefined
65    closed: bool
66    invisible: bool
67    defaultTiles: int
68    tiles: list[dict]
69    groundTiles: list[dict]
70    noGridTiles: list[dict]
71    spawningPoints: list
72    spawningPointsRed: list
73    spawningPointsBlue: list
74    waypoints: list
75    type: int
76    ammo: list[dict]
77    noBorder: bool
78    thumbnail: str
79    name: str | Undefined
80    description: str
x: int
y: int
maxPlayers: int | type
closed: bool
invisible: bool
defaultTiles: int
tiles: list[dict]
groundTiles: list[dict]
noGridTiles: list[dict]
spawningPoints: list
spawningPointsRed: list
spawningPointsBlue: list
waypoints: list
type: int
ammo: list[dict]
noBorder: bool
thumbnail: str
name: str | type
description: str
class Game(typing.NamedTuple):
82class Game(NamedTuple):
83    map_data: Annotated[GameMapData, json.loads]
84    mode: Annotated[GameMode, Pipe(int, GameMode)]
85    max_round_ticks: int
86    current_tick: int
87    team_1_scores: int
88    team_2_scores: int
89    red_flag_x: float
90    red_flag_y: float
91    blue_flag_x: float
92    blue_flag_y: float
93    max_round_ticks: int
94    """ To ensure compatibility with the old replay version (<=1) """
95    current_tick: int
96    """ To ensure compatibility with the old replay version (<=1) """
97    game_id: int
98    """ To ensure compatibility with the old replay version (<=1) """

Game(map_data, mode, max_round_ticks, current_tick, team_1_scores, team_2_scores, red_flag_x, red_flag_y, blue_flag_x, blue_flag_y, game_id)

Game( map_data: Annotated[GameMapData, <function loads>], mode: Annotated[GameMode, <slay.utils.Pipe object>], max_round_ticks: int, current_tick: int, team_1_scores: int, team_2_scores: int, red_flag_x: float, red_flag_y: float, blue_flag_x: float, blue_flag_y: float, game_id: int)

Create new instance of Game(map_data, mode, max_round_ticks, current_tick, team_1_scores, team_2_scores, red_flag_x, red_flag_y, blue_flag_x, blue_flag_y, game_id)

map_data: Annotated[GameMapData, <function loads at 0x78ee9cf258a0>]

Alias for field number 0

mode: Annotated[GameMode, <slay.utils.Pipe object at 0x78ee9b23a510>]

Alias for field number 1

max_round_ticks: int

To ensure compatibility with the old replay version (<=1)

current_tick: int

To ensure compatibility with the old replay version (<=1)

team_1_scores: int

Alias for field number 4

team_2_scores: int

Alias for field number 5

red_flag_x: float

Alias for field number 6

red_flag_y: float

Alias for field number 7

blue_flag_x: float

Alias for field number 8

blue_flag_y: float

Alias for field number 9

game_id: int

To ensure compatibility with the old replay version (<=1)

class Player(typing.NamedTuple):
100class Player(NamedTuple):
101    in_game_id: int
102    x: int
103    y: int
104    nickname: str
105    hp: float
106    armor: float
107    kills: int
108    deaths: int
109    weapon_id: int
110    moving_to_x: int
111    moving_to_y: int
112    skin_id: int
113    team_id: int
114    is_invisible: int
115    max_hp: float
116    hp_regeneration_rate: float
117    clan_tag: str
118    authentication_level: int
119    souls: float
120    mp_regeneration_rate: float
121    invisible_costing_rate: float
122    score: float
123    is_zombie: int
124    is_fake_corpse: int
125    is_zombie_boss: int
126    id: Annotated[int, xNumber]
127    """ 0 means no id (like guests and bots) """
128    db_id: int
129    nickname_color: Annotated[NicknameColor, Pipe(int, NicknameColor)]

Player(in_game_id, x, y, nickname, hp, armor, kills, deaths, weapon_id, moving_to_x, moving_to_y, skin_id, team_id, is_invisible, max_hp, hp_regeneration_rate, clan_tag, authentication_level, souls, mp_regeneration_rate, invisible_costing_rate, score, is_zombie, is_fake_corpse, is_zombie_boss, id, db_id, nickname_color)

Player( in_game_id: int, x: int, y: int, nickname: str, hp: float, armor: float, kills: int, deaths: int, weapon_id: int, moving_to_x: int, moving_to_y: int, skin_id: int, team_id: int, is_invisible: int, max_hp: float, hp_regeneration_rate: float, clan_tag: str, authentication_level: int, souls: float, mp_regeneration_rate: float, invisible_costing_rate: float, score: float, is_zombie: int, is_fake_corpse: int, is_zombie_boss: int, id: Annotated[int, <function xNumber>], db_id: int, nickname_color: Annotated[slay.data.info.decorate.NicknameColor, <slay.utils.Pipe object>])

Create new instance of Player(in_game_id, x, y, nickname, hp, armor, kills, deaths, weapon_id, moving_to_x, moving_to_y, skin_id, team_id, is_invisible, max_hp, hp_regeneration_rate, clan_tag, authentication_level, souls, mp_regeneration_rate, invisible_costing_rate, score, is_zombie, is_fake_corpse, is_zombie_boss, id, db_id, nickname_color)

in_game_id: int

Alias for field number 0

x: int

Alias for field number 1

y: int

Alias for field number 2

nickname: str

Alias for field number 3

hp: float

Alias for field number 4

armor: float

Alias for field number 5

kills: int

Alias for field number 6

deaths: int

Alias for field number 7

weapon_id: int

Alias for field number 8

moving_to_x: int

Alias for field number 9

moving_to_y: int

Alias for field number 10

skin_id: int

Alias for field number 11

team_id: int

Alias for field number 12

is_invisible: int

Alias for field number 13

max_hp: float

Alias for field number 14

hp_regeneration_rate: float

Alias for field number 15

clan_tag: str

Alias for field number 16

authentication_level: int

Alias for field number 17

souls: float

Alias for field number 18

mp_regeneration_rate: float

Alias for field number 19

invisible_costing_rate: float

Alias for field number 20

score: float

Alias for field number 21

is_zombie: int

Alias for field number 22

is_fake_corpse: int

Alias for field number 23

is_zombie_boss: int

Alias for field number 24

id: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

0 means no id (like guests and bots)

db_id: int

Alias for field number 26

nickname_color: Annotated[slay.data.info.decorate.NicknameColor, <slay.utils.Pipe object at 0x78ee9b23ab40>]

Alias for field number 27

class SummonedZombie(typing.NamedTuple):
131class SummonedZombie(NamedTuple):
132    in_game_id: int
133    x: float
134    y: float
135    hp: float
136    moving_to_x: float
137    moving_to_y: float
138    max_hp: float
139    hp_regeneration_rate: float
140    randomizer: float
141    image_scale: float
142    name: str

SummonedZombie(in_game_id, x, y, hp, moving_to_x, moving_to_y, max_hp, hp_regeneration_rate, randomizer, image_scale, name)

SummonedZombie( in_game_id: int, x: float, y: float, hp: float, moving_to_x: float, moving_to_y: float, max_hp: float, hp_regeneration_rate: float, randomizer: float, image_scale: float, name: str)

Create new instance of SummonedZombie(in_game_id, x, y, hp, moving_to_x, moving_to_y, max_hp, hp_regeneration_rate, randomizer, image_scale, name)

in_game_id: int

Alias for field number 0

x: float

Alias for field number 1

y: float

Alias for field number 2

hp: float

Alias for field number 3

moving_to_x: float

Alias for field number 4

moving_to_y: float

Alias for field number 5

max_hp: float

Alias for field number 6

hp_regeneration_rate: float

Alias for field number 7

randomizer: float

Alias for field number 8

image_scale: float

Alias for field number 9

name: str

Alias for field number 10

class UsedAmmoRespawn(typing.NamedTuple):
144class UsedAmmoRespawn(NamedTuple):
145    in_game_id: int
146    ticks_left_to_respawn: int
147    """ Have to minus 2 to get the actual ticks left to respawn """

UsedAmmoRespawn(in_game_id, ticks_left_to_respawn)

UsedAmmoRespawn(in_game_id: int, ticks_left_to_respawn: int)

Create new instance of UsedAmmoRespawn(in_game_id, ticks_left_to_respawn)

in_game_id: int

Alias for field number 0

ticks_left_to_respawn: int

Have to minus 2 to get the actual ticks left to respawn

class ObjectDetail(typing.NamedTuple):
149class ObjectDetail(NamedTuple):
150    ticks_left_to_live: int
151    weapon_id: int = -1

ObjectDetail(ticks_left_to_live, weapon_id)

ObjectDetail(ticks_left_to_live: int, weapon_id: int = -1)

Create new instance of ObjectDetail(ticks_left_to_live, weapon_id)

ticks_left_to_live: int

Alias for field number 0

weapon_id: int

Alias for field number 1

class Object(typing.NamedTuple):
153class Object(NamedTuple):
154    in_game_id: int
155    x: float
156    y: float
157    ability_id: int
158    owner_in_game_id: int
159    hp: float
160    max_hp: float
161    ticks_to_live: int
162    aoe_value: float
163    detail: ObjectDetail

Object(in_game_id, x, y, ability_id, owner_in_game_id, hp, max_hp, ticks_to_live, aoe_value, detail)

Object( in_game_id: int, x: float, y: float, ability_id: int, owner_in_game_id: int, hp: float, max_hp: float, ticks_to_live: int, aoe_value: float, detail: ObjectDetail)

Create new instance of Object(in_game_id, x, y, ability_id, owner_in_game_id, hp, max_hp, ticks_to_live, aoe_value, detail)

in_game_id: int

Alias for field number 0

x: float

Alias for field number 1

y: float

Alias for field number 2

ability_id: int

Alias for field number 3

owner_in_game_id: int

Alias for field number 4

hp: float

Alias for field number 5

max_hp: float

Alias for field number 6

ticks_to_live: int

Alias for field number 7

aoe_value: float

Alias for field number 8

detail: ObjectDetail

Alias for field number 9

class MovableObject(typing.NamedTuple):
165class MovableObject(NamedTuple):
166    in_game_id: int
167    x: int
168    y: int
169    moving_to_x: int
170    moving_to_y: int
171    type_id: int
172    hp: float

MovableObject(in_game_id, x, y, moving_to_x, moving_to_y, type_id, hp)

MovableObject( in_game_id: int, x: int, y: int, moving_to_x: int, moving_to_y: int, type_id: int, hp: float)

Create new instance of MovableObject(in_game_id, x, y, moving_to_x, moving_to_y, type_id, hp)

in_game_id: int

Alias for field number 0

x: int

Alias for field number 1

y: int

Alias for field number 2

moving_to_x: int

Alias for field number 3

moving_to_y: int

Alias for field number 4

type_id: int

Alias for field number 5

hp: float

Alias for field number 6

class Corpse(typing.NamedTuple):
174class Corpse(NamedTuple):
175    x: int
176    y: int
177    in_game_id: int

Corpse(x, y, in_game_id)

Corpse(x: int, y: int, in_game_id: int)

Create new instance of Corpse(x, y, in_game_id)

x: int

Alias for field number 0

y: int

Alias for field number 1

in_game_id: int

Alias for field number 2

class GameInitial(typing.NamedTuple):
179class GameInitial(NamedTuple):
180    game_data: Game
181    players: list[Player]
182    summoned_zombies: list[SummonedZombie]
183    used_ammo_respawns: list[UsedAmmoRespawn]
184    objects: list[Object]
185    movable_objects: list[MovableObject]
186    corpses: list[Corpse]

GameInitial(game_data, players, summoned_zombies, used_ammo_respawns, objects, movable_objects, corpses)

GameInitial( game_data: Game, players: list[Player], summoned_zombies: list[SummonedZombie], used_ammo_respawns: list[UsedAmmoRespawn], objects: list[Object], movable_objects: list[MovableObject], corpses: list[Corpse])

Create new instance of GameInitial(game_data, players, summoned_zombies, used_ammo_respawns, objects, movable_objects, corpses)

game_data: Game

Alias for field number 0

players: list[Player]

Alias for field number 1

summoned_zombies: list[SummonedZombie]

Alias for field number 2

used_ammo_respawns: list[UsedAmmoRespawn]

Alias for field number 3

objects: list[Object]

Alias for field number 4

movable_objects: list[MovableObject]

Alias for field number 5

corpses: list[Corpse]

Alias for field number 6

class NewPlayer(typing.NamedTuple):
188class NewPlayer(NamedTuple):
189    in_game_id: int
190    x: int
191    y: int
192    nickname: str
193    hp: float
194    armor: float
195    skin_id: int
196    team_id: int
197    max_hp: int
198    hp_regeneration_rate: float
199    clan_tag: str
200    authentication_level: int
201    mp_regeneration_rate: float
202    invisible_costing_rate: float
203    is_zombie: int
204    uid: int # -> may need to change to id, or change the others to uid
205    """ 0 means no id (like guests and bots) """
206    world_elo: float
207    nickname_color_id: int # -> nickname_color: Annotated[NicknameColor, Pipe(int, NicknameColor)]

NewPlayer(in_game_id, x, y, nickname, hp, armor, skin_id, team_id, max_hp, hp_regeneration_rate, clan_tag, authentication_level, mp_regeneration_rate, invisible_costing_rate, is_zombie, uid, world_elo, nickname_color_id)

NewPlayer( in_game_id: int, x: int, y: int, nickname: str, hp: float, armor: float, skin_id: int, team_id: int, max_hp: int, hp_regeneration_rate: float, clan_tag: str, authentication_level: int, mp_regeneration_rate: float, invisible_costing_rate: float, is_zombie: int, uid: int, world_elo: float, nickname_color_id: int)

Create new instance of NewPlayer(in_game_id, x, y, nickname, hp, armor, skin_id, team_id, max_hp, hp_regeneration_rate, clan_tag, authentication_level, mp_regeneration_rate, invisible_costing_rate, is_zombie, uid, world_elo, nickname_color_id)

in_game_id: int

Alias for field number 0

x: int

Alias for field number 1

y: int

Alias for field number 2

nickname: str

Alias for field number 3

hp: float

Alias for field number 4

armor: float

Alias for field number 5

skin_id: int

Alias for field number 6

team_id: int

Alias for field number 7

max_hp: int

Alias for field number 8

hp_regeneration_rate: float

Alias for field number 9

clan_tag: str

Alias for field number 10

authentication_level: int

Alias for field number 11

mp_regeneration_rate: float

Alias for field number 12

invisible_costing_rate: float

Alias for field number 13

is_zombie: int

Alias for field number 14

uid: int

0 means no id (like guests and bots)

world_elo: float

Alias for field number 16

nickname_color_id: int

Alias for field number 17

class GameStats(typing.NamedTuple):
209class GameStats(NamedTuple):
210    xp_gained: int
211    elo_gained: int
212    gold_gained: int
213    kills: int
214    deaths: int
215    xp: int
216    elo: int
217    gold: int
218    souls: int
219    show: int
220    exit: Annotated[bool, Pipe(int, bool)]
221    chestId: int

GameStats(xp_gained, elo_gained, gold_gained, kills, deaths, xp, elo, gold, souls, show, exit, chestId)

GameStats( xp_gained: int, elo_gained: int, gold_gained: int, kills: int, deaths: int, xp: int, elo: int, gold: int, souls: int, show: int, exit: Annotated[bool, <slay.utils.Pipe object>], chestId: int)

Create new instance of GameStats(xp_gained, elo_gained, gold_gained, kills, deaths, xp, elo, gold, souls, show, exit, chestId)

xp_gained: int

Alias for field number 0

elo_gained: int

Alias for field number 1

gold_gained: int

Alias for field number 2

kills: int

Alias for field number 3

deaths: int

Alias for field number 4

xp: int

Alias for field number 5

elo: int

Alias for field number 6

gold: int

Alias for field number 7

souls: int

Alias for field number 8

show: int

Alias for field number 9

exit: Annotated[bool, <slay.utils.Pipe object at 0x78ee9b25df10>]

Alias for field number 10

chestId: int

Alias for field number 11

class HP(typing.NamedTuple):
223class HP(NamedTuple):
224    victim_in_game_id: Annotated[int, xNumber]
225    hp: float
226    armor: float
227    need_create_hit_effect: Annotated[bool, xBool] # can be "undefined"
228    projectile_id: Annotated[int, xNumber]
229    murder_weapon_id: Annotated[int, xNumber]
230    attacker_in_game_id: Annotated[int, xNumber]
231    lifesteal_amount: float = None
232    new_kill_count: Annotated[int, xNumber] = -1
233    new_death_count: Annotated[int, xNumber] = -1 # can be "undefined"
234    multiple_kill_count: Annotated[int, xNumber] = -1 # can be "undefined"
235    kill_streak: Annotated[int, xNumber] = -1
236    victim_kill_streak: str = None
237    killer_souls: float = None
238    victim_souls: Annotated[float, xFloat] = None # can be "undefined"
239    killer_elo: Annotated[float, xFloat] = None
240    victim_elo: Annotated[float, xFloat] = None # can be "undefined"
241    has_splash: Annotated[bool, xBool] = None
242    object_x: float = None
243    object_y: float = None
244    object_aoe: float = None
245    object_id: Annotated[int, xNumber] = -1
246    start_x: float = None
247    start_y: float = None
248    vector_x: float = None
249    vector_y: float = None
250    vector_z: float = None

HP(victim_in_game_id, hp, armor, need_create_hit_effect, projectile_id, murder_weapon_id, attacker_in_game_id, lifesteal_amount, new_kill_count, new_death_count, multiple_kill_count, kill_streak, victim_kill_streak, killer_souls, victim_souls, killer_elo, victim_elo, has_splash, object_x, object_y, object_aoe, object_id, start_x, start_y, vector_x, vector_y, vector_z)

HP( victim_in_game_id: Annotated[int, <function xNumber>], hp: float, armor: float, need_create_hit_effect: Annotated[bool, <function xBool>], projectile_id: Annotated[int, <function xNumber>], murder_weapon_id: Annotated[int, <function xNumber>], attacker_in_game_id: Annotated[int, <function xNumber>], lifesteal_amount: float = None, new_kill_count: Annotated[int, <function xNumber>] = -1, new_death_count: Annotated[int, <function xNumber>] = -1, multiple_kill_count: Annotated[int, <function xNumber>] = -1, kill_streak: Annotated[int, <function xNumber>] = -1, victim_kill_streak: str = None, killer_souls: float = None, victim_souls: Annotated[float, <function xFloat>] = None, killer_elo: Annotated[float, <function xFloat>] = None, victim_elo: Annotated[float, <function xFloat>] = None, has_splash: Annotated[bool, <function xBool>] = None, object_x: float = None, object_y: float = None, object_aoe: float = None, object_id: Annotated[int, <function xNumber>] = -1, start_x: float = None, start_y: float = None, vector_x: float = None, vector_y: float = None, vector_z: float = None)

Create new instance of HP(victim_in_game_id, hp, armor, need_create_hit_effect, projectile_id, murder_weapon_id, attacker_in_game_id, lifesteal_amount, new_kill_count, new_death_count, multiple_kill_count, kill_streak, victim_kill_streak, killer_souls, victim_souls, killer_elo, victim_elo, has_splash, object_x, object_y, object_aoe, object_id, start_x, start_y, vector_x, vector_y, vector_z)

victim_in_game_id: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 0

hp: float

Alias for field number 1

armor: float

Alias for field number 2

need_create_hit_effect: Annotated[bool, <function xBool at 0x78ee9b224b80>]

Alias for field number 3

projectile_id: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 4

murder_weapon_id: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 5

attacker_in_game_id: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 6

lifesteal_amount: float

Alias for field number 7

new_kill_count: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 8

new_death_count: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 9

multiple_kill_count: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 10

kill_streak: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 11

victim_kill_streak: str

Alias for field number 12

killer_souls: float

Alias for field number 13

victim_souls: Annotated[float, <function xFloat at 0x78ee9b224ae0>]

Alias for field number 14

killer_elo: Annotated[float, <function xFloat at 0x78ee9b224ae0>]

Alias for field number 15

victim_elo: Annotated[float, <function xFloat at 0x78ee9b224ae0>]

Alias for field number 16

has_splash: Annotated[bool, <function xBool at 0x78ee9b224b80>]

Alias for field number 17

object_x: float

Alias for field number 18

object_y: float

Alias for field number 19

object_aoe: float

Alias for field number 20

object_id: Annotated[int, <function xNumber at 0x78ee9b24cfe0>]

Alias for field number 21

start_x: float

Alias for field number 22

start_y: float

Alias for field number 23

vector_x: float

Alias for field number 24

vector_y: float

Alias for field number 25

vector_z: float

Alias for field number 26

class PlayerRespawn(typing.NamedTuple):
252class PlayerRespawn(NamedTuple):
253    in_game_id: int
254    x: float
255    y: float
256    has_turned_zombie: Annotated[bool, Pipe(int, bool)]

PlayerRespawn(in_game_id, x, y, has_turned_zombie)

PlayerRespawn( in_game_id: int, x: float, y: float, has_turned_zombie: Annotated[bool, <slay.utils.Pipe object>])

Create new instance of PlayerRespawn(in_game_id, x, y, has_turned_zombie)

in_game_id: int

Alias for field number 0

x: float

Alias for field number 1

y: float

Alias for field number 2

has_turned_zombie: Annotated[bool, <slay.utils.Pipe object at 0x78ee9b25ef90>]

Alias for field number 3

class AbilityCancel(typing.NamedTuple):
258class AbilityCancel(NamedTuple):
259    player_in_game_id: int
260    ability: Annotated[Ability, Pipe(int, Ability)]

AbilityCancel(player_in_game_id, ability)

AbilityCancel( player_in_game_id: int, ability: Annotated[Ability, <slay.utils.Pipe object>])

Create new instance of AbilityCancel(player_in_game_id, ability)

player_in_game_id: int

Alias for field number 0

ability: Annotated[Ability, <slay.utils.Pipe object at 0x78ee9b25f470>]

Alias for field number 1

class InGameChat(typing.NamedTuple):
262class InGameChat(NamedTuple):
263    in_game_id: int
264    message: str

InGameChat(in_game_id, message)

InGameChat(in_game_id: int, message: str)

Create new instance of InGameChat(in_game_id, message)

in_game_id: int

Alias for field number 0

message: str

Alias for field number 1