Skip to content

Commit f333187

Browse files
committed
update commander decode, add more coop properties
1 parent 51d53cb commit f333187

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

sc2reader/objects.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,22 @@ def __init__(self, pid, slot_data, detail_data, attribute_data):
201201
self.play_race = LOCALIZED_RACES.get(detail_data['race'], detail_data['race'])
202202

203203
#: The co-op commander the player picked
204-
self.commander = slot_data['commander'].decode('utf8')
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.comander_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.comander_mastery_talents = slot_data['commander_mastery_talents']
205220

206221
#: A reference to a :class:`~sc2reader.utils.Color` object representing the player's color
207222
self.color = utils.Color(**detail_data['color'])

0 commit comments

Comments
 (0)