Skip to content

Commit dc9cbf7

Browse files
authored
fix(pet-constants): Add updated pet items and stats (#306)
1 parent c6fc5bf commit dc9cbf7

File tree

2 files changed

+71
-60
lines changed

2 files changed

+71
-60
lines changed

API/constants/pets.js

Lines changed: 66 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ for (const symbol in symbols) {
77
SYMBOLS[symbol] = symbols[symbol].symbol;
88
}
99

10-
function formatStat(stat) {
11-
const statFloored = Math.floor(stat);
12-
if (statFloored > 0) {
13-
return `§a+${statFloored}`;
10+
function formatStat(stat, red = false) {
11+
const formattedStat = stat.toFixed(2).replace(/\.?0+$/, "");
12+
const color = red ? "§c" : "§a";
13+
if (stat > 0) {
14+
return `${color}+${formattedStat}`;
1415
} else {
15-
return `§a${statFloored}`;
16+
return `${color}${formattedStat}`;
1617
}
1718
}
1819

@@ -91,13 +92,13 @@ class Pet {
9192
list.push(`§7Defense: ${formatStat(newStats[stat])}`);
9293
break;
9394
case "strength":
94-
list.push(`§7Strength: ${formatStat(newStats[stat])}`);
95+
list.push(`§7Strength: ${formatStat(newStats[stat], true)}`);
9596
break;
9697
case "crit_chance":
97-
list.push(`§7Crit Chance: ${formatStat(newStats[stat])}%`);
98+
list.push(`§7Crit Chance: ${formatStat(newStats[stat], true)}%`);
9899
break;
99100
case "crit_damage":
100-
list.push(`§7Crit Damage: ${formatStat(newStats[stat])}%`);
101+
list.push(`§7Crit Damage: ${formatStat(newStats[stat], true)}%`);
101102
break;
102103
case "intelligence":
103104
list.push(`§7Intelligence: ${formatStat(newStats[stat])}`);
@@ -106,10 +107,10 @@ class Pet {
106107
list.push(`§7Speed: ${formatStat(newStats[stat])}`);
107108
break;
108109
case "bonus_attack_speed":
109-
list.push(`§7Bonus Attack Speed: ${formatStat(newStats[stat])}%`);
110+
list.push(`§7Bonus Attack Speed: ${formatStat(newStats[stat], true)}%`);
110111
break;
111112
case "sea_creature_chance":
112-
list.push(`§7Sea Creature Chance: ${formatStat(newStats[stat])}%`);
113+
list.push(`§7Sea Creature Chance: ${formatStat(newStats[stat], true)}%`);
113114
break;
114115
case "magic_find":
115116
list.push(`§7Magic Find: ${formatStat(newStats[stat])}`);
@@ -127,7 +128,7 @@ class Pet {
127128
list.push(`§7Damage: ${formatStat(newStats[stat])}`);
128129
break;
129130
case "ferocity":
130-
list.push(`§7Ferocity: ${formatStat(newStats[stat])}`);
131+
list.push(`§7Ferocity: ${formatStat(newStats[stat], true)}`);
131132
break;
132133
case "mining_speed":
133134
list.push(`§7Mining Speed: ${formatStat(newStats[stat])}`);
@@ -162,8 +163,11 @@ class Pet {
162163
case "swing_range":
163164
list.push(`§7Swing Range: ${formatStat(newStats[stat])}`);
164165
break;
165-
case "cold_resistence":
166-
list.push(`§7Cold Resistence: ${formatStat(newStats[stat])}`);
166+
case "cold_resistance":
167+
list.push(`§7Cold Resistance: ${formatStat(newStats[stat])}`);
168+
break;
169+
case "heat_resistance":
170+
list.push(`§7Heat Resistance: ${formatStat(newStats[stat])}`);
167171
break;
168172
default:
169173
list.push(`§cUNKNOWN: ${stat}`);
@@ -330,7 +334,7 @@ class Eerie extends Pet {
330334
const mult = getValue(this.rarity, { legendary: 0.01 });
331335

332336
const primalFearKills = this.profile.kills
333-
? this.profile.kills.kills.find((mob) => mob.entityId === "primal_fear")?.amount ?? 0
337+
? (this.profile.kills.kills.find((mob) => mob.entityId === "primal_fear")?.amount ?? 0)
334338
: 0;
335339
const kills = Math.max(primalFearKills, 150);
336340

@@ -475,6 +479,9 @@ class Rabbit extends Pet {
475479
if (this.rarity >= LEGENDARY) {
476480
list.push(this.third);
477481
}
482+
if (this.rarity >= MYTHIC) {
483+
list.push(this.fourth);
484+
}
478485
return list;
479486
}
480487

@@ -501,6 +508,15 @@ class Rabbit extends Pet {
501508
desc: [`§7Farming minions work §a${round(this.level * mult, 1)}% §7faster while on your island.`]
502509
};
503510
}
511+
512+
get fourth() {
513+
return {
514+
name: "§6Chocolate Injections",
515+
desc: [
516+
`§7Increases §6Chocolate Factory§7 production by §a+${round(0.01 + (this.level - 1) * 0.0004, 3)}x§7. Duplicate §aChocolate Rabbits§7 that you find grant §6${round(1.3 + (this.level - 1) * 0.32, 1)}% Chocolate§7.`
517+
]
518+
};
519+
}
504520
}
505521

506522
class Armadillo extends Pet {
@@ -511,56 +527,44 @@ class Armadillo extends Pet {
511527
}
512528

513529
get abilities() {
514-
const list = [this.first, this.second, this.third];
530+
const list = [this.first, this.second];
515531
if (this.rarity >= RARE) {
516-
list.push(this.fourth);
532+
list.push(this.third);
517533
}
518534
if (this.rarity >= LEGENDARY) {
519-
list.push(this.fifth);
535+
list.push(this.fourth);
520536
}
521537
return list;
522538
}
523539

524540
get first() {
525541
return {
526542
name: "§6Rideable",
527-
desc: [`§7Right-click on your summoned pet to ride it!`]
543+
desc: [`§7Right-click on your summoned pet to ride it! Moves faster based on your §f${SYMBOLS.speed} Speed§7.`]
528544
};
529545
}
530546

531547
get second() {
532548
return {
533549
name: "§6Tunneler",
534-
desc: [
535-
`§7The Armadillo breaks all stone or ore in its path while you are riding it in the §3Crystal Hollows §7using your held item.`
536-
]
550+
desc: [`§7While riding in the §5Crystal Hollows§7, this Pet breaks all blocks in its path using your held item.`]
537551
};
538552
}
539553

540554
get third() {
541-
return {
542-
name: "§6Earth Surfer",
543-
desc: [`§7The Armadillo moves faster based on your §f${SYMBOLS.speed} Speed§7.`]
544-
};
545-
}
546-
547-
get fourth() {
548-
const mult = getValue(this.rarity, { rare: 0.2, epic: 0.3 });
555+
const mult = getValue(this.rarity, { rare: 0.2, epic: 0.3, legendary: 0.4 });
549556
return {
550557
name: "§6Rolling Miner",
551-
desc: [`§7Every §a${round(60 - this.level * mult, 1)} §7seconds, the next gemstone you mine gives §a2x §7drops.`]
558+
desc: [
559+
`§7Every §a${round(60 - this.level * mult, 1)} §7seconds, the next §5Gemstone§7 you mine gives §a2x §7drops.`
560+
]
552561
};
553562
}
554563

555-
get fifth() {
556-
const mult = getValue(this.rarity, { legendary: 0.5 });
564+
get fourth() {
557565
return {
558-
name: "§6Mobile Tank",
559-
desc: [
560-
`§7For every §a${round(100 - this.level * mult, 1)} ${SYMBOLS.defense} Defense§7, gain §f+1 ${
561-
SYMBOLS.speed
562-
} Speed §7and §6+1 ${SYMBOLS.mining_speed} Mining Speed§7.`
563-
]
566+
name: "§6Long Claws",
567+
desc: [`§7Grants §e+${round(this.level * 3)} ${SYMBOLS.mining_spread} Mining Spread§7 while mining Hard Stone.`]
564568
};
565569
}
566570
}
@@ -1015,8 +1019,8 @@ class WitherSkeleton extends Pet {
10151019
class Bal extends Pet {
10161020
get stats() {
10171021
return {
1018-
ferocity: this.level * 0.1,
1019-
strength: this.level * 0.25
1022+
mining_fortune: this.level * 1,
1023+
heat_resistance: this.level * 1.5
10201024
};
10211025
}
10221026

@@ -1032,30 +1036,28 @@ class Bal extends Pet {
10321036
}
10331037

10341038
get first() {
1039+
const mult = getValue(this.rarity, { epic: 0.02, legendary: 0.03 });
10351040
return {
1036-
name: 6Protective Skin",
1037-
desc: [7§7Gives §cheat immunity§7.`]
1041+
name: 6Furnace",
1042+
desc: [7Grants §5+${round(this.level * mult, 1)} ${SYMBOLS.pristine} Pristine§7 while in the §cMagma Fields§7.`]
10381043
};
10391044
}
10401045

10411046
get second() {
1042-
const mult = getValue(this.rarity, { epic: 0.1 });
1047+
const mult = getValue(this.rarity, { epic: 0.04 });
10431048
return {
1044-
name: 6Fire Whip",
1049+
name: 6Dispersion",
10451050
desc: [
1046-
`§7Every §a5s §7while in combat on public islands, Bal will strike nearby enemies with his fire whip dealing §c${round(
1047-
this.level * mult,
1048-
1
1049-
)}% §7of your damage as §ftrue damage§7.`
1051+
`§7While in the §5Crystal Hollows§7, killing mobs reduces your §c${SYMBOLS.heat_resistance} Heat§7 by §c${floor(this.level * mult, 1)}§7.`
10501052
]
10511053
};
10521054
}
10531055

10541056
get third() {
1055-
const mult = getValue(this.rarity, { legendary: 0.15 });
1057+
const mult = getValue(this.rarity, { legendary: 0.1 });
10561058
return {
1057-
name: 6Made of Lava",
1058-
desc: [7Gain §a${round(this.level * mult, 1)}% §7on ALL stats when inside the §cMagma Fields§7.`]
1059+
name: 6Chimney",
1060+
desc: [7Reduce Pickaxe Ability cooldowns by §a${floor(this.level * mult, 1)}%§7.`]
10591061
};
10601062
}
10611063
}
@@ -1209,9 +1211,10 @@ class GoldenDragon extends Pet {
12091211
get stats() {
12101212
const stats = {};
12111213
if (this.level >= 100) {
1212-
const goldCollectionDigits = this.profile.collections?.mining?.collections
1213-
?.find((collection) => collection.id === "GOLD_INGOT")
1214-
?.amount.toString().length;
1214+
const goldCollectionDigits =
1215+
this.profile.collections?.mining?.collections
1216+
?.find((collection) => collection.id === "GOLD_INGOT")
1217+
?.amount.toString().length ?? 0;
12151218

12161219
stats.strength = Math.floor(25 + Math.max(0, this.level - 100) * 0.25) + 10 * goldCollectionDigits;
12171220
stats.bonus_attack_speed = Math.floor(25 + Math.max(0, this.level - 100) * 0.25);
@@ -3889,7 +3892,7 @@ class Penguin extends Pet {
38893892
return {
38903893
name: "§6Thick Blubber",
38913894
desc: [
3892-
`§7Each time you catch a Sea Creature, reduce your §b${SYMBOLS.cold_resistence} Cold §7by §a${round(1 + floor(this.level / val), 1)}§7.`
3895+
`§7Each time you catch a Sea Creature, reduce your §b${SYMBOLS.cold_resistance} Cold §7by §a${round(1 + floor(this.level / val), 1)}§7.`
38933896
]
38943897
};
38953898
}
@@ -3919,7 +3922,7 @@ class Mammoth extends Pet {
39193922
get stats() {
39203923
return {
39213924
defense: 0.5 * this.level,
3922-
cold_resistence: 0.1 * this.level
3925+
cold_resistance: 0.1 * this.level
39233926
};
39243927
}
39253928

@@ -3935,7 +3938,7 @@ class Mammoth extends Pet {
39353938
return {
39363939
name: "§6Wooly Coat",
39373940
desc: [
3938-
`§7Gain a §a${round(this.level * mult, 1)}% §7chance for mobs to not inflict §b${SYMBOLS.cold_resistence} Cold §7when damaging you in the §bGlacite Mineshafts§7.`
3941+
`§7Gain a §a${round(this.level * mult, 1)}% §7chance for mobs to not inflict §b${SYMBOLS.cold_resistance} Cold §7when damaging you in the §bGlacite Mineshafts§7.`
39393942
]
39403943
};
39413944
}
@@ -4013,7 +4016,7 @@ class GlaciteGolem extends Pet {
40134016
get stats() {
40144017
return {
40154018
mining_speed: 1.25 * this.level,
4016-
cold_resistence: 0.05 * this.level
4019+
cold_resistance: 0.05 * this.level
40174020
};
40184021
}
40194022

@@ -5150,6 +5153,11 @@ const pet_items = {
51505153
tier: "UNCOMMON",
51515154
description:
51525155
"§7Adds particles matching your §c+ §7color to your pet and yourself, defaulting to red. §8Editable in Hypixel lobbies."
5156+
},
5157+
PET_ITEM_TITANIUM_MINECART: {
5158+
name: "Titanium Minecart",
5159+
tier: "RARE",
5160+
description: `§7Grants §6+33.3 ${SYMBOLS.mining_fortune} Mining Fortune§7 when mining §fTitanium Ore§7.`
51535161
}
51545162
};
51555163

API/stats/pets.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = (profile) => {
4444
petData.hatching?.level > pet.level
4545
? petData.hatching.name
4646
: petData.name
47-
? petData.name[pet.rarity] ?? petData.name.default
47+
? (petData.name[pet.rarity] ?? petData.name.default)
4848
: titleCase(pet.type.replaceAll("_", " "));
4949

5050
// Rarity upgrades
@@ -155,7 +155,10 @@ module.exports = (profile) => {
155155
if (!heldItemObj) {
156156
heldItemObj = constants.pet_items[heldItem];
157157
}
158-
lore.push("", `§6Held Item: §${constants.rarityColors[heldItemObj.tier.toLowerCase()]}${heldItemObj.name}`);
158+
lore.push(
159+
"",
160+
`§6Held Item: §${constants.rarityColors[(heldItemObj?.tier ?? "COMMON").toLowerCase()]}${heldItemObj?.name ?? "???"}`
161+
);
159162

160163
if (heldItem in constants.pet_items) {
161164
lore.push(constants.pet_items[heldItem].description);

0 commit comments

Comments
 (0)