Skip to content

Commit

Permalink
expand data points for Player Damage by Skill comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
Drevarr committed Sep 5, 2024
1 parent 47b6c14 commit c4ee7be
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 7 deletions.
27 changes: 23 additions & 4 deletions TW5_parse_top_stats_detailed.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,36 @@
myprint(output, "|"+playerName+" | {{"+playerProf +"}} | "+my_value(playerTotal)+"|")
myprint(output, "\n\n")
myprint(output, "|thead-dark table-hover|k")
myprint(output, "|@@display:block;width:75px;Skill Name@@ | Skill Damage| % of Total Damage|h")
myprint(output, "|@@display:block;width:50px;Skill Name@@ | Damage| % of Total| Min| Avg| Max| Hit| Con Hit| Crit| Crit Dmg| Casts| Hits/Cast|h")
sorted_Player_Damage_by_Skill_Total = OrderedDict(sorted(Player_Damage_by_Skill[item]['Skills'].items(), key = lambda x: x[1], reverse = True))
for skill in sorted_Player_Damage_by_Skill_Total:
skillIcon=""
for skillID in skill_Dict:
if skill_Dict[skillID]['name'] == skill:
skillIcon = skill_Dict[skillID]['icon']
skillDamage = sorted_Player_Damage_by_Skill_Total[skill]
skillDamage = sorted_Player_Damage_by_Skill_Total[skill][0]
pctTotal = round((skillDamage / playerTotal)*100,2)
skill_Min = sorted_Player_Damage_by_Skill_Total[skill][1]
skill_Max = sorted_Player_Damage_by_Skill_Total[skill][2]
skill_Hit = sorted_Player_Damage_by_Skill_Total[skill][3]
skill_connectedHit = sorted_Player_Damage_by_Skill_Total[skill][4]
skill_Crit = sorted_Player_Damage_by_Skill_Total[skill][5]
skill_CritDmg = sorted_Player_Damage_by_Skill_Total[skill][6]
skill_Casts = sorted_Player_Damage_by_Skill_Total[skill][7]
if skill_connectedHit > 0:
skill_Avg =int(round((skillDamage / skill_connectedHit),0))
else:
skill_Avg = 0
if skill_connectedHit > 0:
skill_CritRate = round((skill_Crit / skill_connectedHit)*100,2)
else:
skill_CritRate = 0.00
if skill_Casts >0 and skill_Hit > 0:
skill_HitsPerCast = round((skill_Hit / skill_Casts),1)
else:
skill_HitsPerCast = 0

myprint(output, "|[img width=24 ["+skillIcon+"]] "+skill+" | "+my_value(skillDamage)+"| "+my_value(pctTotal)+"%|")
myprint(output, "|[img width=24 ["+skillIcon+"]] "+skill+" | "+my_value(skillDamage)+"| "+my_value(pctTotal)+"%| "+my_value(skill_Min)+"| "+my_value(skill_Avg)+"| "+my_value(skill_Max)+"| "+my_value(skill_Hit)+"| "+my_value(skill_connectedHit)+"| "+my_value(skill_CritRate)+"%| "+my_value(skill_CritDmg)+"| "+my_value(skill_Casts)+"| "+my_value(skill_HitsPerCast)+"|")
myprint(output, "\n")
myprint(output, "---")
myprint(output, "\n</div>\n")
Expand Down Expand Up @@ -1277,7 +1296,7 @@
top_percentage_stat_players[stat],comparison_val = get_top_percentage_players(players, config, stat, StatType.PERCENTAGE, num_used_fights, top_consistent_stat_players[stat], top_total_stat_players[stat], list(), list())
myprint(output, "</$reveal>\n")
myprint(output, "</$reveal>\n")
write_to_json(overall_raid_stats, overall_squad_stats, fights, players, top_total_stat_players, top_average_stat_players, top_consistent_stat_players, top_percentage_stat_players, top_late_players, top_jack_of_all_trades_players, squad_offensive, squad_Control, enemy_Control, enemy_Control_Player, downed_Healing, uptime_Table, stacking_uptime_Table, auras_TableIn, auras_TableOut, Death_OnTag, Attendance, DPS_List, CPS_List, SPS_List, HPS_List, DPSStats, args.json_output_filename)
write_to_json(overall_raid_stats, overall_squad_stats, fights, players, top_total_stat_players, top_average_stat_players, top_consistent_stat_players, top_percentage_stat_players, top_late_players, top_jack_of_all_trades_players, squad_offensive, squad_Control, enemy_Control, enemy_Control_Player, downed_Healing, uptime_Table, stacking_uptime_Table, auras_TableIn, auras_TableOut, Death_OnTag, Attendance, DPS_List, CPS_List, SPS_List, HPS_List, DPSStats, Player_Damage_by_Skill, args.json_output_filename)

