@blizzhackers/d2data 2.7.14 → 2.7.15

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
@@ -758,6 +758,68 @@ for (let diff of [0, 1, 2]) {
758
758
  }
759
759
  })(actprofile);
760
760
 
761
+ let coldmasterybreakpoints = {}, coldhpbyres = {};
762
+
763
+ for (let act of Object.values(actprofile)) {
764
+ for (let resset of Object.values(act)) {
765
+ if (resset['ResCo(H)']) {
766
+ for (let res in resset['ResCo(H)']) {
767
+ res = Number(res);
768
+ coldhpbyres[res] = coldhpbyres[res] || 0;
769
+ coldhpbyres[res] += resset['ResCo(H)'][res];
770
+ }
771
+ }
772
+ }
773
+ }
774
+
775
+ (function () {
776
+ for (let mastery = 0; mastery <= 195; mastery === 0 ? mastery = 20 : mastery ++) {
777
+ let ehp = 0;
778
+
779
+ for (let res in coldhpbyres) {
780
+ res = Number(res);
781
+ let pierce = (res >= 100 ? (mastery / 5) : mastery);
782
+ let mod = Math.min(2, 1 - (Math.min(95, res) - pierce) / 100);
783
+ ehp += coldhpbyres[res] / mod;
784
+ }
785
+
786
+ coldmasterybreakpoints[mastery] = ehp;
787
+ }
788
+
789
+ let masterylist = Object.keys(coldmasterybreakpoints);
790
+
791
+ for (let i = masterylist.length - 1; i; i--) {
792
+ coldmasterybreakpoints[masterylist[i]] = (coldmasterybreakpoints[masterylist[i - 1]] / coldmasterybreakpoints[masterylist[i]] - 1);
793
+ }
794
+
795
+ coldmasterybreakpoints[0] = 0;
796
+
797
+ for (let c = 0; c < 2; c++) {
798
+ for (let i = masterylist.length - 1; i; i--) {
799
+ coldmasterybreakpoints[masterylist[i]] = coldmasterybreakpoints[masterylist[i]] - coldmasterybreakpoints[masterylist[i - 1]];
800
+ }
801
+ }
802
+
803
+ for (let i = masterylist.length - 1; i; i--) {
804
+ coldmasterybreakpoints[masterylist[i]] = coldmasterybreakpoints[masterylist[i]] * 10000;
805
+ }
806
+
807
+ let newMasteryList = {}, mmin = Infinity;
808
+
809
+ for (let i = masterylist.length; i; i--) {
810
+ if (coldmasterybreakpoints[masterylist[i]] <= -0.5) {
811
+ mmin = Math.min(mmin, -coldmasterybreakpoints[masterylist[i]]);
812
+ newMasteryList[masterylist[i - 1]] = -coldmasterybreakpoints[masterylist[i]];
813
+ }
814
+ }
815
+
816
+ for (let key in newMasteryList) {
817
+ newMasteryList[key] = Math.round(newMasteryList[key] / mmin);
818
+ }
819
+
820
+ coldmasterybreakpoints = newMasteryList;
821
+ })();
822
+
761
823
  let tcprecalc = {};
762
824
 
763
825
  full.treasureclassex.forEach((tc, key) => {
@@ -911,3 +973,4 @@ fs.writeFileSync(outDir + 'treasureclassgroupsex.json', JSON.stringify(groupsEx,
911
973
  fs.writeFileSync(outDir + 'monpopulationest.json', JSON.stringify(monpopulation, null, ' '));
912
974
  fs.writeFileSync(outDir + 'tcprecalc.json', JSON.stringify(tcprecalc, null, ' '));
913
975
  fs.writeFileSync(outDir + 'actprofile.json', JSON.stringify(actprofile, null, ' '));
976
+ fs.writeFileSync(outDir + 'coldmasterybreakpoints.json', JSON.stringify(coldmasterybreakpoints, null, ' '));
@@ -0,0 +1,8 @@
1
+ {
2
+ "20": 15639,
3
+ "100": 6,
4
+ "125": 1,
5
+ "133": 2,
6
+ "150": 5,
7
+ "175": 1
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blizzhackers/d2data",
3
- "version": "2.7.14",
3
+ "version": "2.7.15",
4
4
  "description": "",
5
5
  "main": "compile.js",
6
6
  "scripts": {