Skip to content

Commit 4fea196

Browse files
authored
pet variables offset (#11)
1 parent eddead5 commit 4fea196

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/scripts/parsers/1_21_4/pets.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import fs from "fs";
2-
import {checkPetVariables} from "../../tests/pet_variables.test.mjs";
2+
import { checkPetVariables } from "../../tests/pet_variables.test.mjs";
33

44
const RIGHT_CLICK_LORE_1 = "§7§eRight-click to add this pet to your";
55
const RIGHT_CLICK_LORE_2 = "§7§eRight-click to add this pet to";
@@ -12,7 +12,7 @@ export const petIds = []
1212

1313
const getPetVariables = (pet, tier) => {
1414
if (!stats[pet]) return {}
15-
if (!stats[pet][tier]) {}
15+
if (!stats[pet][tier]) return {}
1616

1717
const variables = {};
1818
const min = stats[pet][tier]["1"];
@@ -64,6 +64,11 @@ export const Pets = {
6464
lore: lore,
6565
variables: getPetVariables(item.pet.type, item.pet.tier)
6666
}
67+
const variablesOffset = stats[petId]?.[item.pet.tier]?.["stats_levelling_curve"]?.split(":") || [];
68+
if (variablesOffset.length >= 2) {
69+
tier.variablesOffset = parseInt(variablesOffset[0]) - 1;
70+
}
71+
6772
const checks = checkPetVariables(tier);
6873

6974
if (checks.missing.length > 0) {
@@ -86,4 +91,4 @@ export const Pets = {
8691

8792
return JSON.stringify(petsFile);
8893
}
89-
}
94+
}

0 commit comments

Comments
 (0)