From fd81866af84691cd8817a978d7726514be3c43ae Mon Sep 17 00:00:00 2001 From: Jylpah Date: Fri, 27 Nov 2020 00:00:58 +0200 Subject: [PATCH] New categorizations: is_premium, tank_type, tank_nation --- analyze_wotb_replays.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/analyze_wotb_replays.py b/analyze_wotb_replays.py index e54925c..2725feb 100755 --- a/analyze_wotb_replays.py +++ b/analyze_wotb_replays.py @@ -127,9 +127,12 @@ class BattleCategorizationList(): 'total' : [ 'TOTAL', 'total' ], 'battle_result' : [ 'Result', 'category', [ 'Loss', 'Win', 'Draw']], 'battle_type' : [ 'Battle Type', 'category', [ 'Encounter', 'Supremacy']], - 'tank_tier' : [ 'Tank Tier', 'number' ], - 'top_tier' : [ 'Tier', 'category', [ 'Bottom tier', 'Top tier']], 'room_type' : [ 'Battle Mode', 'category', _BATTLE_MODES ], + 'top_tier' : [ 'Tier', 'category', [ 'Bottom tier', 'Top tier']], + 'tank_tier' : [ 'Tank Tier', 'number' ], + 'is_premium' : [ 'Tank Type', 'category', [ 'Tech tree', 'Premium']], + 'tank_type' : [ 'Tank Class', 'category', WG.TANK_TYPE_STR], + 'tank_nation' : [ 'Nation', 'category', WG.NATION_STR], 'mastery_badge' : [ 'Battle Medal', 'category', ['-', '3rd Class', '2nd Class', '1st Class', 'Mastery' ]], 'team_result' : [ 'Team Result', 'string' ], 'player_wins' : [ 'Player WR', 'bucket', [ 0, .35, .45, .50, .55, .65], '%' ], @@ -140,11 +143,11 @@ class BattleCategorizationList(): 'enemies_spotted' : [ 'Player Spots', 'number'], 'hit_rate' : [ 'Player Hit Rate', 'bucket', [ 0, .25, .5, .6, .7, .8, .9, .95 ], '%' ], 'pen_rate' : [ 'Player Pen Rate', 'bucket', [ 0, .25, .5, .6, .7, .8, .9, .95 ], '%' ], - 'map_name' : [ 'Map', 'string' ], - 'tank_name' : [ 'Tank', 'string' ], - 'player_name' : [ 'Player', 'string' ], - 'protagonist' : [ 'account_id', 'number' ], - 'battle_i' : [ 'Battle #', 'number' ] + 'player_name' : [ 'Player', 'string' ], + 'protagonist' : [ 'account_id', 'number' ], + 'tank_name' : [ 'Tank', 'string' ], + 'map_name' : [ 'Map', 'string' ], + 'battle_i' : [ 'Battle #', 'number' ] } _categorizations_default = [ @@ -2123,7 +2126,10 @@ async def read_replay_JSON(replay_json: dict, args : argparse.Namespace) -> dict tmp['account_id'] = account_id tmp['tank_id'] = player['vehicle_descr'] tmp['tank_tier'] = player_tank_tier - tmp['tank_name'] = wg.get_tank_data(tmp['tank_id'], 'name') + tmp['tank_name'] = wg.get_tank_name(tmp['tank_id']) + tmp['tank_type'] = wg.get_tank_type_id(tmp['tank_id']) + tmp['tank_nation'] = wg.get_tank_nation_id(tmp['tank_id']) + tmp['is_premium'] = int(wg.is_premium(tmp['tank_id'])) tmp['squad_index'] = player['squad_index'] for key in replay_details_flds: tmp[key] = player[key]