-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
979 lines (889 loc) · 45 KB
/
index.html
File metadata and controls
979 lines (889 loc) · 45 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PoE Damage Calculator (Dark Mode)</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
background-color: #1a1a1a; /* Dark background */
color: #e0e0e0; /* Light text */
line-height: 1.4;
}
.container {
background-color: #2a2a2a; /* Slightly lighter dark background for container */
padding: 15px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Darker shadow */
max-width: 960px;
margin: 20px auto;
box-sizing: border-box;
}
h1 {
color: #f0f0f0; /* Lighter heading color */
text-align: center;
margin-top: 10px;
margin-bottom: 20px;
font-size: 1.8em;
}
.input-group {
margin-bottom: 10px; /* Default margin for vertical stacking */
flex-basis: 100%;
}
.input-group label {
display: block;
margin-bottom: 3px;
font-weight: bold;
font-size: 0.95em;
color: #e0e0e0; /* Light label text */
}
.input-group input[type="range"] {
width: 100%;
-webkit-appearance: none;
height: 6px;
border-radius: 5px;
background: #555; /* Darker range track */
outline: none;
opacity: 0.8; /* Slightly less opaque */
transition: opacity .2s;
}
.input-group input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: #66bb6a; /* Green thumb for good contrast */
cursor: pointer;
}
.input-group input[type="range"][readonly] {
background: #444; /* Darker background for readonly range */
cursor: default;
}
.input-group input[type="range"][readonly]::-webkit-slider-thumb {
background: #777; /* Darker thumb for readonly range */
cursor: default;
}
.input-group input[type="number"] {
width: calc(100% - 16px);
padding: 6px 8px;
border: 1px solid #555; /* Darker border */
border-radius: 4px;
font-size: 15px;
background-color: #3a3a3a; /* Dark input background */
color: #f0f0f0; /* Light input text */
}
/* General select styling (inherited by guard skills unless overridden) */
.input-group select {
width: 100%;
padding: 6px 8px; /* Standard padding for selects */
border: 1px solid #555;
border-radius: 4px;
font-size: 15px;
background-color: #3a3a3a;
color: #f0f0f0;
appearance: none; /* Remove default select arrow */
-webkit-appearance: none;
-moz-appearance: none;
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23e0e0e0%22%20d%3D%22M287%2C114.7L159.2%2C242.5c-4.5%2C4.5-10.6%2C6.7-16.8%2C6.7s-12.3-2.2-16.8-6.7L5.4%2C114.7c-9.1-9.1-9.1-23.7%2C0-32.8c9.1-9.1%2C23.7-9.1%2C32.8%2C0l110.1%2C110.1L254.2%2C81.9c9.1-9.1%2C23.7-9.1%2C32.8%2C0C296.1%2C91%2C296.1%2C105.6%2C287%2C114.7z%22%2F%3E%3C%2Fsvg%3E'); /* Custom arrow */
background-repeat: no-repeat;
background-position: right 8px center;
background-size: 12px;
}
/* Style for disabled/readonly inputs in dark mode */
.input-group input[readonly],
.input-group select[readonly] {
background-color: #444 !important; /* Even darker for disabled */
color: #999 !important; /* Greyed out text */
cursor: not-allowed;
opacity: 0.6;
}
.input-group input[type="range"][readonly]::-webkit-slider-thumb {
background: #777 !important;
}
.output-group {
margin-top: 20px;
padding: 10px;
background-color: #385038; /* Darker green for output */
border: 1px solid #5a705a; /* Darker green border */
border-radius: 8px;
text-align: center;
clear: both;
width: 100%;
box-sizing: border-box;
position: sticky;
bottom: 0;
z-index: 100;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2); /* Darker shadow */
color: #f0f0f0; /* Light text for output */
}
.output-group p {
margin: 5px 0;
}
.output-group strong {
font-size: 1.3em;
color: #8bc34a; /* Lighter green for strong text */
}
.output-group span {
font-size: 0.9em;
color: #d0d0d0; /* Slightly darker light text */
}
.section-header {
margin-top: 20px;
margin-bottom: 10px;
font-size: 1.1em;
font-weight: bold;
color: #bbb; /* Lighter grey for section headers */
border-bottom: 1px solid #444; /* Darker border */
padding-bottom: 3px;
}
/* Flexbox styling for paired inputs (2 per row for Physical section) - this is no longer used for phys mit */
.physical-pair {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 15px;
margin-bottom: 10px;
background-color: #333; /* Darker background for this row */
padding: 10px;
border-radius: 5px;
box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}
.physical-pair .input-group {
margin-bottom: 0;
flex-basis: calc(50% - 7.5px);
}
/* Flexbox for elemental/chaos conversion pairs - now vertical */
.elemental-pair {
display: flex;
flex-direction: column; /* Stack children vertically */
}
.elemental-pair .input-group {
margin-bottom: 10px; /* Space between the 'taken as' and 'resist' inputs */
flex-basis: auto; /* Allow items to take natural height */
width: 100%; /* Ensure inputs take full width within their group */
}
/* Remove margin-bottom from the last input-group in elemental-pair */
.elemental-pair .input-group:last-child {
margin-bottom: 0;
}
/* New Flexbox styling for 3 inputs in a row - this is now replaced for guard skills */
.three-column-row {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 15px;
margin-bottom: 10px;
background-color: #333; /* Darker background for input sections */
padding: 10px;
border-radius: 5px;
box-shadow: inset 0 0 5px rgba(0,0,0,0.1); /* Darker inset shadow */
}
.three-column-row .input-group {
margin-bottom: 0;
flex-basis: calc((100% - 30px) / 3);
}
/* Adjusted specifically for the guard skill active/level group */
.three-column-row .guard-skill-controls {
display: flex; /* Make this a flex container */
align-items: center; /* Vertically center items */
gap: 10px; /* Space between checkbox and select */
flex-basis: calc((100% - 30px) / 3);
margin-bottom: 0;
}
.three-column-row .guard-skill-controls select {
flex-grow: 1; /* Allow select to fill available space */
width: auto; /* Override default 100% to work with flex-grow */
}
.three-column-row .input-group input[type="number"],
.three-column-row .input-group input[type="range"] {
width: calc(100% - 16px);
}
/* Adjust width for number inputs inside the flex items that have 2 columns */
.physical-pair .input-group input[type="number"] {
width: calc(100% - 16px);
}
/* Ensure inputs in the elemental-pair take full width now that they are stacked */
.elemental-pair .input-group input[type="number"],
.elemental-pair .input-group input[type="range"] {
width: calc(100% - 16px);
}
/* Additional output for Armour's dynamic PDR */
#armourPDRDisplay {
font-size: 0.75em; /* Made font size slightly smaller */
color: #aaa; /* Lighter grey for sub-info */
margin-top: 3px;
/* Added min-height to ensure consistent space even if text is short */
min-height: 1.2em; /* Adjust as needed based on desired line height */
}
/* Checkbox styling within an input group */
.checkbox-group {
display: flex;
align-items: center;
margin-top: 5px; /* Adjust spacing as needed */
font-size: 0.9em;
}
.checkbox-group input[type="checkbox"] {
width: auto; /* Allow checkbox to take natural width */
margin-right: 5px;
transform: scale(1.2); /* Slightly larger checkbox */
}
/* NEW: Container for the 4 damage type groups to make them horizontal */
#elementalChaosGroupsContainer {
display: flex;
flex-wrap: wrap; /* Allows wrapping on smaller screens */
gap: 15px; /* Spacing between the four groups */
margin-bottom: 10px; /* Space below this whole section */
}
/* NEW: Styling for individual damage type groupings - now also controls width */
.damage-type-group {
background-color: #333; /* Darker background for each group */
padding: 10px;
border-radius: 5px;
box-shadow: inset 0 0 5px rgba(0,0,0,0.1); /* Subtle inset shadow */
flex-basis: calc(25% - 11.25px); /* 4 items per row with 15px gap (3 gaps = 45px / 4 items) */
box-sizing: border-box; /* Include padding in flex-basis calculation */
}
/* NEW: Container for the individual Physical Mitigation "stubs" */
#physicalMitigationStubsContainer {
display: flex;
flex-wrap: wrap; /* Allows wrapping on smaller screens */
gap: 15px; /* Spacing between the stubs */
margin-bottom: 10px;
}
/* NEW: Styling for individual Physical Mitigation "stubs" */
.physical-mitigation-stub {
background-color: #333; /* Darker background for each stub */
padding: 10px;
border-radius: 5px;
box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
flex-basis: calc(25% - 11.25px); /* 4 items per row with 15px gap (3 gaps = 45px / 4 items) */
box-sizing: border-box;
}
/* Ensure input groups within this new wrapper still align as 2 columns */
.damage-type-group .input-group,
.physical-mitigation-stub .input-group {
/* Handled by .elemental-pair .input-group and .input-group */
margin-bottom: 0; /* Remove default input-group margin for these, as padding handles spacing */
}
/* NEW: Container for Incoming Damage and Total PDR at the very top */
#main-damage-info-container {
display: flex;
justify-content: space-between;
gap: 15px;
margin-bottom: 20px; /* More space before next section */
background-color: #333;
padding: 15px;
border-radius: 8px;
box-shadow: inset 0 0 7px rgba(0,0,0,0.2);
}
#main-damage-info-container .input-group {
margin-bottom: 0; /* Override default margin */
flex-basis: calc(50% - 7.5px); /* Two items per row */
}
#main-damage-info-container .input-group label {
font-size: 1.0em; /* Slightly larger labels for prominence */
}
/* NEW: Container for Guard Skill stubs */
#guardSkillStubsContainer {
display: flex;
justify-content: space-between;
gap: 15px;
margin-bottom: 10px;
}
/* Style for individual guard skill stub */
.guard-skill-stub {
background-color: #333;
padding: 10px;
border-radius: 5px;
box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
flex-basis: calc(50% - 7.5px); /* Two items per row */
box-sizing: border-box;
display: flex; /* Use flexbox for internal layout */
flex-direction: column; /* Stack elements vertically */
gap: 5px; /* Space between internal elements */
}
/* Adjust specific input group within guard skill stub */
.guard-skill-stub .input-group {
margin-bottom: 0; /* Remove default margin */
}
.guard-skill-stub .guard-skill-controls {
display: flex;
align-items: center; /* Vertically center items */
justify-content: space-between; /* Distribute space between active/level parts */
gap: 10px; /* Space between checkbox-group and level elements */
flex-wrap: nowrap; /* Prevent wrapping on smaller screens for this specific row */
margin-bottom: 0; /* Remove default input-group margin */
}
.guard-skill-stub .guard-skill-controls .checkbox-group {
margin-top: 0;
flex-shrink: 0; /* Prevent checkbox-group from shrinking */
display: flex; /* Make checkbox-group itself a flex container */
align-items: center; /* Align checkbox and label */
gap: 5px; /* Space between checkbox input and its label */
font-size: 0.95em; /* Explicit font size for consistency */
}
.guard-skill-stub .guard-skill-controls label[for^="moltenShellLevel"],
.guard-skill-stub .guard-skill-controls label[for^="immortalCallLevel"] {
margin-bottom: 0;
white-space: nowrap; /* Prevent "Level:" from wrapping */
flex-shrink: 0; /* Prevent "Level:" label from shrinking */
font-size: 0.95em; /* Explicit font size for consistency */
padding-left: 5px; /* Added padding-left to give some space */
}
.guard-skill-stub .guard-skill-controls select {
flex-grow: 1; /* Allow select to fill remaining space */
width: auto; /* Override default 100% to work with flex-grow */
max-width: 100px; /* Adjusted to give more space for the arrow */
font-size: 0.95em; /* Explicit font size for consistency */
/* Removed height and line-height, using padding for visual height */
padding: 5px 8px; /* Adjusted padding to control visual height, allowing space for arrow */
}
/* New styling for the rows containing the stat values within guard skills */
.guard-skill-stats-row {
display: flex;
justify-content: space-between;
gap: 10px; /* Space between the two input groups */
width: 100%; /* Take full width of the parent stub */
}
.guard-skill-stats-row .input-group {
flex-basis: calc(50% - 5px); /* Two items per row with gap */
margin-bottom: 0; /* Remove default input-group margin */
}
.guard-skill-stats-row .input-group input[type="number"] {
width: calc(100% - 16px); /* Adjust width to fit within new flex-basis */
}
/* Media Queries for Mobile Responsiveness */
@media (max-width: 768px) {
body {
margin: 0;
}
.container {
margin: 0;
border-radius: 0;
box-shadow: none;
padding: 10px;
}
h1 {
font-size: 1.5em;
margin-bottom: 15px;
}
.input-group label {
font-size: 0.9em;
}
.input-group input[type="number"],
.input-group input[type="range"],
.input-group select {
font-size: 14px;
}
/* Adjust flex direction and basis for mobile */
.elemental-pair,
.physical-pair,
.three-column-row, /* This rule is mostly obsolete now but kept for safety */
#elementalChaosGroupsContainer,
#physicalMitigationStubsContainer,
#main-damage-info-container,
#guardSkillStubsContainer
{
flex-direction: column;
gap: 10px;
padding: 10px;
}
.elemental-pair .input-group,
.physical-pair .input-group,
.three-column-row .input-group, /* This rule is mostly obsolete now but kept for safety */
.damage-type-group,
.physical-mitigation-stub,
#main-damage-info-container .input-group,
.guard-skill-stub
{
flex-basis: 100%;
margin-bottom: 0; /* No extra margin, let gap handle it */
}
/* Specific adjustment for guard skill controls on mobile */
.guard-skill-stub .guard-skill-controls {
flex-direction: row; /* Keep them in a row on mobile */
flex-wrap: wrap; /* Allow wrapping of the whole control group if space is very limited */
align-items: center; /* Center items vertically */
justify-content: space-between; /* Space out items if they wrap */
gap: 5px; /* Reduce gap on mobile */
}
.guard-skill-stub .guard-skill-controls .checkbox-group {
flex-basis: auto; /* Allow natural width */
min-width: unset; /* Remove any minimum width if set elsewhere */
font-size: 0.9em; /* Slightly smaller font for mobile */
}
.guard-skill-stub .guard-skill-controls select {
flex-grow: 1;
width: auto;
max-width: none; /* Remove max-width on mobile to allow it to expand more */
font-size: 0.9em; /* Slightly smaller font for mobile */
padding: 4px 6px; /* Adjusted padding for mobile */
}
.guard-skill-stub .guard-skill-controls label[for^="moltenShellLevel"],
.guard-skill-stub .guard-skill-controls label[for^="immortalCallLevel"] {
flex-shrink: 0;
font-size: 0.9em; /* Slightly smaller font for mobile */
padding-left: 0; /* Remove padding-left on mobile if space is tight */
}
/* Adjustments for mobile responsiveness on guard skill stats rows */
.guard-skill-stats-row {
flex-direction: column; /* Stack them vertically on mobile */
gap: 5px; /* Reduce gap on mobile */
}
.guard-skill-stats-row .input-group {
flex-basis: 100%; /* Each takes full width on mobile */
}
.output-group {
padding: 8px;
font-size: 0.9em;
}
.output-group strong {
font-size: 1.2em;
}
/* Re-add margin for visual separation if gap isn't enough on mobile for stubs */
.damage-type-group,
.physical-mitigation-stub,
.guard-skill-stub {
margin-bottom: 10px;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Path of Exile Physical Damage Reduction Calculator</h1>
<div id="main-damage-info-container">
<div class="input-group">
<label for="incomingPhysDamage">Incoming Physical Damage:</label>
<input type="number" id="incomingPhysDamage" min="0" value="1000">
</div>
<div class="input-group">
<label for="totalPhysDR">Total Physical DR (%):</label>
<input type="number" id="totalPhysDR" min="0" max="90" value="0" readonly>
</div>
</div>
<div class="section-header">Physical Mitigation Details</div>
<div id="physicalMitigationStubsContainer">
<div class="physical-mitigation-stub">
<div class="input-group">
<label for="armour">Armour:</label>
<input type="number" id="armour" min="0" value="0">
<div id="armourPDRDisplay"></div>
</div>
</div>
<div class="physical-mitigation-stub">
<div class="input-group">
<label for="physDRGearMods">Phys DR Gear Mods (%):</label>
<input type="number" id="physDRGearMods" min="0" max="90" value="0">
</div>
</div>
<div class="physical-mitigation-stub">
<div class="input-group">
<label for="enduranceCharges">Endurance Charges: <span id="enduranceChargesValue">0</span></label>
<input type="range" id="enduranceCharges" min="0" max="12" value="0">
</div>
</div>
<div class="physical-mitigation-stub">
<div class="input-group">
<label for="flatPhysTaken">Minus Flat Phys Taken:</label>
<input type="number" id="flatPhysTaken" min="0" value="0">
</div>
</div>
</div>
<div class="section-header">Damage Conversion & Resistances</div>
<div id="elementalChaosGroupsContainer">
<div class="damage-type-group">
<div class="elemental-pair">
<div class="input-group">
<label for="physTakenFire">% Phys to Fire:</label>
<input type="number" id="physTakenFire" min="0" max="100" value="0">
</div>
<div class="input-group">
<label for="fireResist">Fire Resist (%): <span id="fireResistValue">75</span>%</label>
<input type="range" id="fireResist" min="0" max="90" value="75">
</div>
</div>
</div>
<div class="damage-type-group">
<div class="elemental-pair">
<div class="input-group">
<label for="physTakenCold">% Phys to Cold:</label>
<input type="number" id="physTakenCold" min="0" max="100" value="0">
</div>
<div class="input-group">
<label for="coldResist">Cold Resist (%): <span id="coldResistValue">75</span>%</label>
<input type="range" id="coldResist" min="0" max="90" value="75">
</div>
</div>
</div>
<div class="damage-type-group">
<div class="elemental-pair">
<div class="input-group">
<label for="physTakenLightning">% Phys to Lightning:</label>
<input type="number" id="physTakenLightning" min="0" max="100" value="0">
</div>
<div class="input-group">
<label for="lightningResist">Lightning Resist (%): <span id="lightningResistValue">75</span>%</label>
<input type="range" id="lightningResist" min="0" max="90" value="75">
</div>
</div>
</div>
<div class="damage-type-group">
<div class="elemental-pair">
<div class="input-group">
<label for="physTakenChaos">% Phys to Chaos:</label>
<input type="number" id="physTakenChaos" min="0" max="100" value="0">
</div>
<div class="input-group">
<label for="chaosResist">Chaos Resist (%): <span id="chaosResistValue">0</span>%</label>
<input type="range" id="chaosResist" min="-60" max="90" value="0">
<div class="checkbox-group">
<input type="checkbox" id="chaosInoculation">
<label for="chaosInoculation">Chaos Inoculation</label>
</div>
</div>
</div>
</div>
</div>
<div class="section-header">Guard Skills</div>
<div id="guardSkillStubsContainer">
<div class="guard-skill-stub">
<div class="guard-skill-controls input-group">
<div class="checkbox-group">
<input type="checkbox" id="moltenShellActive">
<label for="moltenShellActive">Molten Shell Active</label>
</div>
<label for="moltenShellLevel" style="margin-bottom:0;">Level:</label>
<select id="moltenShellLevel">
</select>
</div>
<div class="guard-skill-stats-row">
<div class="input-group">
<label for="moltenShellAddedArmour">MS Added Armour:</label>
<input type="number" id="moltenShellAddedArmour" min="0" value="0" readonly>
</div>
<div class="input-group">
<label for="moltenShellAbsorptionRate">MS % Absorbed:</label>
<input type="number" id="moltenShellAbsorptionRate" min="0" max="100" value="0" readonly>
</div>
</div>
</div>
<div class="guard-skill-stub">
<div class="guard-skill-controls input-group">
<div class="checkbox-group">
<input type="checkbox" id="immortalCallActive">
<label for="immortalCallActive">Immortal Call Active</label>
</div>
<label for="immortalCallLevel" style="margin-bottom:0;">Level:</label>
<select id="immortalCallLevel">
</select>
</div>
<div class="guard-skill-stats-row">
<div class="input-group">
<label for="immortalCallPhysDR">IC Phys DR (%):</label>
<input type="number" id="immortalCallPhysDR" min="0" max="100" value="0" readonly>
</div>
<div class="input-group">
<label for="immortalCallEleDR">IC Ele DR (%):</label>
<input type="number" id="immortalCallEleDR" min="0" max="100" value="0" readonly>
</div>
</div>
</div>
</div>
</div>
<div class="output-group">
<p>Final Damage Received: <strong id="finalDamage">0</strong></p>
<p> (Breakdown: <span id="finalPhysDmg">0</span> Physical, <span id="finalFireDmg">0</span> Fire, <span id="finalColdDmg">0</span> Cold, <span id="finalLightningDmg">0</span> Lightning, <span id="finalChaosDmg">0</span> Chaos)</p>
<p id="moltenShellTakenOutput" style="font-size:0.8em; color:#d0d0d0;"></p>
</div>
<script>
const totalPhysDRInput = document.getElementById('totalPhysDR');
const incomingPhysDamageInput = document.getElementById('incomingPhysDamage');
const enduranceChargesInput = document.getElementById('enduranceCharges');
const enduranceChargesValueSpan = document.getElementById('enduranceChargesValue');
const flatPhysTakenInput = document.getElementById('flatPhysTaken');
const physTakenFireInput = document.getElementById('physTakenFire');
const physTakenColdInput = document.getElementById('physTakenCold');
const physTakenLightningInput = document.getElementById('physTakenLightning');
const physTakenChaosInput = document.getElementById('physTakenChaos');
const chaosInoculationInput = document.getElementById('chaosInoculation');
const physDRGearModsInput = document.getElementById('physDRGearMods');
const fireResistInput = document.getElementById('fireResist');
const fireResistValueSpan = document.getElementById('fireResistValue');
const coldResistInput = document.getElementById('coldResist');
const coldResistValueSpan = document.getElementById('coldResistValue');
const lightningResistInput = document.getElementById('lightningResist');
const lightningResistValueSpan = document.getElementById('lightningResistValue');
const chaosResistInput = document.getElementById('chaosResist');
const chaosResistValueSpan = document.getElementById('chaosResistValue');
const armourInput = document.getElementById('armour');
const armourPDRDisplay = document.getElementById('armourPDRDisplay');
const finalDamageOutput = document.getElementById('finalDamage');
const finalPhysDmgSpan = document.getElementById('finalPhysDmg');
const finalFireDmgSpan = document.getElementById('finalFireDmg');
const finalColdDmgSpan = document.getElementById('finalColdDmg');
const finalLightningDmgSpan = document.getElementById('finalLightningDmg');
const finalChaosDmgSpan = document.getElementById('finalChaosDmg');
// Guard Skill elements
const moltenShellActiveInput = document.getElementById('moltenShellActive');
const moltenShellLevelSelect = document.getElementById('moltenShellLevel');
const moltenShellAddedArmourInput = document.getElementById('moltenShellAddedArmour');
const moltenShellAbsorptionRateInput = document.getElementById('moltenShellAbsorptionRate');
const moltenShellTakenOutput = document.getElementById('moltenShellTakenOutput');
const immortalCallActiveInput = document.getElementById('immortalCallActive');
const immortalCallLevelSelect = document.getElementById('immortalCallLevel');
const immortalCallPhysDRInput = document.getElementById('immortalCallPhysDR');
const immortalCallEleDRInput = document.getElementById('immortalCallEleDR');
// Molten Shell Level Data
const moltenShellLevels = {
1: { addedArmour: 115 },
2: { addedArmour: 141 },
3: { addedArmour: 171 },
4: { addedArmour: 204 },
5: { addedArmour: 233 },
6: { addedArmour: 285 },
7: { addedArmour: 330 },
8: { addedArmour: 379 },
9: { addedArmour: 441 },
10: { addedArmour: 504 },
11: { addedArmour: 592 },
12: { addedArmour: 680 },
13: { addedArmour: 779 },
14: { addedArmour: 858 },
15: { addedArmour: 963 },
16: { addedArmour: 1077 },
17: { addedArmour: 1166 },
18: { addedArmour: 1254 },
19: { addedArmour: 1341 },
20: { addedArmour: 1421 }
};
// Immortal Call Level Data
const immortalCallLevels = {
1: { lessEle: 25, lessPhys: 25 },
2: { lessEle: 25, lessPhys: 26 },
3: { lessEle: 26, lessPhys: 26 },
4: { lessEle: 26, lessPhys: 27 },
5: { lessEle: 27, lessPhys: 27 },
6: { lessEle: 27, lessPhys: 28 },
7: { lessEle: 28, lessPhys: 28 },
8: { lessEle: 28, lessPhys: 29 },
9: { lessEle: 29, lessPhys: 29 },
10: { lessEle: 29, lessPhys: 30 },
11: { lessEle: 30, lessPhys: 30 },
12: { lessEle: 30, lessPhys: 31 },
13: { lessEle: 31, lessPhys: 31 },
14: { lessEle: 31, lessPhys: 32 },
15: { lessEle: 32, lessPhys: 32 },
16: { lessEle: 32, lessPhys: 33 },
17: { lessEle: 33, lessPhys: 33 },
18: { lessEle: 33, lessPhys: 34 },
19: { lessEle: 34, lessPhys: 34 },
20: { lessEle: 34, lessPhys: 35 }
};
// Populate Molten Shell Level Select
for (let i = 1; i <= 20; i++) {
const option = document.createElement('option');
option.value = i;
option.textContent = `Level ${i}`;
moltenShellLevelSelect.appendChild(option);
}
moltenShellLevelSelect.value = 20; // Default to max level
// Populate Immortal Call Level Select
for (let i = 1; i <= 20; i++) {
const option = document.createElement('option');
option.value = i;
option.textContent = `Level ${i}`;
immortalCallLevelSelect.appendChild(option);
}
immortalCallLevelSelect.value = 20; // Default to max level
// Function to handle mutual exclusivity of guard skills
function handleGuardSkillToggle(toggledSkillId) {
const guardSkills = [
{ id: 'moltenShellActive', input: moltenShellActiveInput },
{ id: 'immortalCallActive', input: immortalCallActiveInput }
];
guardSkills.forEach(skill => {
if (skill.id !== toggledSkillId) {
skill.input.checked = false;
}
});
calculateDamage();
}
function calculateDamage() {
let incomingDamage = parseFloat(incomingPhysDamageInput.value) || 0;
let enduranceCharges = parseInt(enduranceChargesInput.value) || 0;
let flatPhysTaken = parseFloat(flatPhysTakenInput.value) || 0;
let physTakenFire = parseFloat(physTakenFireInput.value) || 0;
let physTakenCold = parseFloat(physTakenColdInput.value) || 0;
let physTakenLightning = parseFloat(physTakenLightningInput.value) || 0;
let physTakenChaos = parseFloat(physTakenChaosInput.value) || 0;
let baseArmour = parseFloat(armourInput.value) || 0;
let physDRGearMods = parseFloat(physDRGearModsInput.value) || 0;
let fireResist = parseFloat(fireResistInput.value) || 0;
let coldResist = parseFloat(coldResistInput.value) || 0;
let lightningResist = parseFloat(lightningResistInput.value) || 0;
let chaosResist = parseFloat(chaosResistInput.value) || 0;
// Molten Shell variables
let moltenShellActive = moltenShellActiveInput.checked;
let selectedMoltenShellLevel = parseInt(moltenShellLevelSelect.value);
let msAddedArmour = 0;
let msAbsorptionRate = 0;
// Immortal Call variables
let immortalCallActive = immortalCallActiveInput.checked;
let selectedImmortalCallLevel = parseInt(immortalCallLevelSelect.value);
let icLessPhys = 0;
let icLessEle = 0;
// Update Molten Shell readonly inputs based on active status and level
if (moltenShellActive) {
const levelData = moltenShellLevels[selectedMoltenShellLevel];
if (levelData) {
msAddedArmour = levelData.addedArmour;
msAbsorptionRate = 75; // Fixed at 75% for all levels
}
moltenShellAddedArmourInput.value = msAddedArmour;
moltenShellAbsorptionRateInput.value = msAbsorptionRate;
} else {
moltenShellAddedArmourInput.value = 0;
moltenShellAbsorptionRateInput.value = 0;
}
// Update Immortal Call readonly inputs based on active status and level
if (immortalCallActive) {
const levelData = immortalCallLevels[selectedImmortalCallLevel];
if (levelData) {
icLessPhys = levelData.lessPhys;
icLessEle = levelData.lessEle;
}
immortalCallPhysDRInput.value = icLessPhys;
immortalCallEleDRInput.value = icLessEle;
} else {
immortalCallPhysDRInput.value = 0;
immortalCallEleDRInput.value = 0;
}
let totalDamageTakenByMoltenShell = 0;
let effectiveArmour = baseArmour;
// Add MS flat armour to total for PDR calculation IF MS is active
if (moltenShellActive) {
effectiveArmour += msAddedArmour;
}
enduranceChargesValueSpan.textContent = enduranceCharges;
fireResistValueSpan.textContent = fireResist;
coldResistValueSpan.textContent = coldResist;
lightningResistValueSpan.textContent = lightningResist;
chaosResistValueSpan.textContent = chaosResist;
// Handle Chaos Inoculation
if (chaosInoculationInput.checked) {
chaosResistInput.readOnly = true;
chaosResistInput.value = 100;
chaosResist = 100;
} else {
chaosResistInput.readOnly = false;
chaosResistInput.value = parseFloat(chaosResistInput.value) || 0;
chaosResist = parseFloat(chaosResistInput.value) || 0;
}
// Ensure total conversion doesn't exceed 100%
let totalConversionPercent = physTakenFire + physTakenCold + physTakenLightning + physTakenChaos;
if (totalConversionPercent > 100) {
let ratio = 100 / totalConversionPercent;
physTakenFire *= ratio;
physTakenCold *= ratio;
physTakenLightning *= ratio;
physTakenChaos *= ratio;
physTakenFireInput.value = physTakenFire.toFixed(2);
physTakenColdInput.value = physTakenCold.toFixed(2);
physTakenLightningInput.value = physTakenLightning.toFixed(2);
physTakenChaosInput.value = physTakenChaos.toFixed(2);
}
let damageConvertedToFire = incomingDamage * (physTakenFire / 100);
let damageConvertedToCold = incomingDamage * (physTakenCold / 100);
let damageConvertedToLightning = incomingDamage * (physTakenLightning / 100);
let damageConvertedToChaos = incomingDamage * (physTakenChaos / 100);
let rawPhysicalDamageAfterConversion = Math.max(0, incomingDamage - (damageConvertedToFire + damageConvertedToCold + damageConvertedToLightning + damageConvertedToChaos));
let armourPDR = 0;
if (effectiveArmour > 0 && rawPhysicalDamageAfterConversion > 0) { // Only calculate if both are > 0
armourPDR = (effectiveArmour / (effectiveArmour + (10 * rawPhysicalDamageAfterConversion))) * 100;
armourPDR = Math.min(90, armourPDR);
}
// Always display the PDR, even if 0, to maintain consistent height
armourPDRDisplay.textContent = `PDR from Armour: ${armourPDR.toFixed(2)}% (vs ${rawPhysicalDamageAfterConversion.toFixed(0)} phys, with ${effectiveArmour.toFixed(0)} effective armour)`;
let endurancePhysDR = enduranceCharges * 4;
let combinedPhysicalDR = armourPDR + endurancePhysDR + physDRGearMods;
combinedPhysicalDR = Math.min(90, combinedPhysicalDR);
totalPhysDRInput.value = combinedPhysicalDR.toFixed(2);
// Apply "less" Physical Damage from Immortal Call
let effectivePhysicalDamage = rawPhysicalDamageAfterConversion * (1 - (combinedPhysicalDR / 100));
if (immortalCallActive) {
effectivePhysicalDamage *= (1 - (icLessPhys / 100));
}
effectivePhysicalDamage = Math.max(0, effectivePhysicalDamage - flatPhysTaken);
let mitigatedFireDamage = damageConvertedToFire * (1 - (fireResist / 100));
let mitigatedColdDamage = damageConvertedToCold * (1 - (coldResist / 100));
let mitigatedLightningDamage = damageConvertedToLightning * (1 - (lightningResist / 100));
let mitigatedChaosDamage;
if (chaosInoculationInput.checked) {
mitigatedChaosDamage = 0;
} else {
mitigatedChaosDamage = damageConvertedToChaos * (1 - (chaosResist / 100));
}
// Endurance Charges also apply to elemental resistances (but not chaos)
let enduranceEleDRFactor = (1 - (enduranceCharges * 0.04));
enduranceEleDRFactor = Math.max(0, enduranceEleDRFactor);
mitigatedFireDamage *= enduranceEleDRFactor;
mitigatedColdDamage *= enduranceEleDRFactor;
mitigatedLightningDamage *= enduranceEleDRFactor;
// Apply "less" Elemental Damage from Immortal Call (after resistances and endurance charge scaling)
if (immortalCallActive) {
mitigatedFireDamage *= (1 - (icLessEle / 100));
mitigatedColdDamage *= (1 - (icLessEle / 100));
mitigatedLightningDamage *= (1 - (icLessEle / 100));
}
// Calculate total damage *before* Molten Shell absorption
let totalDamageBeforeMoltenShell = effectivePhysicalDamage + mitigatedFireDamage + mitigatedColdDamage + mitigatedLightningDamage + mitigatedChaosDamage;
let finalDamage = totalDamageBeforeMoltenShell;
// Apply Molten Shell absorption if active
if (moltenShellActive) {
const MS_MAX_CAP = 5000;
let msAbsorptionCap = Math.min(0.10 * effectiveArmour, MS_MAX_CAP);
let damageMoltenShellAttemptsToAbsorb = totalDamageBeforeMoltenShell * (msAbsorptionRate / 100);
totalDamageTakenByMoltenShell = Math.min(damageMoltenShellAttemptsToAbsorb, msAbsorptionCap);
finalDamage = totalDamageBeforeMoltenShell - totalDamageTakenByMoltenShell;
moltenShellTakenOutput.textContent = `Molten Shell absorbed: ${totalDamageTakenByMoltenShell.toFixed(2)} damage`;
} else {
moltenShellTakenOutput.innerHTML = ' ';
}
finalDamageOutput.textContent = Math.max(0, finalDamage).toFixed(2);
finalPhysDmgSpan.textContent = effectivePhysicalDamage.toFixed(2);
finalFireDmgSpan.textContent = mitigatedFireDamage.toFixed(2);
finalColdDmgSpan.textContent = mitigatedColdDamage.toFixed(2);
finalLightningDmgSpan.textContent = mitigatedLightningDamage.toFixed(2);
finalChaosDmgSpan.textContent = mitigatedChaosDamage.toFixed(2);
}
// Add all event listeners
incomingPhysDamageInput.addEventListener('input', calculateDamage);
enduranceChargesInput.addEventListener('input', calculateDamage);
flatPhysTakenInput.addEventListener('input', calculateDamage);
physTakenFireInput.addEventListener('input', calculateDamage);
physTakenColdInput.addEventListener('input', calculateDamage);
physTakenLightningInput.addEventListener('input', calculateDamage);
physTakenChaosInput.addEventListener('input', calculateDamage);
chaosInoculationInput.addEventListener('change', calculateDamage);
armourInput.addEventListener('input', calculateDamage);
physDRGearModsInput.addEventListener('input', calculateDamage);
fireResistInput.addEventListener('input', calculateDamage);
coldResistInput.addEventListener('input', calculateDamage);
lightningResistInput.addEventListener('input', calculateDamage);
chaosResistInput.addEventListener('input', calculateDamage);
// Guard Skill event listeners (with mutual exclusivity)
moltenShellActiveInput.addEventListener('change', () => handleGuardSkillToggle('moltenShellActive'));
moltenShellLevelSelect.addEventListener('change', calculateDamage);
immortalCallActiveInput.addEventListener('change', () => handleGuardSkillToggle('immortalCallActive'));
immortalCallLevelSelect.addEventListener('change', calculateDamage);
// Initial calculation on load
calculateDamage();
</script>
</body>
</html>