#print table of accounts that fielded support characters
myprint(output,'<$reveal type="match" state="$:/state/curTab" text="Support">')
Expand Down
36 changes: 33 additions & 3 deletions TW5_parse_top_stats_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,12 @@ def get_stats_from_fight_json(fight_json, config, log):
else:
skill_name = 'Skill-'+str(skill_id)
skill_dmg = skill_used['totalDamage']
skill_min = skill_used['min']
skill_max = skill_used['max']
skill_hits = skill_used['hits']
skill_connectedHits = skill_used['connectedHits']
skill_crit = skill_used['crit']
skill_critDamage = skill_used['critDamage']
if skill_name not in squad_skill_dmg:
squad_skill_dmg[skill_name] = skill_dmg
else:
Expand All @@ -3704,8 +3710,32 @@ def get_stats_from_fight_json(fight_json, config, log):
else:
total_Squad_Skill_Dmg[skill_name] = total_Squad_Skill_Dmg[skill_name] +skill_dmg

#Count number of skill casts
skill_casts = 0
for skill in player['rotation']:
check_Skill = skill['id']
if check_Skill == 72992: #Adjust Spearmarshal's support damage ID for cast ID
check_Skill = 74290
if check_Skill == skill_id:
skill_casts = len(skill['skills'])
break

#Collect damage by skill for each player
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name] = Player_Damage_by_Skill[squadDps_prof_name]['Skills'].get(skill_name, 0) + skill_dmg
if skill_name not in Player_Damage_by_Skill[squadDps_prof_name]['Skills']:
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name] = [0,0,0,0,0,0,0,0]

Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][0]+=skill_dmg
if Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][1] == 0 or skill_min <= Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][1]:
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][1]=skill_min
if Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][2] == 0 or skill_max >= Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][2]:
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][2]=skill_max
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][3]+=skill_hits
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][4]+=skill_connectedHits
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][5]+=skill_crit
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][6]+=skill_critDamage
if Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][7] == 0:
Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name][7]+=skill_casts
#Player_Damage_by_Skill[squadDps_prof_name]['Skills'][skill_name] = Player_Damage_by_Skill[squadDps_prof_name]['Skills'].get(skill_name, 0) + skill_dmg
Player_Damage_by_Skill[squadDps_prof_name]['Total'] += skill_dmg

#Collect Offensive Battle Standard Data
Expand Down Expand Up @@ -5602,7 +5632,7 @@ def write_TotalBoon_bar_chart(players, myDate, input_directory):
#end write Total Boon Bar chart

#end Total Boon Bar Chart
def write_to_json(overall_raid_stats, overall_squad_stats, fights, players, top_total_stat_players, top_average_stat_players, top_consistent_stat_players, top_percentage_stat_players, top_late_players, top_jack_of_all_trades_players, squad_offensive, squad_Control, enemy_Control, enemy_Control_Player, downed_Healing, uptime_Table, stacking_uptime_Table, auras_Tablein, auras_TableOut, Death_OnTag, Attendance, DPS_List, CPS_List, SPS_List, HPS_List, DPSStats, output_file):
def write_to_json(overall_raid_stats, overall_squad_stats, fights, players, top_total_stat_players, top_average_stat_players, top_consistent_stat_players, top_percentage_stat_players, top_late_players, top_jack_of_all_trades_players, squad_offensive, squad_Control, enemy_Control, enemy_Control_Player, downed_Healing, uptime_Table, stacking_uptime_Table, auras_Tablein, auras_TableOut, Death_OnTag, Attendance, DPS_List, CPS_List, SPS_List, HPS_List, DPSStats, Player_Damage_by_Skill, output_file):
json_dict = {}
json_dict["overall_raid_stats"] = {key: value for key, value in overall_raid_stats.items()}
json_dict["overall_squad_stats"] = {key: value for key, value in overall_squad_stats.items()}
Expand Down Expand Up @@ -5639,7 +5669,7 @@ def write_to_json(overall_raid_stats, overall_squad_stats, fights, players, top_
#json_dict["profModifiers"] = {key: value for key, value in profModifiers.items()}
#json_dict["modifierMap"] = {key: value for key, value in modifierMap.items()}
#json_dict["total_Squad_Skill_Dmg"] = {key: value for key, value in total_Squad_Skill_Dmg.items()}
#json_dict["Player_Damage_by_Skill"] = {key: value for key, value in Player_Damage_by_Skill.items()}
json_dict["Player_Damage_by_Skill"] = {key: value for key, value in Player_Damage_by_Skill.items()}
#json_dict["total_Enemy_Skill_Dmg"] = {key: value for key, value in total_Enemy_Skill_Dmg.items()}
#json_dict["squadDamageMods"] = {key: value for key, value in squadDamageMods.items()}
#json_dict["Plen_Bot_Logs"] = {key: value for key, value in Plen_Bot_Logs.items()}
Expand Down

0 comments on commit c4ee7be

Please sign in to comment.