def main(argv=None): import argparse from src.parser import OverhealParser parser = OverhealParser( formatter_class=argparse.RawDescriptionHelpFormatter, description="""\ Analyses logs and count up number of overheals. Returns a list of spells and the number of recorded heals, as well as overheal frequencies. Header explaination: #H: Number of heals recorded. No OH: Percentage of heals that had no overheal (underheals). Any OH: Percantage of heals that had 1 or more overheal. Half OH: Percentage of heals that overhealed for at least 50% of the heal value. Full OH: Percentage of heals that overhealed for at least 90% of the heal value. % OHd: Percentage of heal values that were overheal, same overheal percentage shown in WarcraftLogs. """, need_character=True, accept_encounter=True, ) parser.add_argument("--ignore_crit", action="store_true", help="Remove critical heals from analysis") args = parser.parse_args(argv) # print(vars(args)) process_log(args.source, args.character_name, args.ignore_crit, encounter=args.encounter)
def main(argv=None): from src.parser import OverhealParser parser = OverhealParser( description="""Plots probability of overheals for different spells.""", need_character=True, accept_spell_id=True, accept_spell_power=True, ) parser.add_argument("--ignore_crit", action="store_true", help="Remove critical heals from analysis") parser.add_argument("--path") args = parser.parse_args(argv) overheal_probability( args.source, args.character_name, spell_id=args.spell_id, spell_power=args.spell_power, ignore_crit=args.ignore_crit, path=args.path, )
def main(argv=None): from src.parser import OverhealParser parser = OverhealParser( description= "Evaluate 3 piece T1 set. Counts number of times flash heal casts were back-to-back with less than" " 0.1s between.", need_character=True, accept_encounter=True, ) args = parser.parse_args(argv) evaluate_3t1(args.source, args.character_name, encounter_i=args.encounter)
def main(): from src.parser import OverhealParser parser = OverhealParser( description="Analyses logs and gives overheal cdf.", need_character=True, accept_spell_id=True, accept_spell_power=True, ) parser.add_argument("--path", help="Path to output figures too.", default="figs/cdf") args = parser.parse_args() path = args.path overheal_cdf(args.source, args.character_name, args.spell_id, path)
def main(argv=None): from src.parser import OverhealParser parser = OverhealParser( description="Analyses a boss encounter, or whole combat log, and characterise the amount of heal sniping going " "on. Only accepts WoWCombatLog.txt currently.", need_character=False, accept_encounter=True, ) parser.add_argument( "--mark", help="Time-stamp to mark with a line, good for tracking important events, such as the death of a tank.", ) parser.add_argument("--anonymize", action="store_true", help="Anonymizes names for distribution.") parser.add_argument("--all", action="store_true", help="Show all players") args = parser.parse_args(argv) analyse_casts(args.source, encounter=args.encounter, mark=args.mark, anonymize=args.anonymize, all=args.all)
def main(argv=None): from src.parser import OverhealParser parser = OverhealParser(accept_character=True, accept_encounter=True) parser.add_argument("--raid", action="store_true") parser.add_argument("-v", "--verbose", action="store_true", help="Increases verbosity, saves health data.") parser.add_argument("--path") args = parser.parse_args(argv) track_damage_taken( args.source, character_name=args.character_name, encounter=args.encounter, raid=args.raid, verbose=args.verbose, path=args.path, )
def main(argv=None): from src.parser import OverhealParser parser = OverhealParser( description="Analyses logs and gives summary plot.", need_character=True, accept_spell_power=True, accept_encounter=True, ) parser.add_argument("--path") parser.add_argument("--show", action="store_true") args = parser.parse_args(argv) overheal_summary( args.source, args.character_name, spell_power=args.spell_power, path=args.path, show=args.show, encounter=args.encounter, )
def main(argv=None): from src.parser import OverhealParser parser = OverhealParser( description= "Analyses an encounter and prints information about the spells used.", need_character=True, accept_spell_power=True, accept_encounter=True, ) parser.add_argument("-r", "--reduce_crits", action="store_true") parser.add_argument("-Z", "--zandalar_buff", action="store_true") args = parser.parse_args(args=argv) analyse_spell( args.source, args.character_name, spell_power=args.spell_power, encounter=args.encounter, zandalar_buff=args.zandalar_buff, )
def main(argv=None): import os from src.parser import OverhealParser # make sure directories exist os.makedirs("figs/crit", exist_ok=True) parser = OverhealParser( description="""\ Analyses a combat log and calculates the additional healing any crits gave. Counts up the healing and overhealing done by each found crit. Prints out extra healing done by each percentage of crit, on average, and the equivalent +heal worth, for each spell, and for the average spell profile over the whole combat log. """, need_character=True, accept_spell_id=True, accept_encounter=True, ) args = parser.parse_args(argv) overheal_crit(args.source, args.character_name, spell_id=args.spell_id, encounter=args.encounter)
def main(argv=None): from src.parser import OverhealParser parser = OverhealParser(need_character=True, accept_encounter=True, accept_spell_id=True, accept_spell_power=True) parser.add_argument("-v", "--verbose") parser.add_argument("--mana", type=int) args = parser.parse_args(argv) source = args.source encounter = args.encounter spell_power = args.spell_power mana = args.mana if spell_power is None or spell_power == 0: spell_power = 800.0 if mana is None: mana = 8000.0 lines = raw.get_lines(source) # todo: fix # encounter, encounter_lines, encounter_start, encounter_end = encounter_picker(lines, encounter) data = raw.get_processed_lines(lines) events = data.all_events # encounter_time = (encounter_end - encounter_start).total_seconds() mp5 = 40.0 mp5ooc = mp5 + 160.0 character_data_nc = CharacterData(spell_power, 0.0, mp5, mp5ooc, mana) character_data_ac = CharacterData(spell_power, 1.0, mp5, mp5ooc, mana) times, _, deficits, name_dict, _ = raid_damage_taken( events, character_name=args.character_name) # encounter_time = (encounter_end - encounter_start).total_seconds() encounter = 120.0 # optimise_casts(args.character_name, times["all"], deficits, name_dict, character_data, encounter_time, spell_id=args.spell_id, verbose=args.verbose) talents = None sids = { "10917": "Flash Heal (Rank 7)", "10916": "Flash Heal (Rank 6)", "10915": "Flash Heal (Rank 5)", "9474": "Flash Heal (Rank 4)", "9473": "Flash Heal (Rank 3)", "9472": "Flash Heal (Rank 2)", "2061": "Flash Heal (Rank 1)", "2053": "Lesser Heal (Rank 3)", "10965": "Greater Heal (Rank 4)", "10964": "Greater Heal (Rank 3)", "10963": "Greater Heal (Rank 2)", "2060": "Greater Heal (Rank 1)", "6064": "Heal (Rank 4)", "6063": "Heal (Rank 3)", "2055": "Heal (Rank 2)", "2054": "Heal (Rank 1)", } sids = {} names = [] lows = [] highs = [] path = "figs/optimise" for sid in sids: strategy = SingleSpellStrategy(talents, sid) nh_nc, gh_nc = evaluate_casting_strategy( args.character_name, times["all"], deficits, name_dict, character_data_nc, encounter_time, strategy=strategy, verbose=False, show=False, plot=False, path=path, ) # nh_ac, gh_ac = evaluate_casting_strategy( # args.character_name, # times["all"], # deficits, # name_dict, # character_data_ac, # encounter_time, # spell_id=sid, # verbose=False, # show=False, # plot=False, # path=path, # ) lows.append(nh_nc) highs.append(gh_nc) names.append(strategy.name) # Add basic strategy as well strategy = CastingStrategy(talents) nh_nc, gh_nc = evaluate_casting_strategy( args.character_name, times["all"], deficits, name_dict, character_data_nc, encounter_time, strategy=strategy, verbose=False, show=False, plot=False, path=path, ) lows.append(nh_nc) highs.append(gh_nc) names.append(strategy.name) sids = list(map(lambda s: shorten_spell_name(sd.spell_name(s)), sids)) fig, ax = plt.subplots(figsize=(12, 8), constrained_layout=True) ax.bar(names, lows, color="#33cc33", label="Net heal") ax.bar(names, np.subtract(highs, lows), bottom=lows, color="#85e085", label="Overheal") ax.grid(axis="y") ax.set_axisbelow(True) ax.legend() # add labels for rect, low, high in zip(ax.patches, lows, highs): x = rect.get_x() + rect.get_width() / 2 y = low - 300 ax.text(x, y, f"{low/1000:.1f}k", ha="center", va="top") y = high + 200 ax.text(x, y, f"{high/1000:.1f}k", ha="center", va="bottom") character_data_str = str(character_data_nc) ax.set_title(f"Spam cast healing for {encounter}\n{character_data_str}") ax.set_ylabel("Net healing") ax.set_xlabel("Healing strategy") ax.tick_params(axis="x", rotation=70) plt.savefig(f"{path}/overview.png") # plt.show() plt.close(fig) print() h_strat, h_low = max(zip(names, lows), key=lambda x: x[1]) print( f" Highest healing: {h_strat} with {h_low / 1000:.1f}k healing ({h_low / encounter_time:.1f} hps)" ) print()
lines, heal_increase=spell_inc + renew_inc) print() print(f" Estimated Spell crit: {nn_crits / nn_heals:.1%}") print() if __name__ == "__main__": from src.parser import OverhealParser parser = OverhealParser( description= "Analyses logs and and estimates spell power and crit chance.", need_character=True, accept_spell_id=True, ) parser.add_argument("--sh", type=int, help="Levels of Spirital Healing to guess", default=0) parser.add_argument("--ir", type=int, help="Levels of Improved Renew to guess", default=0) args = parser.parse_args() estimate_spell_power(args.source, args.character_name, args.spell_id,