forked from Freyavf/arcdps_top_stats_parser
-
Notifications
You must be signed in to change notification settings - Fork 7
/
TW5_parse_top_stats_detailed.py
2643 lines (2220 loc) · 132 KB
/
TW5_parse_top_stats_detailed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
# parse_top_stats_detailed.py outputs 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
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import argparse
import datetime
import os.path
from os import listdir
import sys
import xml.etree.ElementTree as ET
from enum import Enum
import importlib
import xlwt
from collections import OrderedDict
from TW5_parse_top_stats_tools import *
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='This reads a set of arcdps reports in xml format and generates top stats.')
parser.add_argument('input_directory', help='Directory containing .xml or .json files from arcdps reports')
parser.add_argument('-o', '--output', dest="output_filename", help="Text file to write the computed top stats")
#parser.add_argument('-f', '--input_filetype', dest="filetype", help="filetype of input files. Currently supports json and xml, defaults to json.", default="json")
parser.add_argument('-x', '--xls_output', dest="xls_output_filename", help="xls file to write the computed top stats")
parser.add_argument('-j', '--json_output', dest="json_output_filename", help="json file to write the computed top stats to")
parser.add_argument('-l', '--log_file', dest="log_file", help="Logging file with all the output")
parser.add_argument('-c', '--config_file', dest="config_file", help="Config file with all the settings", default="TW5_parser_config_detailed")
parser.add_argument('-a', '--anonymized', dest="anonymize", help="Create an anonymized version of the top stats. All account and character names will be replaced.", default=False, action='store_true')
args = parser.parse_args()
if not os.path.isdir(args.input_directory):
print("Directory ",args.input_directory," is not a directory or does not exist!")
sys.exit()
if args.output_filename is None:
args.output_filename = args.input_directory+"/TW5_top_stats_detailed.tid"
if args.xls_output_filename is None:
args.xls_output_filename = args.input_directory+"/TW5_top_stats_detailed.xls"
if args.json_output_filename is None:
args.json_output_filename = args.input_directory+"/TW5_top_stats_detailed.json"
if args.log_file is None:
args.log_file = args.input_directory+"/log_detailed.txt"
output = open(args.output_filename, "w",encoding="utf-8")
log = open(args.log_file, "w")
parser_config = importlib.import_module("parser_configs."+args.config_file , package=None)
config = fill_config(parser_config)
if config.use_PlenBot:
PlenBotPath = config.PlenBotPath
getPlenBotLogs(PlenBotPath)
print_string = "Using input directory "+args.input_directory+", writing output to "+args.output_filename+" and log to "+args.log_file
print(print_string)
print_string = "Considering fights with at least "+str(config.min_allied_players)+" allied players and at least "+str(config.min_enemy_players)+" enemies that took longer than "+str(config.min_fight_duration)+" s."
myprint(log, print_string)
players, fights, found_healing, found_barrier, squad_comp, party_comp, 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 = collect_stat_data(args, config, log, args.anonymize)
# create xls file if it doesn't exist
book = xlwt.Workbook(encoding="utf-8")
book.add_sheet("fights overview")
book.save(args.xls_output_filename)
#Create Tid file header to support drag and drop onto html page
myDate = datetime.datetime.now()
myprint(output, 'created: '+myDate.strftime("%Y%m%d%H%M%S"))
myprint(output, 'modified: '+myDate.strftime("%Y%m%d%H%M%S"))
myprint(output, 'creator: '+config.summary_creator)
myprint(output, 'caption: '+myDate.strftime("%Y%m%d")+'-WvW-Log-Review')
myprint(output, 'tags: Logs [['+myDate.strftime("%Y")+'-'+myDate.strftime("%m")+' Log Reviews]]')
myprint(output, 'title: '+myDate.strftime("%Y%m%d")+'-WvW-Log-Review\n')
#End Tid file header
print_string = "__''"+config.summary_title+"''__\n"
myprint(output, print_string)
# print overall stats
overall_squad_stats = get_overall_squad_stats(fights, config)
overall_raid_stats = get_overall_raid_stats(fights)
total_fight_duration = print_total_squad_stats(fights, overall_squad_stats, overall_raid_stats, found_healing, found_barrier, config, output)
include_comp_and_review = config.include_comp_and_review
damage_overview_only = config.damage_overview_only
DmgOverviewTable = {
'dmg': "Damage",
'Pdmg': "Power Dmg",
'Cdmg': "Condi Dmg",
'shieldDmg': "Shield Dmg",
'dmgAll': "Damage All",
'downContribution': "Down Contrib",
'againstDownedDamage': "Dmg to Downed",
'againstDownedCount': "Hits to Downed",
'downs': "Enemies Downed",
'kills': "Enemies Killed"
}
large_items = [
'<$button setTitle="$:/state/curTab" setTo="Squad Composition" selectedClass="" class="btn btn-sm btn-dark" style=""> Squad Composition </$button>',
'<$button setTitle="$:/state/curTab" setTo="Fight Review" selectedClass="" class="btn btn-sm btn-dark" style=""> Fight Review </$button>'
] if include_comp_and_review else []
#Start nav_bar_menu for TW5
MenuTabs = ['General', 'Offensive', 'Defensive', 'Support', 'Boons & Buffs', 'Dashboard']
SubMenuTabs = {
'General': ['Overview', 'Fight Logs', 'Squad Composition', "Party Composition", 'Fight Review', 'Spike Damage', 'Attendance', 'Support', 'Distance to Tag', 'On Tag Review', 'Skill Casts', 'High Scores', 'Gear Buffs', 'Minions', 'Damage Modifiers', 'Top Skill Dmg'],
'Offensive': ['Offensive Stats', 'Damage Overview', 'Player Damage by Skill', 'Down Contribution', 'Enemies Downed', 'Enemies Killed', 'Damage', 'Shield Damage', 'Power Damage', 'Condi Damage', 'Against Downed Damage', 'Against Downed Count', 'Damage All', 'DPSStats', 'Burst Damage', 'Damage with Buffs', 'Control Effects - Out', 'Weapon Swaps'],
'Defensive': ['Defensive Stats', 'Control Effects - In', 'Condition Uptimes'],
'Support': ['Healing', 'Barrier', 'Outgoing Healing', 'Condition Cleanses', 'Duration of Conditions Cleansed', 'Boon Strips', 'Duration of Boons Stripped', 'Illusion of Life', 'Resurrect', 'Downed_Healing', 'Stealth', 'Hide in Shadows', 'FBPages'],
'Boons & Buffs': ['Total Boons', 'Stability', 'Protection', 'Aegis', 'Might', 'Fury', 'Resistance', 'Resolution', 'Quickness', 'Swiftness', 'Superspeed', 'Alacrity', 'Vigor', 'Regeneration', 'Auras - Out', 'Auras - In', 'Personal Buffs', 'Buff Uptime', 'Stacking Buffs'],
'Dashboard': ["Dashboard"]
}
alertColors = ["primary", "danger", "warning", "success", "info", "light"]
excludeForMonthly = ['Squad Composition', "Party Composition", 'Fight Review', 'Spike Damage', 'Outgoing Healing', 'Gear Buffs']
excludeForDmgOverview = ['Down Contribution', 'Enemies Downed', 'Enemies Killed', 'Damage', 'Shield Damage', 'Power Damage', 'Condi Damage', 'Against Downed Damage', 'Against Downed Count', 'Damage All']
for item in MenuTabs:
myprint(output, '<$button class="btn btn-sm btn-dark"> <$action-setfield $tiddler="$:/state/MenuTab" $field="text" $value="'+item+'"/> <$action-setfield $tiddler="$:/state/curTab" $field="text" $value="'+SubMenuTabs[item][0]+'"/> '+item+' </$button>')
for item in MenuTabs:
myprint(output, '<$reveal type="match" state="$:/state/MenuTab" text="'+item+'">')
myprint(output, '\n')
myprint(output, '<<alert-leftbar '+alertColors[MenuTabs.index(item)]+' "'+item+'" width:60%, class:"font-weight-bold">>')
myprint(output, '\n')
myprint(output, '---')
for tab in SubMenuTabs[item]:
if not include_comp_and_review and tab in excludeForMonthly:
continue
if damage_overview_only and tab in excludeForDmgOverview:
continue
myprint(output, '<$button setTitle="$:/state/curTab" setTo="'+tab+'" class="btn btn-sm btn-dark"> '+tab+' </$button>')
myprint(output, '\n')
myprint(output, '</$reveal>')
myprint(output, '\n')
#End nav_bar_menu for TW5
#Overview reveal
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Overview">')
myprint(output, '\n<<alert dark "OVERVIEW" width:60%>>\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
print_fights_overview(fights, overall_squad_stats, overall_raid_stats, config, output)
#End reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
#Fight Logs reveal
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Fight Logs">')
myprint(output, '\n<<alert dark "Fight Logs" width:60%>>\n')
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
myprint(output, "|thead-dark table-caption-top sortable|k")
myprint(output, "|Requires Upload to DPSReport to Elite Insight activated to show links|c")
myprint(output, "|Fight# |Date |Start Time |End Time |GMT |Location |Duration |Link |h")
for fight in Fight_Logs:
print_string="|"
for item in fight:
print_string+=str(item).strip()+" |"
myprint(output, print_string)
#End reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
write_fights_overview_xls(fights, overall_squad_stats, overall_raid_stats, config, args.xls_output_filename)
#Top Damage by Skills for Squad and Enemy
total_Squad_Damage = sum(total_Squad_Skill_Dmg.values())
total_Enemy_Damage = sum(total_Enemy_Skill_Dmg.values())
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Top Skill Dmg">')
myprint(output, '\n<<alert dark "Top Damage by Skill for Squad and Enemy" width:60%>>\n')
myprint(output, "\nCounts based on `player['targetDamageDist']` & `enemy['totalDamageDist']`\n\n")
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
myprint(output, '<div class="flex-row">')
myprint(output, ' <div class="flex-col border">\n\n')
myprint(output, "|table-caption-top|k")
myprint(output, "|Total Damage by Squad Skill Descending (Top 50)|c")
myprint(output, "|thead-dark table-hover|k")
myprint(output, "|#|!Squad Skill Name | !Damage Output| % of Total|h")
#start Squad Skill Damage totals
sorted_squad_skill_dmg = dict(sorted(total_Squad_Skill_Dmg.items(), key=lambda x: x[1], reverse=True))
counter = 0
squadDamageListed = 0
for name in sorted_squad_skill_dmg:
counter +=1
if counter <=50:
squadDamageListed += sorted_squad_skill_dmg[name]
pctDmg = round((sorted_squad_skill_dmg[name]/total_Squad_Damage)*100, 2)
myprint(output,'|'+str(counter)+'|'+name+' | '+my_value(sorted_squad_skill_dmg[name])+'| '+my_value(pctDmg)+'%|')
myprint(output, "| Totals|<| "+my_value(squadDamageListed)+"| "+my_value(round((squadDamageListed/total_Squad_Damage)*100,2))+"%|f")
myprint(output, '\n\n\n')
myprint(output, ' </div>')
myprint(output, '<div class="flex-col border">\n\n')
myprint(output, "|table-caption-top|k")
myprint(output, "|Total Damage by Enemy Skill Descending (Top 50)|c")
myprint(output, "|thead-dark table-hover|k")
myprint(output, "|#|!Squad Skill Name | !Damage Output| % of Total|h")
#start Enemy Skill Damage totals
sorted_enemy_skill_dmg = dict(sorted(total_Enemy_Skill_Dmg.items(), key=lambda x: x[1], reverse=True))
counter = 0
enemyDamageListed = 0
for name in sorted_enemy_skill_dmg:
counter +=1
if counter <=50:
enemyDamageListed += sorted_enemy_skill_dmg[name]
pctDmg = round((sorted_enemy_skill_dmg[name]/total_Enemy_Damage)*100, 2)
myprint(output, '|'+str(counter)+'|'+name+' | '+my_value(sorted_enemy_skill_dmg[name])+'| '+my_value(pctDmg)+'%|')
myprint(output, "| Totals|<| "+my_value(enemyDamageListed)+"| "+my_value(round((enemyDamageListed/total_Enemy_Damage)*100,2))+"%|f")
myprint(output, '\n\n\n')
myprint(output, ' </div>')
myprint(output, '</div>')
#End reveal - Top Damage by Skills for Squad and Enemy
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
#Squad Player Damage by Skills
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Player Damage by Skill">')
myprint(output, '\n<<alert dark "Player Damage by Skill for all Fights" width:60%>>\n')
myprint(output, "\nDamage based on `player['targetDamageDist']`\n\n")
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
#myprint(output, '<div class="flex-row">')
#myprint(output, ' <div class="flex-col">\n\n')
#Start Selection Box
sorted_Player_Damage_by_Skill = OrderedDict(sorted(Player_Damage_by_Skill.items()))
myprint(output, "\n")
myprint(output, "\n")
myprint(output, "<<vspace 25px>>")
myprint(output, "\nSelect Player(s): ^^Ctrl Click to select multiple^^\n")
myprint(output, "<$select tiddler='$:/state/Player_Selected' default='To View Damage by Skill Table' multiple class='thead-dark'>")
myprint(output, "<option disabled>To View Damage by Skill Table</option>")
for item in sorted_Player_Damage_by_Skill:
playerName = sorted_Player_Damage_by_Skill[item]['Name']
playerProf = sorted_Player_Damage_by_Skill[item]['Prof']
playerTotal = sorted_Player_Damage_by_Skill[item]['Total']
if playerTotal < 1:
continue
spacedName = playerName.ljust(21, '.')
myprint(output, f'<option style="font-family: monospace">{spacedName}{playerProf}</option>')
myprint(output, "</$select>")
myprint(output, "\n")
myprint(output, "\n<div>")
myprint(output, "\n<$button class='btn btn-sm btn-dark'><$action-setmultiplefields $tiddler='$:/state/Player_Selected' $fields='[[$:/state/Player_Selected]get[text]enlist-input[]]' $values='[[$:/state/Player_Selected]get[text]enlist-input[]]'/>Compare Selected </$button>")
myprint(output, " ")
myprint(output, "<$button class='btn btn-sm btn-dark'><$action-deletetiddler $tiddler='$:/state/Player_Selected'/>Clear Selected</$button>")
myprint(output, "\n</div>\n")
myprint(output, "---")
myprint(output, "\n")
myprint(output, '\n<div class="flex-row">\n')
#Start Table Generation
for item in sorted_Player_Damage_by_Skill:
playerName = sorted_Player_Damage_by_Skill[item]['Name']
playerProf = sorted_Player_Damage_by_Skill[item]['Prof']
playerTotal = sorted_Player_Damage_by_Skill[item]['Total']
spacedName = playerName.ljust(21, '.')
if playerTotal < 1:
continue
myprint(output, f'<$reveal type="match" stateTitle="$:/state/Player_Selected" stateField="{spacedName}{playerProf}" text="{spacedName}{playerProf}">')
myprint(output, '\n<div class="flex-col">\n\n')
myprint(output, "|thead-dark table-hover|k")
myprint(output, "|@@display:block;width:50px;Player@@ | Profession | Total Damage|h")
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")
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]
pctTotal = round((skillDamage / playerTotal)*100,2)
myprint(output, "|[img width=24 ["+skillIcon+"]] "+skill+" | "+my_value(skillDamage)+"| "+my_value(pctTotal)+"%|")
myprint(output, "\n")
myprint(output, "---")
myprint(output, "\n</div>\n")
myprint(output, "\n</$reveal>\n")
myprint(output, '\n\n\n')
myprint(output, '</div>')
#End reveal - Player Damage by Skills for All Fights
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
#Damage Modifier Data Reveal
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Damage Modifiers">')
myprint(output, '\n<<alert dark "Damage Modifiers across all Fights" width:60%>>\n')
myprint(output, "\nCounts based on `player[incomingDamageModifiersTarget]` & `player[damageModifiersTarget]`\n\n")
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
tabList = ['Shared', 'Profession']
DM_Header = ""
for tab in tabList:
#make reveal button for each modifier tab in tabList
DM_Header += '<$button set="$:/state/damModifiers" class="btn btn-sm btn-dark" setTo="'+tab+'">'+tab+' Damage Modifiers</$button> '
myprint(output, DM_Header)
myprint(output, '\n\n---\n\n')
#Output Shared Modifier Data
modListIn = modifierMap['Incoming']['Shared'].keys()
modListOut = modifierMap['Outgoing']['Shared'].keys()
myprint(output, '\n<$reveal type="match" state="$:/state/damModifiers" text="Shared">\n')
myprint(output, "\n''__Shared Damage Modifiers__''")
myprint(output, "\n---\n\n")
myprint(output, "|table-caption-top|k")
myprint(output, "|Shared Damage Modifiers |c")
myprint(output, "|thead-dark table-hover sortable|k")
header = "|!Player Name | !Profession"
for modifier in modListIn:
modName = modifier
modIcon = modifierMap['Incoming']['Shared'][modifier]
header +=" | ![img width=32 ["+modName+"|"+modIcon+"]]"
for modifier in modListOut:
modName = modifier
modIcon = modifierMap['Outgoing']['Shared'][modifier]
header +=" | ![img width=32 ["+modName+"|"+modIcon+"]]"
header +=" |h"
myprint(output, header)
for player in squadDamageMods:
playerName = squadDamageMods[player]['name']
playerProf = squadDamageMods[player]['profession']
details = "|"+playerName+" | {{"+playerProf+"}}"
for modifier in modListIn:
if modifier in squadDamageMods[player]['Shared']:
hitCount = squadDamageMods[player]['Shared'][modifier]['hitCount']
totalHitCount = squadDamageMods[player]['Shared'][modifier]['totalHitCount']
damageGain = round(squadDamageMods[player]['Shared'][modifier]['damageGain'])
totalDamage = squadDamageMods[player]['Shared'][modifier]['totalDamage']
pctHit = my_value(round((hitCount/totalHitCount)*100,2))+"%"
if totalDamage >0:
pctDmg = my_value(round(damageGain/(totalDamage+abs(damageGain))*100, 2))+"%"
else:
pctDmg = "ToolTip"
tooltip = str(hitCount)+" out of "+str(totalHitCount)+" hits<br>"+pctHit+" hit<br>Pure Damage: "+my_value(damageGain)
detailEntry = '<div class="xtooltip">'+pctDmg+' <span class="xtooltiptext">'+tooltip+'</span></div>'
else:
detailEntry = "-"
details += " | "+detailEntry
for modifier in modListOut:
if modifier in squadDamageMods[player]['Shared']:
hitCount = squadDamageMods[player]['Shared'][modifier]['hitCount']
totalHitCount = squadDamageMods[player]['Shared'][modifier]['totalHitCount']
damageGain = round(squadDamageMods[player]['Shared'][modifier]['damageGain'])
totalDamage = squadDamageMods[player]['Shared'][modifier]['totalDamage']
pctHit = my_value(round((hitCount/totalHitCount)*100,2))+"%"
if totalDamage >0:
pctDmg = my_value(round(damageGain/(totalDamage+abs(damageGain))*100, 2))+"%"
else:
pctDmg = "ToolTip"
tooltip = str(hitCount)+" out of "+str(totalHitCount)+" hits<br>"+pctHit+" hit<br>Pure Damage: "+my_value(damageGain)
detailEntry = '<div class="xtooltip">'+pctDmg+' <span class="xtooltiptext">'+tooltip+'</span></div>'
else:
detailEntry = "-"
details += " | "+detailEntry
details += " |"
myprint(output, details)
myprint(output, '\n</$reveal>\n')
#Output Profession Modifier Data
#modListIn = modifierMap['Incoming']['Prof'].keys()
#modListOut = modifierMap['Outgoing']['Prof'].keys()
myprint(output, '\n<$reveal type="match" state="$:/state/damModifiers" text="Profession">\n')
myprint(output, "\n''__Profession Damage Modifiers__''")
myprint(output, "\n---\n\n")
for prof in profModifiers['Professions']:
myprint(output, '<$button setTitle="$:/state/modifierProf" setTo="'+prof+'" selectedClass="" class="btn btn-sm btn-dark" style=""> '+prof+' {{'+prof+'}} </$button>')
for prof in profModifiers['Professions']:
myprint(output, '\n<$reveal type="match" state="$:/state/modifierProf" text="'+prof+'">\n')
myprint(output, "\n''__"+prof+"__'' {{"+prof+"}}")
myprint(output, "\n---\n\n")
modifierList = profModifiers['Professions'][prof]
header="|Name "
for modifier in modifierList:
if modifier in modifierMap['Incoming']['Prof']:
modName = modifier
modIcon = modifierMap['Incoming']['Prof'][modifier]
else:
modName = modifier
modIcon = modifierMap['Outgoing']['Prof'][modifier]
header +=" | ![img width=32 ["+modName+"|"+modIcon+"]]"
header+=" |h"
myprint(output, header)
for player in squadDamageMods:
playerName = squadDamageMods[player]['name']
playerProf = squadDamageMods[player]['profession']
playerNameProf = playerName+"{{"+playerProf+"}}"
if prof in squadDamageMods[player]['profession']:
details = "|"+playerName
for modifier in profModifiers['Professions'][prof]:
if modifier in squadDamageMods[player]['Prof']:
hitCount = squadDamageMods[player]['Prof'][modifier]['hitCount']
totalHitCount = squadDamageMods[player]['Prof'][modifier]['totalHitCount']
damageGain = round(squadDamageMods[player]['Prof'][modifier]['damageGain'])
totalDamage = squadDamageMods[player]['Prof'][modifier]['totalDamage']
pctHit = my_value(round((hitCount/totalHitCount)*100,2))+"%"
if totalDamage >0:
pctDmg = my_value(round(damageGain/(totalDamage+abs(damageGain))*100, 2))+"%"
else:
pctDmg = "ToolTip"
tooltip = str(hitCount)+" out of "+str(totalHitCount)+" hits<br>"+pctHit+" hit<br>Pure Damage: "+my_value(damageGain)
detailEntry = '<div class="xtooltip">'+pctDmg+' <span class="xtooltiptext">'+tooltip+'</span></div>'
else:
detailEntry = "-"
details += " | "+detailEntry
details += " |"
myprint(output, details)
myprint(output, '\n</$reveal>\n')
#Start Detail output here
myprint(output, '\n</$reveal>\n')
#End reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
#Minion Data Reveal
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Minions">')
myprint(output, '\n<<alert dark "Player created Minion Data from all Fights" width:60%>>\n')
myprint(output, "\nCounts based on `player[minions][combatReplayData]`\n\n")
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
for prof in minion_Data:
myprint(output, '<$button setTitle="$:/state/minionProf" setTo="'+prof+'" selectedClass="" class="btn btn-sm btn-dark" style=""> '+prof+' {{'+prof+'}} </$button>')
for prof in minion_Data:
myprint(output, '\n<$reveal type="match" state="$:/state/minionProf" text="'+prof+'">\n')
myprint(output, "\n''__"+prof+"__'' {{"+prof+"}}")
myprint(output, "\n---\n\n")
minionList = minion_Data[prof]["petsList"]
header="|Name | !Fights | !Duration "
for item in minionList:
header+="| !"+item
header+=" |h"
detail=""
myprint(output, "|thead-dark table-caption-top sortable|k")
myprint(output, '| <<hl "Minion Generation" IndianRed>> |c')
myprint(output, header)
for playerName in minion_Data[prof]["player"]:
minionDuration = 0
minionFights = 0
for nameIndex in players:
if nameIndex.name == playerName and nameIndex.profession == prof:
minionDuration = nameIndex.duration_fights_present
minionFights = nameIndex.num_fights_present
detail +="|"+playerName+" | "+my_value(minionFights)+" | "+my_value(minionDuration)
for item in minionList:
if item in minion_Data[prof]["player"][playerName]:
detail +=" | "+str(minion_Data[prof]["player"][playerName][item])
else:
detail +=" | 0 "
detail+=" |\n"
myprint(output, detail)
myprint(output, '\n</$reveal>\n')
#End reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
#High Scores reveal
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="High Scores">')
myprint(output, '\n<<alert dark "High Scores from all Fights" width:60%>>\n')
myprint(output, "\nStat per second based on `player.stats_per_fight[fight_number]['time_active']`\n\n")
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
offensiveHighScores = ['dmg_PS', 'downContribution_PS', 'downs_PS', 'kills_PS']
supportHighScores = ['rips_PS', 'cleanses_PS', 'heal_PS', 'barrier_PS']
defensiveHighScores = ['dodges_PS', 'evades_PS', 'blocks_PS', 'invulns_PS']
labelTopFive = {'dmg': 'Damage', 'dmg_PS': 'Damage per Second', 'downContribution': 'Down Contribution', 'downContribution_PS': 'Down Contribution per Second', 'downs': 'Downs', 'downs_PS': 'Downs per Second', 'invulns_PS': 'Invulnerable per Second', 'invulns': 'Invulnerable', 'kills': 'Kills', 'kills_PS': 'Kills per Second', 'rips': 'Boon Strips', 'rips_PS': 'Boon Strips per Second', 'cleanses': 'Condition Cleanses', 'cleanses_PS': 'Condition Cleanses per Second', 'heal': 'Healing', 'heal_PS': 'Healing per Second', 'barrier': 'Barrier', 'barrier_PS': 'Barrier per Second', 'dodges': 'Dodges', 'dodges_PS': 'Dodges per Second', 'evades': 'Evades', 'evades_PS': 'Evades per Second', 'blocks': 'Blocks', 'blocks_PS': 'Blocks per Second', 'downed': 'Downed', 'interupted_PS': 'Downed per Second'}
#myprint(output, '\n\n<<h1 "Offensive High Scores" IndianRed>>\n\n')
myprint(output, '<div class="flex-row">\n\n')
for stat in offensiveHighScores:
myprint(output, ' <div class="flex-col">\n')
myprint(output, "|thead-dark table-caption-top sortable|k")
#<<hl "Simple highlight" aqua>>
myprint(output, '| <<hl "'+labelTopFive[stat]+'" IndianRed>> |c')
myprint(output, "|Player |Fight | Score|h")
if stat in HighScores:
sortedHighScore = sorted(HighScores[stat].items(), key = lambda x:x[1], reverse = True)
for item, value in sortedHighScore:
print_string="|"
print_string+=item+" | "
print_string+=my_value(round(value,2))+"|"
myprint(output, print_string)
myprint(output, '\n </div>')
myprint(output, '\n </div>')
#myprint(output, '\n\n<<h1 "Support High Scores" LightGreen>>\n\n')
myprint(output, '<div class="flex-row">\n\n')
for stat in supportHighScores:
myprint(output, ' <div class="flex-col">\n')
myprint(output, "|thead-dark table-caption-top sortable|k")
myprint(output, '| <<hl "'+labelTopFive[stat]+'" LightGreen>> |c')
myprint(output, "|Player |Fight | Score|h")
if stat in HighScores:
sortedHighScore = sorted(HighScores[stat].items(), key = lambda x:x[1], reverse = True)
for item, value in sortedHighScore:
print_string="|"
print_string+=item+" | "
print_string+=my_value(round(value,2))+"|"
myprint(output, print_string)
myprint(output, '\n </div>')
myprint(output, '\n </div>')
#myprint(output, '\n\n<<h1 "Defensive High Scores" LightSalmon>>\n\n')
myprint(output, '<div class="flex-row">\n\n')
for stat in defensiveHighScores:
myprint(output, ' <div class="flex-col">\n')
myprint(output, "|thead-dark table-caption-top sortable|k")
myprint(output, '| <<hl "'+labelTopFive[stat]+'" LightSalmon>> |c')
myprint(output, "|Player |Fight | Score|h")
if stat in HighScores:
sortedHighScore = sorted(HighScores[stat].items(), key = lambda x:x[1], reverse = True)
for item, value in sortedHighScore:
print_string="|"
print_string+=item+" | "
print_string+=my_value(round(value,2))+"|"
myprint(output, print_string)
myprint(output, '\n </div>')
myprint(output, '\n </div>')
#End reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
#End High Scores reveal
#Gear Buffs reveal
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Gear Buffs">')
myprint(output, '\n<<alert dark "Gear Buff Data from all Fights" width:60%>>\n')
myprint(output, "\nStat per second based on `player.stats_per_fight[fight_number]['time_active']`\n\n")
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
myprint(output, "!!Gear Buff Uptimes\n\n")
Header = "|thead-dark table-hover table-caption-top sortable|k\n"
Header += "|Mouseover for details available - Sortable on header click|c\n"
Header +="|!Player |"
sortedUsedRelic = OrderedDict(sorted(usedRelicBuff.items()))
for relicName in sortedUsedRelic:
headerIcon = ' ![img width=24 ['+relicName+'|'+sortedUsedRelic[relicName]+']] |'
Header += headerIcon
Header +="h"
myprint(output, Header)
details=""
for player in RelicDataBuffs:
if RelicDataBuffs[player]:
details += "|"+player
else:
continue
for relic in sortedUsedRelic:
if relic in RelicDataBuffs[player] and RelicDataBuffs[player][relic]['buffDuration']:
numFights = "Fights: "+str(len(RelicDataBuffs[player][relic]['fightTime']))
totalUptime = (sum(RelicDataBuffs[player][relic]['buffDuration']) / sum(RelicDataBuffs[player][relic]['fightTime']))*100
avgStacks = "Average Stacks: "+str(round(sum(RelicDataBuffs[player][relic]['buffStacks'])/len(RelicDataBuffs[player][relic]['buffStacks']), 3))
hitData = str(sum(RelicDataBuffs[player][relic]['hitCount']))+" out of "+str(sum(RelicDataBuffs[player][relic]['totalHits']))+" hits"
damageGain = "Damage Gain: "+my_value(round(sum(RelicDataBuffs[player][relic]['damageGain'])))
if sum(RelicDataBuffs[player][relic]['buffStacks']):
tooltip = avgStacks+" <br> "+numFights
else:
tooltip = numFights
if sum(RelicDataBuffs[player][relic]['hitCount']) >0:
tooltip += " <br> "+hitData
if sum(RelicDataBuffs[player][relic]['damageGain']) >0:
tooltip += " <br> "+damageGain
details += ' | <div class="xtooltip">'+str(round(totalUptime,2))+'% <span class="xtooltiptext">'+tooltip+'</span></div>'
else:
details +=' | '
details +="|\n"
myprint(output, details)
myprint(output, "\n\n---\n\n")
myprint(output, "!!Relic Skill Data\n\n")
RelicTableKeys = ['casts', 'totalDamage', 'hits', 'connectedHits', 'crit', 'glance', 'flank', 'missed', 'invulned', 'interrupted', 'evaded', 'blocked', 'shieldDamage', 'critDamage']
Header = "|thead-dark table-hover table-caption-top sortable|k\n"
Header += "|Sortable Table, click header to sort|c\n"
Header +="|!Player |!Relic |"
for key in RelicTableKeys:
Header +="!"+ key+" |"
Header +="h"
myprint(output, Header)
details=""
for player in RelicDataSkills:
for relic in RelicDataSkills[player]:
details +="|"+player
details += ' |[img width=24 ['+relic+' |'+usedRelicSkill[relic]+']] - '+relic
for stat in RelicTableKeys:
if stat in RelicDataSkills[player][relic]:
details += " | "+my_value(RelicDataSkills[player][relic][stat])
else:
details += " | N/A"
details+="|\n"
myprint(output, details)
myprint(output, "\n\n---\n\n")
#End reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, '</$reveal>')
#End Gear Buffs Reveal
#Squad Spike Damage
if include_comp_and_review:
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Spike Damage">\n')
myprint(output, '\n<<alert dark "SPIKE DAMAGE" width:60%>>\n')
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
output_string = "\nSquad Damage output by second (Mouse Scroll to zoom in/out at location)\n"
myprint(output, output_string)
myprint(output, '<$echarts $text={{'+myDate.strftime("%Y%m%d%H%M")+'_spike_damage_heatmap_ChartData}} $height="800px" $theme="dark"/>')
#end reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, "</$reveal>\n")
# end Squad Spike Damage
#Outgoing Healing and Barrier by Target
if include_comp_and_review:
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Outgoing Healing">\n')
myprint(output, '\n<<alert dark "Outgoing Healing/Barrier by Target" width:60%>>\n')
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
for name in OutgoingHealing:
myprint(output, '<$button setTitle="$:/state/outgoingHealing" setTo="'+name.split("|")[0]+'_'+OutgoingHealing[name]['Prof']+'" selectedClass="" class="btn btn-sm btn-dark" style=""> '+name.split("|")[0]+'{{'+OutgoingHealing[name]['Prof']+'}} </$button>')
for name in OutgoingHealing:
totalHealingOutput = 0
totalBarrierOutput = 0
for skill in OutgoingHealing[name]['Skills']:
totalHealingOutput += OutgoingHealing[name]['Skills'][skill][1]
for skill in OutgoingHealing[name]['Skills_Barrier']:
totalBarrierOutput += OutgoingHealing[name]['Skills_Barrier'][skill][1]
healerMaxGroup = max(OutgoingHealing[name]['Group'], key=OutgoingHealing[name]['Group'].get)
myprint(output, '<$reveal type="match" state="$:/state/outgoingHealing" text="'+name.split("|")[0]+'_'+OutgoingHealing[name]['Prof']+'">')
myprint(output, '<div style="overflow-x:auto;">\n\n')
myprint(output, "\n|Healer Name | Party|h")
myprint (output, "|"+name.split("|")[0]+" | "+str(healerMaxGroup)+" |")
myprint(output, "\n\n---\n")
myprint(output, '<div class="flex-row">')
myprint(output, ' <div class="flex-col border">\n')
myprint(output, "|thead-dark table-caption-top sortable|k")
myprint(output, '| <<hl "Total Healing & Barrier by Player" teal>> |c')
myprint(output, "|!Player Name | !Party | !Healing| !Barrier|h")
for target in OutgoingHealing[name]['Targets']:
targetMaxGroup = max(OutgoingHealing[name]['Targets'][target]['Group'], key=OutgoingHealing[name]['Targets'][target]['Group'].get)
if OutgoingHealing[name]['Targets'][target]['Healing'] >0 or OutgoingHealing[name]['Targets'][target]['Barrier']:
myprint(output, "|"+target+" | "+str(targetMaxGroup)+" | "+my_value(OutgoingHealing[name]['Targets'][target]['Healing'])+"| "+my_value(OutgoingHealing[name]['Targets'][target]['Barrier'])+"|")
myprint(output, '\n\n</div>\n\n')
myprint(output, ' <div class="flex-col border">\n')
myprint(output, "|thead-dark table-caption-top sortable|k")
myprint(output, '| <<hl "Total Healing by Skill" lightgreen>> |c')
myprint(output, "|!Skill |!Skill Name | !Hits| !Total Healing| !Heal/Hit| !Pct|h")
for skill in OutgoingHealing[name]['Skills']:
hits=OutgoingHealing[name]['Skills'][skill][0]
heals=OutgoingHealing[name]['Skills'][skill][1]
skillName = skill_Dict[str(skill)]['name']
healString = "|"+str(skill)+" |"+str(skillName)+" | "+my_value(hits)+"| "+my_value(heals)+"| "+my_value(round(heals/hits,2))+"| "+my_value(round(heals/totalHealingOutput*100,2))+"%|"
myprint(output, healString)
myprint(output, '\n\n</div>\n\n')
myprint(output, ' <div class="flex-col border">\n')
myprint(output, "|thead-dark table-caption-top sortable|k")
myprint(output, '| <<hl "Total Barrier by Skill" lightblue>> |c')
myprint(output, "|!Skill |!Skill Name | !Hits| !Total Barrier| !Barrier/Hit| !Pct|h")
for skill in OutgoingHealing[name]['Skills_Barrier']:
hits=OutgoingHealing[name]['Skills_Barrier'][skill][0]
heals=OutgoingHealing[name]['Skills_Barrier'][skill][1]
skillName = skill_Dict[str(skill)]['name']
healString = "|"+str(skill)+" |"+str(skillName)+" | "+my_value(hits)+"| "+my_value(heals)+"| "+my_value(round(heals/hits,2))+"| "+my_value(round(heals/totalBarrierOutput*100,2))+"%|"
myprint(output, healString)
myprint(output, '\n</div>\n</div>\n</div>\n')
myprint(output, '</$reveal>')
#end reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, "</$reveal>\n")
#Total Boons
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Total Boons">\n')
myprint(output, '\n<<alert dark "Total Boon Generation" width:60%>>\n')
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
playerCount = len(players)
calcHeight = str(playerCount*25)
myprint(output, "\n!!Total Boon Generation\n")
myprint(output, '<$echarts $text={{'+myDate.strftime("%Y%m%d%H%M")+'_Total_Boon_Generation_BarChartData}} $height="'+calcHeight+'px" $theme="dark"/>')
#end reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, "</$reveal>\n")
# end Total Boons
#Personal Buffs
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Personal Buffs">\n')
myprint(output, '\n<<alert dark "Personal Buffs Uptime %" width:60%>>\n')
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
BP_Header = ""
Prof_String = ""
Output_String = ""
myprint(output, "|thead-dark|k")
for profession in buffs_personal:
BP_Header += '<$button set="$:/state/PersonalBuffs" class="btn btn-sm btn-dark" setTo="'+profession+'">{{'+profession+'}}'+profession+'</$button> '
myprint(output, BP_Header)
myprint(output, '\n\n---\n\n')
for profession in buffs_personal:
Prof_Header = "|{{"+profession+"}}Name | !Active Time|"
for buff in buffs_personal[profession]['buffList']:
icon = skill_Dict[str(buff)]['icon']
tooltip = skill_Dict[str(buff)]['name']
Prof_Header += '![img width=24 tooltip="'+tooltip+'" ['+icon+']]|'
myprint(output, '\n<$reveal type="match" state="$:/state/PersonalBuffs" text="'+profession+'">\n')
myprint(output, "|thead-dark sortable|k")
myprint(output, Prof_Header+"h")
for playerName in buffs_personal[profession]['player']:
buffUptimes="|"+playerName+" "
playerActiveTime = 0
#get activeTime from players
for player in players:
if player.name == playerName and player.profession == profession:
playerActiveTime = player.duration_active
buffUptimes+="| "+str(playerActiveTime)
for buff in buffs_personal[profession]['buffList']:
if buff in buffs_personal[profession]['player'][playerName].keys() and playerActiveTime>0:
buffUptimes+="| "+str(round((buffs_personal[profession]['player'][playerName][buff]/playerActiveTime)*100,2))
else:
buffUptimes+="| 0.00"
myprint(output, buffUptimes+"|")
myprint(output, "\n</$reveal>\n")
#end reveal
myprint(output, '\n\n</div>\n\n')
myprint(output, "</$reveal>\n")
# end Personal Bufffs
#Skill casts
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Skill Casts">\n')
myprint(output, '\n!!!Skill casts / minute\n')
myprint(output, '\n!!!Excludes Auto Attack\n')
myprint(output, '\n---\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
BP_Header = ""
SkillCast = OrderedDict(sorted(prof_role_skills.items()))
myprint(output, "|thead-dark|k")
for skillRole in SkillCast:
BP_Header += '<$button set="$:/state/ProfSkillUsage" class="btn btn-sm btn-dark" setTo="'+skillRole+'">{{'+skillRole.split(' ')[0]+'}}'+skillRole+'</$button> '
myprint(output, BP_Header)
myprint(output, '\n\n---\n\n')
for skillRole in SkillCast:
myprint(output, '\n<$reveal type="match" state="$:/state/ProfSkillUsage" text="'+skillRole+'">\n')
myprint(output, '\n{{'+skillRole.split(' ')[0]+'}}'+skillRole+'\n')
skillOrder = sorted(SkillCast[skillRole]['castTotals'].items(), key = lambda x:x[1], reverse = True)
myprint(output, "|thead-dark sortable|k")
print_string = ("|Name | Fights| ActiveTime| ")
countSkills = 0
for key, value in skillOrder:
if countSkills <30:
skillIcon = skill_Dict[key]['icon']
skillName = skill_Dict[key]['name'].replace('"',"'")
print_string += '![img width=24 tooltip="'+skillName+'" ['+skillIcon+']]|'
countSkills +=1
print_string +="h"
myprint(output, print_string)
for playerName in SkillCast[skillRole]['player']:
playerFights = SkillCast[skillRole]['player'][playerName]['Fights']
playerActive = SkillCast[skillRole]['player'][playerName]['ActiveTime']
print_string = "|"+playerName+" | "+str(playerFights)+"| "+str(playerActive)+"| "
playerSkills = 0
for key, value in skillOrder:
if playerSkills <30:
if key in SkillCast[skillRole]['player'][playerName]['Skills']:
totalCasts = SkillCast[skillRole]['player'][playerName]['Skills'][str(key)]
CastPerMinute = totalCasts/(playerActive/60)
else:
CastPerMinute = 0.00
playerSkills +=1
print_string += '%.2f' % CastPerMinute+'|'
myprint(output, print_string)
myprint(output, '\n</$reveal>\n')
myprint(output, '\n\n</div>\n\n')
myprint(output, '\n</$reveal>\n')
# end Skill casts
if include_comp_and_review:
#Squad Composition Testing
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Squad Composition">')
myprint(output, '\n<<alert dark "SQUAD COMPOSITION" width:60%>>\n')
myprint(output, '\n<div class="flex-row">\n <div class="flex-col-2 border">\n\n')
sort_order = ['Firebrand', 'Scrapper', 'Spellbreaker', "Herald", "Chronomancer", "Reaper", "Scourge", "Dragonhunter", "Guardian", "Elementalist", "Tempest", "Revenant", "Weaver", "Willbender", "Renegade", "Vindicator", "Warrior", "Berserker", "Bladesworn", "Engineer", "Holosmith", "Mechanist", "Ranger", "Druid", "Soulbeast", "Untamed", "Thief", "Daredevil", "Deadeye", "Specter", "Catalyst", "Mesmer", "Mirage", "Virtuoso", "Necromancer", "Harbinger"]
myprint(output, '<div style="overflow-x:auto;">\n\n')
output_string = ""
for fight in squad_comp:
output_string1 = "\n|thead-dark|k\n"
output_string2 = ""
output_string1 += "|Fight |"
output_string2 += "|"+str(fight+1)
for prof in sort_order:
if prof in squad_comp[fight]:
output_string1 += " {{"+str(prof)+"}} |"
output_string2 += " | "+str(squad_comp[fight][prof])
output_string1 += "h"
output_string2 += " |\n"
myprint(output, output_string1)
myprint(output, output_string2)
myprint(output, '\n\n</div>\n\n')
myprint(output, '\n</div>\n <div class="flex-col-2 border">\n')
myprint(output, '\n!!!ENEMY COMPOSITION\n')
myprint(output, '<div style="overflow-x:auto;">\n\n')
enemy_squad_num = 0
for fight in fights:
if fight.skipped:
enemy_squad_num += 1
continue
enemy_squad_num += 1
output_string1 = "\n|thead-dark|k\n"
output_string2 = ""
output_string1 += "|Fight |"
output_string2 += "|"+str(enemy_squad_num)
for prof in sort_order:
if prof in fight.enemy_squad:
output_string1 += " {{"+str(prof)+"}} |"
output_string2 += " | "+str(fight.enemy_squad[prof])
output_string1 += "h"
output_string2 += " |\n"
myprint(output, output_string1)
myprint(output, output_string2)
myprint(output, '\n\n</div>\n\n')
myprint(output, '\n</div>\n</div>\n')
#end reveal
print_string = "\n</$reveal>\n"
myprint(output, print_string)
# end Squad Composition insert
#Party Composition Testing
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Party Composition">')
myprint(output, '\n<<alert dark "PARTY COMPOSITION by FIGHT" width:60%>>\n')
myprint(output, '\n\n')
output_string = ""
for fight in party_comp:
myprint(output, "|thead-dark table-hover table-caption-top w-75|k")
myprint(output, "|Fight Number: "+str(fight+1)+" |c")
myprint(output, "| Party | Members |<|<|<|<|h")
#Set details
details = ""
for party in party_comp[fight]:
party_list = party_comp[fight][party]
chunk_size = 5
while party_list:
chunk, party_list = party_list[:chunk_size], party_list[chunk_size:]
details +="| "+str(party)
for i in range(chunk_size):
if i >=len(chunk):
details+= " | "
else:
details+= " |{{"+str(chunk[i][0])+"}} "+str(chunk[i][1])
details+=" |\n"
myprint(output, details)
myprint(output, '\n\n')
#end reveal
myprint(output, "\n</$reveal>\n")
# end Party Composition insert
#start Fight DPS Review insert
myprint(output, '<$reveal type="match" state="$:/state/curTab" text="Fight Review">')
myprint(output, '\n<<alert dark "Damage Output Review by Fight-#" width:60%>>\n\n')
FightNum=0
for fight in fights:
FightNum = FightNum+1
if not fight.skipped:
myprint(output, '<$button setTitle="$:/state/curFight" setTo="Fight-'+str(FightNum)+'" selectedClass="" class="btn btn-sm btn-dark" style=""> Fight-'+str(FightNum)+' </$button>')
myprint(output, '\n---\n')
FightNum = 0
for fight in fights:
FightNum = FightNum+1
if not fight.skipped:
myprint(output, '<$reveal type="match" state="$:/state/curFight" text="Fight-'+str(FightNum)+'">')
myprint(output, '\n<div class="flex-row">\n <div class="flex-col">\n')
#begin fight summary
myprint(output, "|thead-dark table-hover|k")
myprint(output, "|Fight Summary:| #"+str(FightNum)+"|h")
myprint(output, '|Squad Members: |'+str(fight.allies)+' |')
myprint(output, '|Squad Deaths: |'+str(fight.total_stats['deaths'])+' |')
myprint(output, '|Enemies: |'+str(fight.enemies)+' |')
myprint(output, '|Enemies Downed: |'+str(fight.downs)+' |')
myprint(output, '|Enemies Killed: |'+str(fight.kills)+' |')
myprint(output, '|Fight Duration: |'+str(fight.duration)+' |')
myprint(output, '|Fight End Time: |'+str(fight.end_time)+' |')
myprint(output, '|Squad All Damage: |'+my_value(fight.total_stats['dmgAll'])+' |')
myprint(output, '|Damage Delta (Target/All): |'+my_value(fight.total_stats['dmg'] - fight.total_stats['dmgAll'])+' |')
myprint(output, '|Squad Target Damage: |'+my_value(fight.total_stats['dmg'])+' |')
if fight.total_stats['dmg']:
myprint(output, '|Squad Shield Damage: |'+my_value(fight.total_stats['shieldDmg'])+' ('+my_value(round(fight.total_stats['shieldDmg']/fight.total_stats['dmg']*100,1))+'%) |')
else:
myprint(output, '|Squad Shield Damage: |'+my_value(fight.total_stats['shieldDmg'])+' ('+my_value(round(fight.total_stats['shieldDmg']/1*100,1))+'%) |')
myprint(output, '|Enemy Target Damage: |'+my_value(fight.total_stats['dmg_taken'])+' |')
if fight.total_stats['dmg_taken']:
myprint(output, '|Enemy Shield Damage: |'+my_value(fight.total_stats['barrierDamage'])+' ('+my_value(round(fight.total_stats['barrierDamage']/fight.total_stats['dmg_taken']*100,1))+'%) |')
else:
myprint(output, '|Enemy Shield Damage: |'+my_value(fight.total_stats['barrierDamage'])+' ('+my_value(round(fight.total_stats['barrierDamage']/1*100,1))+'%) |')
myprint(output, '</div>\n\n')
#Insert Part Composition
myprint(output, '<div class="flex-col-3">\n')
myprint(output, "|thead-dark table-hover table-caption-top w-75|k")
myprint(output, "| Party | Party Members |<|<|<|<|h")
#Set details
details = ""