@@ -124,7 +124,7 @@ def __init__(self, sid, slot_data):
124
124
125
125
#:
126
126
self .hero_mount = slot_data ['mount' ]
127
-
127
+
128
128
#: The unique Battle.net account identifier in the form of
129
129
#: <region_id>-S2-<subregion>-<toon_id>
130
130
self .toon_handle = slot_data ['toon_handle' ]
@@ -164,10 +164,13 @@ class Player(object):
164
164
:param dict detail_data: The detail data associated with this player
165
165
:param dict attribute_data: The attribute data associated with this player
166
166
"""
167
- def __init__ (self , pid , detail_data , attribute_data ):
167
+ def __init__ (self , pid , slot_data , detail_data , attribute_data ):
168
168
#: The player's unique in-game player id
169
169
self .pid = int (pid )
170
170
171
+ #: The player's replay.initData slot data
172
+ self .slot_data = slot_data
173
+
171
174
#: The replay.details data on this player
172
175
self .detail_data = detail_data
173
176
@@ -197,6 +200,24 @@ def __init__(self, pid, detail_data, attribute_data):
197
200
#: One of Protoss, Terran, Zerg
198
201
self .play_race = LOCALIZED_RACES .get (detail_data ['race' ], detail_data ['race' ])
199
202
203
+ #: The co-op commander the player picked
204
+ #: Kerrigan, Raynor, etc.
205
+ self .commander = slot_data ['commander' ]
206
+ if self .commander is not None :
207
+ self .commander = self .commander .decode ('utf8' )
208
+
209
+ #: The level of the co-op commander
210
+ #: 1-15 or None
211
+ self .commander_level = slot_data ['commander_level' ]
212
+
213
+ #: The mastery level of the co-op commander
214
+ #: >0 or None
215
+ self .commander_mastery_level = slot_data ['commander_mastery_talents' ]
216
+
217
+ #: The mastery talents picked for the co-op commander
218
+ #: list of longs of length 6, each between 0 and 30
219
+ self .commander_mastery_talents = slot_data ['commander_mastery_talents' ]
220
+
200
221
#: A reference to a :class:`~sc2reader.utils.Color` object representing the player's color
201
222
self .color = utils .Color (** detail_data ['color' ])
202
223
@@ -290,7 +311,7 @@ class Computer(Entity, Player):
290
311
"""
291
312
def __init__ (self , sid , slot_data , pid , detail_data , attribute_data ):
292
313
Entity .__init__ (self , sid , slot_data )
293
- Player .__init__ (self , pid , detail_data , attribute_data )
314
+ Player .__init__ (self , pid , slot_data , detail_data , attribute_data )
294
315
295
316
#: The auto-generated in-game name for this computer player
296
317
self .name = detail_data ['name' ]
@@ -316,7 +337,7 @@ class Participant(Entity, User, Player):
316
337
def __init__ (self , sid , slot_data , uid , init_data , pid , detail_data , attribute_data ):
317
338
Entity .__init__ (self , sid , slot_data )
318
339
User .__init__ (self , uid , init_data )
319
- Player .__init__ (self , pid , detail_data , attribute_data )
340
+ Player .__init__ (self , pid , slot_data , detail_data , attribute_data )
320
341
321
342
def __str__ (self ):
322
343
return "Player {0} - {1} ({2})" .format (self .pid , self .name , self .play_race )
@@ -563,7 +584,7 @@ def __init__(self, contents):
563
584
# Leave early so we dont barf. Turns out ggtracker doesnt need
564
585
# any of the map data thats loaded below.
565
586
return
566
-
587
+
567
588
#: Load screen type: 0 = default, 1 = custom
568
589
self .load_screen_type = data .read_uint32 ()
569
590
0 commit comments