Skip to content

Commit

Permalink
re-added config file; additional checks whether json is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
FreyaVF authored and Freyavf committed Aug 12, 2023
1 parent 133c406 commit 0507416
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 35 deletions.
51 changes: 29 additions & 22 deletions json_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,32 +463,39 @@ def get_stat_from_player_json(player_json, stat, fight, player_duration_present,
# First time the player took or dealt damage after initial_time
def get_combat_start_from_player_json(initial_time, player_json):
start_combat = -1
# if healthPercents is not available, assume the player was in combat right away
if 'healthPercents' not in player_json:
return initial_time
last_health_percent = 100
for change in player_json['healthPercents']:
# look for last timestamp before initial time
if change[0] < initial_time:
if ('healthPercents' not in player_json or len(player_json['healthPercents']) == 0) and ('powerDamage1S' not in player_json or len(player_json['powerDamage1S']) == 0):
return start_combat

if 'healthPercents' in player_json:
last_health_percent = 100
for change in player_json['healthPercents']:
# look for last timestamp before initial time
if change[0] < initial_time:
last_health_percent = change[1]
continue
if change[1] - last_health_percent < 0:
# got dmg
start_combat = change[0]
break
last_health_percent = change[1]
continue
if change[1] - last_health_percent < 0:
# got dmg
start_combat = change[0]
break
last_health_percent = change[1]

# from initial time until end of the fight, check when player dealt (power) dmg the first time
# not using condi, because condis can still tick after a player died
for i in range(math.ceil(initial_time/1000), len(player_json['powerDamage1S'][0])):
if i == 0:
continue
if player_json['powerDamage1S'][0][i] != player_json['powerDamage1S'][0][i-1]:
if start_combat == -1:
start_combat = i*1000
else:
start_combat = min(start_combat, i*1000)
break
if 'powerDamage1S' in player_json and len(player_json['powerDamage1S']) > 0:
for i in range(math.ceil(initial_time/1000), len(player_json['powerDamage1S'][0])):
if i == 0:
continue
if player_json['powerDamage1S'][0][i] != player_json['powerDamage1S'][0][i-1]:
if start_combat == -1:
# if start_combat is -1 so far, the player didn't take damage until now -> this is the start of combat
start_combat = i*1000
else:
# otherwise he took dmg, check which was first
start_combat = min(start_combat, i*1000)
break

if start_combat == -1:
start_combat = initial_time
return start_combat


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file contains the configuration for computing the overview of top stats in arcdps logs as parsed by Elite Insights.
# This file contains the configuration for computing the detailed top stats in arcdps logs as parsed by Elite Insights.
# Copyright (C) 2021 Freya Fleckenstein
#
# This program is free software: you can redistribute it and/or modify
Expand All @@ -13,31 +13,53 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# Note that if you want to know heal_from_regen, you also have to compute hits_from_regen

# possible log levels: "info", "warning", "debug"
# "info" gives information about the current status of the program
# "warning" gives additional information about things that could have gone wrong, but don't necessarily mean the program can't deal with the data (e.g., some players might not be running the healing addon)
# "debug" gives more detailed information about the state of the program and is usually only needed for debugging
log_level = "info"

stats_to_compute = ['dmg_total', 'strips', 'stab', 'cleanses', 'heal_total', 'barrier', 'dist', 'deaths']
stats_to_compute = ['dmg_total', 'dmg_players', 'dmg_other',
'strips', 'cleanses', 'heal_total',
'heal_players', 'heal_other', 'dist', 'stab',
'prot', 'aegis', 'resist', 'regen', 'heal_from_regen',
'hits_from_regen', 'might', 'fury', 'quick',
'alac', 'speed', 'barrier',
'dmg_taken_total', 'dmg_taken_hp_lost',
'dmg_taken_absorbed', 'deaths', 'stripped',
'big_boomer', 'explosive_temper', 'explosive_entrance',
'med_kit']

# How many players will be listed who achieved top stats most often for each stat?
num_players_listed_default = 5
num_players_listed = {'strips': 3, 'stab': 3, 'cleanses': 3, 'heal_total': 3, 'barrier': 3}
num_players_listed_default = 1000
#num_players_listed = {}

# How many players are considered to be "top" in each fight for each stat?
num_players_considered_top_default = 5
num_players_considered_top = {'strips': 3, 'stab': 3, 'cleanses': 3, 'heal_total': 3, 'barrier': 3, 'deaths': 1}
num_players_considered_top = {'strips': 3, 'stab': 3, 'prot': 3, 'aegis': 3, 'resist': 3, 'regen': 3, 'heal_from_regen': 3,
'hits_from_regen': 3, 'might': 3, 'fury': 3, 'quick': 3, 'alac': 3, 'speed': 3, 'cleanses': 3,
'heal': 3, 'barrier': 3, 'deaths': 1, 'big_boomer': 3, 'explosive_temper': 3, 'explosive_entrance': 3,
'med_kit': 3}


# duration_for_averages_default = 'in_combat'
duration_for_averages_default = 'total'
duration_for_averages = {'dist': 'not_running_back'}

# For what portion of all fights does a player need to be there to be considered for "consistency percentage" awards?
attendance_percentage_for_percentage = 50
# For what portion of all fights does a player need to be there to be considered for "top average" awards?
attendance_percentage_for_average = 50
attendance_percentage_for_average = 33

# What portion of the top total player stat does someone need to reach to be considered for total awards?
percentage_of_top_for_consistent = 50
percentage_of_top_for_consistent = 0
# What portion of the total stat of the top consistent player does someone need to reach to be considered for consistency awards?
percentage_of_top_for_total = 50
percentage_of_top_for_total = 0
# What portion of the percentage the top consistent player reached top does someone need to reach to be considered for percentage awards?
percentage_of_top_for_percentage = 50
percentage_of_top_for_percentage = 0

# minimum number of allied players to consider a fight in the stats
min_allied_players = 10
Expand All @@ -46,8 +68,9 @@
# minimum number of enemies to consider a fight in the stats
min_enemy_players = 10

# choose which files to write as results. Options are 'xls' and 'json'.
files_to_write = ['json', 'xls']
# choose which files to write as results and whether to write results to console. Options are 'console', 'txt', 'xls' and 'json'.
files_to_write = ['console', 'txt', 'xls', 'json']
#files_to_write = ['txt', 'xls', 'json']

# names as which each specialization will show up in the stats
profession_abbreviations = {}
Expand Down Expand Up @@ -96,13 +119,36 @@
profession_abbreviations["Scourge"] = "Scourge"
profession_abbreviations["Harbinger"] = "Harbinger"

# name each stat will be written as
# name each stat will be written as in the .xls file
stat_names = {}
stat_names["dmg_total"] = "Total Damage"
stat_names["dmg_players"] = "Player Damage"
stat_names["dmg_other"] = "Other Damage"
stat_names["strips"] = "Boon Strips"
stat_names["stab"] = "Stability Output"
stat_names["prot"] = "Protection Output"
stat_names["aegis"] = "Aegis Output"
stat_names["resist"] = "Resistance Output"
stat_names["regen"] = "Regeneration Output"
stat_names["heal_from_regen"] = "Healing from Regeneration"
stat_names["hits_from_regen"] = "Hits with Regeneration"
stat_names["might"] = "Might Output"
stat_names["fury"] = "Fury Output"
stat_names["alac"] = "Alacrity Output"
stat_names["quick"] = "Quickness Output"
stat_names["speed"] = "Superspeed Output"
stat_names["cleanses"] = "Condition Cleanses"
stat_names["heal_total"] = "Healing"
stat_names["heal_total"] = "Total Healing"
stat_names["heal_players"] = "Player Healing"
stat_names["heal_other"] = "Other Healing"
stat_names["barrier"] = "Barrier"
stat_names["dist"] = "Distance to Tag"
stat_names["dmg_taken_total"] = "Total Damage Taken"
stat_names["dmg_taken_hp_lost"] = "HP lost"
stat_names["dmg_taken_absorbed"] = "Damage absorbed"
stat_names["deaths"] = "Deaths"
stat_names["stripped"] = "Incoming Strips"
stat_names["big_boomer"] = "Big Boomer"
stat_names["explosive_temper"] = "Explosive Temper"
stat_names["explosive_entrance"] = "Explosive Entrance"
stat_names["med_kit"] = "Med Kit"

0 comments on commit 0507416

Please sign in to comment.