@blizzhackers/d2data 2.5.0 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/compile.js CHANGED
@@ -133,9 +133,12 @@ files.forEach(fn => {
133
133
 
134
134
  if (key !== undefined) {
135
135
  if (key !== '') {
136
- if (obj[key]) {
137
- throw new Error('Duplicate key ' + JSON.stringify(key) + ' in ' + fn);
138
- } else {
136
+ while (obj[key]) {
137
+ console.warn('Duplicate key ' + JSON.stringify(key) + ' in ' + fn);
138
+ key += ' [dup]';
139
+ }
140
+
141
+ {
139
142
  let tmp = {};
140
143
 
141
144
  for (let c = 0; c < header.length; c++) {
@@ -625,6 +628,13 @@ tcprecalc['Duriel - Base']['droprate'][6] *= 0.23562610229276895 / 0.28604061515
625
628
  tcprecalc['Duriel - Base']['droprate'][7] *= 0.23562610229276895 / 0.28604061515129975;
626
629
  tcprecalc['Duriel - Base']['droprate'][8] *= 0.23562610229276895 / 0.28604061515129975;
627
630
 
631
+ tcprecalc['Duriel Desecrated A']['droprate'] = { ...tcprecalc['Duriel']['droprateRoot'] };
632
+ tcprecalc['Duriel - Base Desecrated A']['droprate'] = { ...tcprecalc['Duriel - Base']['droprate'] };
633
+ tcprecalc['Duriel Desecrated B']['droprate'] = { ...tcprecalc['Duriel']['droprateRoot'] };
634
+ tcprecalc['Duriel - Base Desecrated B']['droprate'] = { ...tcprecalc['Duriel - Base']['droprate'] };
635
+ tcprecalc['Duriel Desecrated C']['droprate'] = { ...tcprecalc['Duriel']['droprateRoot'] };
636
+ tcprecalc['Duriel - Base Desecrated C']['droprate'] = { ...tcprecalc['Duriel - Base']['droprate'] };
637
+
628
638
  tcprecalc['Duriel (N)']['droprateRoot'][1] *= 0.40188714943604026;
629
639
  tcprecalc['Duriel (N)']['droprateRoot'][2] *= 0.3016508805227563;
630
640
  tcprecalc['Duriel (N)']['droprateRoot'][3] *= 0.28809929433644293;
@@ -642,6 +652,13 @@ tcprecalc['Duriel (N) - Base']['droprate'][6] *= 0.23562610229276895 / 0.2860406
642
652
  tcprecalc['Duriel (N) - Base']['droprate'][7] *= 0.23562610229276895 / 0.28604061515129975;
643
653
  tcprecalc['Duriel (N) - Base']['droprate'][8] *= 0.23562610229276895 / 0.28604061515129975;
644
654
 
655
+ tcprecalc['Duriel (N) Desecrated A']['droprate'] = { ...tcprecalc['Duriel (N)']['droprateRoot'] };
656
+ tcprecalc['Duriel (N) - Base Desecrated A']['droprate'] = { ...tcprecalc['Duriel (N) - Base']['droprate'] };
657
+ tcprecalc['Duriel (N) Desecrated B']['droprate'] = { ...tcprecalc['Duriel (N)']['droprateRoot'] };
658
+ tcprecalc['Duriel (N) - Base Desecrated B']['droprate'] = { ...tcprecalc['Duriel (N) - Base']['droprate'] };
659
+ tcprecalc['Duriel (N) Desecrated C']['droprate'] = { ...tcprecalc['Duriel (N)']['droprateRoot'] };
660
+ tcprecalc['Duriel (N) - Base Desecrated C']['droprate'] = { ...tcprecalc['Duriel (N) - Base']['droprate'] };
661
+
645
662
  tcprecalc['Duriel (H)']['droprateRoot'][1] *= 0.3977971198210286;
646
663
  tcprecalc['Duriel (H)']['droprateRoot'][2] *= 0.30109536777656887;
647
664
  tcprecalc['Duriel (H)']['droprateRoot'][3] *= 0.28836833573076587;
@@ -659,6 +676,15 @@ tcprecalc['Duriel (H) - Base']['droprate'][6] *= 0.23562610229276895 / 0.2864503
659
676
  tcprecalc['Duriel (H) - Base']['droprate'][7] *= 0.23562610229276895 / 0.28645033061957725;
660
677
  tcprecalc['Duriel (H) - Base']['droprate'][8] *= 0.23562610229276895 / 0.28645033061957725;
661
678
 
679
+ tcprecalc['Duriel (H) Desecrated Five']['droprate'] = { ...tcprecalc['Duriel (H)']['droprateRoot'] };
680
+ tcprecalc['Duriel (H) - Base Desecrated A']['droprate'] = { ...tcprecalc['Duriel (H) - Base']['droprate'] };
681
+ tcprecalc['Duriel (H) Desecrated Town Portal']['droprate'] = { ...tcprecalc['Duriel (H)']['droprateRoot'] };
682
+ tcprecalc['Duriel (H) - Base Desecrated B']['droprate'] = { ...tcprecalc['Duriel (H) - Base']['droprate'] };
683
+ tcprecalc['Duriel (H) Desecrated Scrolls']['droprate'] = { ...tcprecalc['Duriel (H)']['droprateRoot'] };
684
+ tcprecalc['Duriel (H) - Base Desecrated C']['droprate'] = { ...tcprecalc['Duriel (H) - Base']['droprate'] };
685
+ tcprecalc['Duriel (H) Desecrated Incoming']['droprate'] = { ...tcprecalc['Duriel (H)']['droprateRoot'] };
686
+ tcprecalc['Duriel (H) - Base Desecrated D']['droprate'] = { ...tcprecalc['Duriel (H) - Base']['droprate'] };
687
+
662
688
  tcprecalc['Durielq']['droprateRoot'][1] *= 0.5236458617828885;
663
689
  tcprecalc['Durielq']['droprateRoot'][2] *= 0.3778815510942014;
664
690
  tcprecalc['Durielq']['droprateRoot'][3] *= 0.3148960979106187;
@@ -711,7 +737,7 @@ tcprecalc['Durielq (H) - Base']['droprate'][7] *= 0.23562610229276895 / 0.298765
711
737
  tcprecalc['Durielq (H) - Base']['droprate'][8] *= 0.23562610229276895 / 0.29876543209876544;
712
738
 
713
739
  // Flatten and abstract countess rune TCs so we can adjust the drop rate of each via coefficient.
714
- tcprecalc.forEach((tc, key) => {
740
+ //tcprecalc.forEach((tc, key) => {
715
741
  ({
716
742
  'Countess Rune': tcprecalc['Countess Rune'],
717
743
  'Countess Rune (N)': tcprecalc['Countess Rune (N)'],
@@ -762,7 +788,7 @@ tcprecalc.forEach((tc, key) => {
762
788
 
763
789
  tc.counts = flattenAndAbstract(baseName);
764
790
  });
765
- });
791
+ //});
766
792
 
767
793
  // Multiply the coefficients to the abstracted TCs
768
794
  ({