From 8ebd4b1e1130784498e61ad9ff0e791dc8a5122e Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Fri, 30 Sep 2022 21:05:22 +0200 Subject: [PATCH 01/42] feat: show stats --- public/resources/scss/stats.scss | 102 +++++++++++++++++- public/resources/ts/calculate-player-stats.ts | 15 ++- src/constants/misc.js | 40 +++++-- src/custom-resources.js | 4 +- 4 files changed, 148 insertions(+), 13 deletions(-) diff --git a/public/resources/scss/stats.scss b/public/resources/scss/stats.scss index 8119f92213..9fd710b2ee 100644 --- a/public/resources/scss/stats.scss +++ b/public/resources/scss/stats.scss @@ -25,9 +25,11 @@ #base_stats_container { columns: 200px auto; + .basic-stat { margin-top: 0; } + .stat-icon { font-size: 16px; line-height: 1; @@ -36,6 +38,7 @@ margin-right: 2px; display: inline-block; } + .stat-name, .stat-value { font-size: 14px; @@ -53,6 +56,7 @@ border-radius: 1000px; color: inherit; background-color: rgba(var(--text-rgb), 0.1); + &:hover, &:focus { background-color: rgba(var(--text-rgb), 0.15); @@ -101,6 +105,7 @@ z-index: 10; filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.4)); overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -237,6 +242,7 @@ visibility: hidden; border-radius: 10px; overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -275,11 +281,13 @@ align-items: center; justify-content: flex-start; gap: 16px; + .stats-piece-icon__wrapper { width: 32px; height: 32px; overflow: hidden; flex: none; + .stats-piece-icon { filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.4)); width: 128px; @@ -298,6 +306,7 @@ text-shadow: 0 0 7px rgba(0, 0, 0, 0.3); margin: 0; flex: 1; + &[data-multicolor="true"] { background-color: var(--lore_background-hex); border-radius: 1rem; @@ -320,6 +329,7 @@ filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.1)); background-color: rgb(255 255 255 / 0%); clip-path: circle(15px); + &:hover, &:focus-visible { background-color: rgb(255 255 255 / 15%); @@ -334,6 +344,7 @@ .lore-row { display: block; min-height: calc(1em * 1.2); + @supports (min-height: 1lh) { min-height: 1lh; } @@ -370,6 +381,7 @@ top: 12px; left: 10px; image-rendering: crisp-edges; + @supports (image-rendering: pixelated) { image-rendering: pixelated; } @@ -451,6 +463,7 @@ font-weight: 700; color: white; overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -497,6 +510,7 @@ padding: 0; margin: 0; overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -731,6 +745,7 @@ a.additional-player-stat:hover { margin-left: calc(-1 * var(--padding)); margin-right: calc(-1 * var(--padding)); background-color: rgba(var(--background-rgb), 0.3); + @media (max-width: 1590px) { grid-template-areas: "skill skill" @@ -738,6 +753,7 @@ a.additional-player-stat:hover { "skin additional"; grid-template-columns: 160px 1fr; } + @media (max-width: 650px) { grid-template-areas: "skill skill" @@ -745,6 +761,7 @@ a.additional-player-stat:hover { "skin additional"; grid-template-columns: 1fr 1fr; } + @media (max-width: 480px) { grid-template-areas: "skin additional" @@ -770,6 +787,7 @@ a.additional-player-stat:hover { } } } + #nav_bar { position: sticky; top: calc(48px + env(safe-area-inset-top, 0)); @@ -800,8 +818,10 @@ a.additional-player-stat:hover { bottom: 10px; z-index: 1; } + &.stuck #nav_bar_background { background-color: rgba(20, 20, 20, 0.9); + .light & { background-color: rgba(240, 240, 240, 0.92); } @@ -855,6 +875,7 @@ a.additional-player-stat:hover { height: 8px; top: calc(100% - 3px); } + @media (hover: hover) { &:hover::after { height: 8px; @@ -869,15 +890,19 @@ a.additional-player-stat:hover { .stat-strength, .stat-ferocity, .stat-ability-damage, +.stat-health-regen, .color-health, .color-strength, .color-ferocity, -.color-ability-damage { +.color-ability-damage, +.color-health-regen { color: var(--§c); } .stat-defense, -.color-defense { +.stat-mending, +.color-defense, +.color-mending { color: var(--§a); } @@ -904,12 +929,15 @@ a.additional-player-stat:hover { } .stat-sea-creature-chance, -.color-sea-creature-chance { +.color-sea-creature-chance, +[class$="wisdom"] { color: var(--§3); } .stat-magic-find, -.color-magic-find { +.stat-fishing-speed, +.color-magic-find, +.color-fishing-speed { color: var(--§b); } @@ -953,6 +981,11 @@ a.additional-player-stat:hover { color: var(--§f); } +.stat-vitality, +.color-vitality { + color: var(--§4); +} + .stat-container { margin-top: 35px; position: relative; @@ -1013,6 +1046,7 @@ a.additional-player-stat:hover { border-radius: 10px; font-weight: 500; overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -1046,6 +1080,7 @@ a.additional-player-stat:hover { display: flex; gap: 12px; flex-wrap: wrap; + .wardrobe-set { flex-shrink: 0; display: grid; @@ -1057,6 +1092,7 @@ a.additional-player-stat:hover { &.armor-placeholder { background-color: rgba(var(--background-rgb), 0.3); + .piece-icon { background: rgba(var(--text-rgb), 0.8); } @@ -1064,27 +1100,34 @@ a.additional-player-stat:hover { &.index-0 { grid-area: helmet; + &.armor-placeholder .piece-icon { mask-image: url("/resources/img/textures/item/empty_armor_slot_helmet.png"); -webkit-mask-image: url("/resources/img/textures/item/empty_armor_slot_helmet.png"); } } + &.index-1 { grid-area: chestplate; + &.armor-placeholder .piece-icon { mask-image: url("/resources/img/textures/item/empty_armor_slot_chestplate.png"); -webkit-mask-image: url("/resources/img/textures/item/empty_armor_slot_chestplate.png"); } } + &.index-2 { grid-area: leggings; + &.armor-placeholder .piece-icon { mask-image: url("/resources/img/textures/item/empty_armor_slot_leggings.png"); -webkit-mask-image: url("/resources/img/textures/item/empty_armor_slot_leggings.png"); } } + &.index-3 { grid-area: boots; + &.armor-placeholder .piece-icon { mask-image: url("/resources/img/textures/item/empty_armor_slot_boots.png"); -webkit-mask-image: url("/resources/img/textures/item/empty_armor_slot_boots.png"); @@ -1097,8 +1140,10 @@ a.additional-player-stat:hover { overflow: hidden; overflow: clip; transition: max-height 0.2s, gap 0.2s; + .armor-placeholder { transition: height 0.2s; + .piece-icon { transition: mask-size 0.2s, -webkit-mask-size 0.2s; } @@ -1107,8 +1152,10 @@ a.additional-player-stat:hover { &:not(:hover):not(:focus-within) { max-height: 75px; gap: 0; + .armor-placeholder { height: 0; + .piece-icon { mask-size: 128px 0; -webkit-mask-size: 128px 0; @@ -1117,6 +1164,7 @@ a.additional-player-stat:hover { } } } + @media (hover: none) { flex-wrap: nowrap; overflow-x: auto; @@ -1128,6 +1176,7 @@ a.additional-player-stat:hover { > :first-child { margin-inline-start: var(--padding); } + > :last-child { margin-inline-end: var(--padding); } @@ -1170,6 +1219,7 @@ a.additional-player-stat:hover { border-radius: 5px; pointer-events: none; } + &.sticky-stats::after, &:hover::after { background-color: rgba(255, 255, 255, 0.2); @@ -1221,10 +1271,12 @@ a.additional-player-stat:hover { right: 0; pointer-events: none; overflow: hidden; + @supports (contain: paint) { overflow: initial; contain: paint; } + &::before { content: ""; position: absolute; @@ -1261,6 +1313,7 @@ a.additional-player-stat:hover { .item-icon.is-enchanted { filter: url(#enchanted-glint); + #stats_content &.stats-piece-icon, &.piece-icon { filter: url(#enchanted-glint) drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.4)); @@ -1277,6 +1330,7 @@ a.additional-player-stat:hover { transform: translate(-50%, -50%) scale(0.5); transform-origin: center center; image-rendering: crisp-edges; + @supports (image-rendering: pixelated) { image-rendering: pixelated; } @@ -1298,9 +1352,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-supreme-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§4); } + .piece-supreme-bg + .item-lore { scrollbar-color: var(--§4) transparent; } + .piece-supreme-fg { color: var(--§4) !important; } @@ -1309,9 +1365,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-very_special-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§c); } + .piece-very_special-bg + .item-lore { scrollbar-color: var(--§c) transparent; } + .piece-very_special-fg { color: var(--§c) !important; } @@ -1320,9 +1378,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-special-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§c); } + .piece-special-bg + .item-lore { scrollbar-color: var(--§c) transparent; } + .piece-special-fg { color: var(--§c) !important; } @@ -1331,9 +1391,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-divine-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§b); } + .piece-divine-bg + .item-lore { scrollbar-color: var(--§b) transparent; } + .piece-divine-fg { color: var(--§b) !important; } @@ -1342,9 +1404,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-mythic-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§d); } + .piece-mythic-bg + .item-lore { scrollbar-color: var(--§d) transparent; } + .piece-mythic-fg { color: var(--§d) !important; } @@ -1353,9 +1417,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-legendary-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§6); } + .piece-legendary-bg + .item-lore { scrollbar-color: var(--§6) transparent; } + .piece-legendary-fg { color: var(--§6) !important; } @@ -1364,9 +1430,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-epic-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§5); } + .piece-epic-bg + .item-lore { scrollbar-color: var(--§5) transparent; } + .piece-epic-fg { color: var(--§5) !important; } @@ -1375,9 +1443,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-rare-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§9); } + .piece-rare-bg + .item-lore { scrollbar-color: var(--§9) transparent; } + .piece-rare-fg { color: var(--§9) !important; } @@ -1386,9 +1456,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-uncommon-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§a); } + .piece-uncommon-bg + .item-lore { scrollbar-color: var(--§a) transparent; } + .piece-uncommon-fg { color: var(--§a) !important; } @@ -1397,9 +1469,11 @@ a.additional-player-stat:hover { .style-scrollbar .piece-common-bg + .item-lore::-webkit-scrollbar-thumb { background-color: var(--§f); } + .piece-common-bg + .item-lore { scrollbar-color: var(--§f) transparent; } + .piece-common-fg { color: var(--§f) !important; } @@ -1411,27 +1485,35 @@ a.additional-player-stat:hover { &.piece-very_special-bg { --upgraded-from: var(--§c); } + &.piece-special-bg { --upgraded-from: var(--§4); } + &.piece-supreme-bg { --upgraded-from: var(--§b); } + &.piece-divine-bg { --upgraded-from: var(--§d); } + &.piece-mythic-bg { --upgraded-from: var(--§6); } + &.piece-legendary-bg { --upgraded-from: var(--§5); } + &.piece-epic-bg { --upgraded-from: var(--§9); } + &.piece-rare-bg { --upgraded-from: var(--§a); } + &.piece-uncommon-bg { --upgraded-from: var(--§f); } @@ -1538,6 +1620,7 @@ a.additional-player-stat:hover { margin-bottom: 0; border-radius: 10px; overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -1550,6 +1633,7 @@ a.additional-player-stat:hover { height: 50px; margin-top: 5px; overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -1778,6 +1862,7 @@ inventory-view { .slayer { display: flex; flex-direction: column; + * { flex: 0 0; } @@ -1796,6 +1881,7 @@ inventory-view { .floor-containers { content-visibility: auto; + @supports (contain-intrinsic-size: 350px 212px) { contain-intrinsic-size: 350px 212px; } @@ -2315,9 +2401,11 @@ inventory-view { > :first-child { margin-inline-start: var(--padding); } + > :last-child { margin-inline-end: var(--padding); } + // because margin-inline-end gets eaten by the scroll container sometimes &::after { content: ""; @@ -2334,6 +2422,7 @@ inventory-view { display: flex; gap: 8px; align-items: flex-start; + & + & { margin-top: 4px; } @@ -2358,6 +2447,7 @@ inventory-view { margin-left: calc(-1 * var(--padding)); margin-right: calc(-1 * var(--padding)); content-visibility: auto; + @supports (contain-intrinsic-size: 200px 64px) { contain-intrinsic-size: 200px 64px; } @@ -2366,12 +2456,14 @@ inventory-view { @supports (contain-intrinsic-size: 140px 230px) { contain-intrinsic-size: 140px 230px; } + &::after { width: 15px; //15px = --padding - gap } } padding-inline-start: var(--padding); + // because padding-inline-end gets eaten by the scroll container &::after { content: ""; @@ -2471,6 +2563,7 @@ inventory-view { max-height: 0; transition: max-height 0.2s ease-in-out; overflow: hidden; + @supports (overflow: clip) { overflow: clip; } @@ -2553,6 +2646,7 @@ bonus-stats { .accessories-extras { margin: 16px 0; + bonus-stats p { margin: 0; } diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 6d610cfe0d..9f7b987b57 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -22,8 +22,21 @@ export function getPlayerStats() { farming_fortune: { base: 0 }, foraging_fortune: { base: 0 }, pristine: { base: 0 }, + fishing_speed: { base: 0 }, + health_regen: { base: 100 }, + vitality: { base: 100 }, + mending: { base: 100 }, + combat_wisdom: { base: 0 }, + mining_wisdom: { base: 0 }, + farming_wisdom: { base: 0 }, + foraging_wisdom: { base: 0 }, + fishing_wisdom: { base: 0 }, + enchanting_wisdom: { base: 0 }, + alchemy_wisdom: { base: 0 }, + carpentry_wisdom: { base: 0 }, + runecrafting_wisdom: { base: 0 }, + social_wisdom: { base: 0 }, }; - const allowedStats = Object.keys(stats); // Active armor stats diff --git a/src/constants/misc.js b/src/constants/misc.js index 22844d8267..7289349106 100644 --- a/src/constants/misc.js +++ b/src/constants/misc.js @@ -29,16 +29,16 @@ export const PROFILE_UPGRADES = { // Player stats on a completely new profile export const BASE_STATS = { - health: 100, + health: 0, defense: 0, - effective_health: 100, + effective_health: 0, strength: 0, - speed: 100, - crit_chance: 30, - crit_damage: 50, + speed: 0, + crit_chance: 0, + crit_damage: 0, bonus_attack_speed: 0, intelligence: 0, - sea_creature_chance: 20, + sea_creature_chance: 0, magic_find: 0, pet_luck: 0, ferocity: 0, @@ -50,6 +50,20 @@ export const BASE_STATS = { pristine: 0, damage: 0, damage_increase: 0, + fishing_speed: 0, + health_regen: 100, + vitality: 100, + mending: 100, + combat_wisdom: 0, + mining_wisdom: 0, + farming_wisdom: 0, + foraging_wisdom: 0, + fishing_wisdom: 0, + enchanting_wisdom: 0, + alchemy_wisdom: 0, + carpentry_wisdom: 0, + runecrafting_wisdom: 0, + social_wisdom: 0, }; export const STAT_TEMPLATE = { @@ -74,6 +88,20 @@ export const STAT_TEMPLATE = { pristine: 0, damage: 0, damage_increase: 0, + fishing_speed: 0, + health_regen: 0, + vitality: 0, + mending: 0, + combat_wisdom: 0, + mining_wisdom: 0, + farming_wisdom: 0, + foraging_wisdom: 0, + fishing_wisdom: 0, + enchanting_wisdom: 0, + alchemy_wisdom: 0, + carpentry_wisdom: 0, + runecrafting_wisdom: 0, + social_wisdom: 0, }; export const SLAYER_COST = { diff --git a/src/custom-resources.js b/src/custom-resources.js index adc52c0343..affdcf9aaf 100644 --- a/src/custom-resources.js +++ b/src/custom-resources.js @@ -58,7 +58,7 @@ async function init() { console.log(`Custom Resources loading started on ${getClusterId(true)}.`); console.time(`custom_resources_${getClusterId()}`); - for (const packOrFile of await fs.readdir(RESOURCE_PACK_FOLDER, { withFileTypes: true })) { + /*for (const packOrFile of await fs.readdir(RESOURCE_PACK_FOLDER, { withFileTypes: true })) { if (!packOrFile.isDirectory()) { continue; } @@ -406,7 +406,7 @@ async function init() { pack.textures.push(texture); } - } + }*/ console.log(`Custom Resources loading done. (${getClusterId(true)})`); console.timeEnd(`custom_resources_${getClusterId()}`); From f1621b0b895dc0df1f77276956ba8109156f558d Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Fri, 30 Sep 2022 21:18:53 +0200 Subject: [PATCH 02/42] checkpoint: update constants & add bestiary calc --- common/constants/bonuses.js | 25 +- src/constants.js | 1 + src/constants/bestiary.js | 597 +++++++++++++++ src/constants/misc.js | 31 +- src/hotm.js | 1437 +++++++++++++++++++++++++++++++++++ src/lib.js | 62 ++ 6 files changed, 2145 insertions(+), 8 deletions(-) create mode 100644 src/constants/bestiary.js create mode 100644 src/hotm.js diff --git a/common/constants/bonuses.js b/common/constants/bonuses.js index eaceb2ba92..bc8fc4e8c6 100644 --- a/common/constants/bonuses.js +++ b/common/constants/bonuses.js @@ -1,9 +1,11 @@ export const STATS_BONUS = { - // Skills + // ? Skills skill_farming: { 1: { health: 2, farming_fortune: 4 }, 15: { health: 3, farming_fortune: 4 }, 20: { health: 4, farming_fortune: 4 }, + // ! Hypixel Admins made a mistake, Farming 25 for some reason doesn't give any stats + 25: { health: 0, farming_fortune: 0 }, 26: { health: 5, farming_fortune: 4 }, }, skill_mining: { @@ -39,21 +41,34 @@ export const STATS_BONUS = { 51: { health: 0 }, }, skill_social: {}, - skill_carpentry: {}, + skill_carpentry: { + 1: { health: 1}, + // ! Hypixel Admins made a mistake here, Carpentry 50 for some reason doesn't give health either + 50: { health: 49 } + }, skill_runecrafting: {}, - // Slayers + // ? Slayers slayer_zombie: { 1: { health: 2 }, + 2: { health: 2 }, 3: { health: 3 }, + 4: { health: 3 }, 5: { health: 4 }, + 6: { health: 4 }, 7: { health: 5 }, + 8: { health: 5 }, 9: { health: 6 }, }, slayer_spider: { 1: { crit_damage: 1 }, + 2: { crit_damage: 1 }, + 3: { crit_damage: 1 }, + 4: { crit_damage: 1 }, 5: { crit_damage: 2 }, + 6: { crit_damage: 2 }, 7: { crit_chance: 1 }, 8: { crit_damage: 3 }, + 9: { crit_damage: 3 }, }, slayer_wolf: { 1: { speed: 1 }, @@ -83,9 +98,9 @@ export const STATS_BONUS = { 3: { health: 4 }, 4: { true_defense: 1 }, 5: { health: 5 }, - 6: {}, + 6: { strength: 2 }, 7: { health: 6 }, 8: { true_defense: 2 }, 9: { health: 7 }, }, -}; +}; \ No newline at end of file diff --git a/src/constants.js b/src/constants.js index 0d6e58d3aa..33f20d9dcf 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,7 @@ export * from "../common/constants.js"; export * from "./constants/armor.js"; +export * from "./constants/bestiary.js"; export * from "./constants/collections.js"; export * from "./constants/dungeons.js"; export * from "./constants/forge.js"; diff --git a/src/constants/bestiary.js b/src/constants/bestiary.js new file mode 100644 index 0000000000..f1f3135816 --- /dev/null +++ b/src/constants/bestiary.js @@ -0,0 +1,597 @@ +export const BESTIARY = { + private: { + max: 5, + mobs: [ + { + id: "kills_family_zombie", + name: "Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + maxTier: 5, + }, + { + id: "kills_family_skeleton", + name: "Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + maxTier: 5, + }, + { + id: "kills_family_spider", + name: "Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + maxTier: 5, + }, + { + id: "kills_family_cave_spider", + name: "Cave Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + maxTier: 5, + }, + { + id: "kills_family_enderman_private", + name: "Enderman", + head: "96c0b36d53fff69a49c7d6f3932f2b0fe948e032226d5e8045ec58408a36e951", + maxTier: 5, + }, + { + id: "kills_family_slime", + name: "Slime", + head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", + maxTier: 5, + }, + { + id: "kills_family_witch", + name: "Witch", + head: "fce6604157fc4ab5591e4bcf507a749918ee9c41e357d47376e0ee7342074c90", + maxTier: 5, + }, + ], + }, + hub: { + max: 1000, + mobs: [ + { + id: "kills_family_zombie_villager", + name: "Zombie Villager", + head: "e5e08a8776c1764c3fe6a6ddd412dfcb87f41331dad479ac96c21df4bf3ac89c", + }, + { + id: "kills_family_unburried_zombie", + name: "Crypt Ghoul", + skyblockId: "GOLD_SWORD", + itemId: 283, + damage: 0, + }, + { + id: "kills_family_ruin_wolf", + name: "Wolf", + head: "69d1d3113ec43ac2961dd59f28175fb4718873c6c448dfca8722317d67", + }, + { + id: "kills_family_old_wolf", + name: "Old Wolf", + head: "d359537c15534f61c1cd886bc118774ed22280e7cdab6613870160aad4ca39", + }, + ], + }, + spiders: { + max: 1000, + mobs: [ + { + id: "kills_family_dasher_spider", + name: "Dasher Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + id: "kills_family_spider_jockey", + name: "Spider Jockey", + head: "70939373cafe4b1f5397aafd09f3bb1663e7b629a41a75fbdc1860b6bf8b475f", + }, + { + id: "kills_family_weaver_spider", + name: "Weaver Spider", + head: "921438f646dc04515967e8195ccc3d31e23b02f9aa0ac914edc2822f98394b86", + }, + { + id: "kills_family_voracious_spider", + name: "Voracious Spider", + head: "8300986ed0a04ea79904f6ae53f49ed3a0ff5b1df62bba622ecbd3777f156df8", + }, + { + id: "kills_family_splitter_spider", + name: "Splitter Spider", + head: "2acf69fc7af5497a1741891d1e5bf32b96ae0d6c0bbd3c14758ea44a03c57283", + }, + { + id: "kills_family_brood_mother_spider", + boss: true, + name: "Brood Mother", + head: "cf0622b3998d42b34d5bc760bb2c83fdbc6e68fab05b7ea17b35097ed81190d6", + }, + { + id: "kills_family_respawning_skeleton", + name: "Gravel Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + }, + { + id: "kills_family_random_slime", + name: "Rain Slime", + head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", + }, + { + id: "kills_family_arachne_keeper", + name: "Arachne's Keeper", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + id: "kills_family_arachne_brood", + name: "Arachne's Brood", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + boss: true, + id: "kills_family_arachne", + name: "Arachne", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + ], + }, + fortress: { + max: 1000, + mobs: [ + { + id: "kills_family_ashfang", + boss: true, + name: "Ashfang", + head: "3d2a5b4b109bd788edba0171d0aab8a55305ac2f56184df70a319cd488a36c3e", + }, + { + id: "kills_family_barbarian_duke_x", + boss: true, + name: "Barbarian Duke X", + head: "fee9fc7c181e2f630f6b1af85d4951359cafcfa82ff5ea3bc283e0e6088c6e54", + }, + { + id: "kills_family_bladesoul", + boss: true, + name: "Bladesoul", + head: "7f5f3384384d7f03bf97a73099b0bafb72c538fc0415ac8613b664f87579a379", + }, + { + id: "kills_family_blaze", + name: "Blaze", + head: "b78ef2e4cf2c41a2d14bfde9caff10219f5b1bf5b35a49eb51c6467882cb5f0", + }, + { + id: "kills_family_flaming_spider", + name: "Flaming Spider", + head: "5a65ef23ea35047150d33880473a47fe635f0c0e3c823bd76dc849cb02441655", + }, + { + id: "kills_family_ghast", + name: "Ghast", + head: "de8a38e9afbd3da10d19b577c55c7bfd6b4f2e407e44d4017b23be9167abff02", + }, + { + id: "kills_family_mage_outlaw", + boss: true, + name: "Mage Outlaw", + head: "ebec99b3a050fd277528407676366e20b92006ad88d14727a4d99eb8cb273b62", + }, + { + id: "kills_family_magma_cube", + name: "Magma Cube", + head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", + }, + { + id: "kills_family_magma_cube_boss", + boss: true, + name: "Magma Cube Boss", + head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", + }, + { + id: "kills_family_matcho", + name: "Matcho", + head: "ef2daabb78a1f7aa12d145d88c0ca46b9e856f5534e9286e555faf0c291f4fd5", + }, + { + id: "kills_family_charging_mushroom_cow", + name: "Mushroom Bull", + head: "2b52841f2fd589e0bc84cbabf9e1c27cb70cac98f8d6b3dd065e55a4dcb70d77", + }, + { + id: "kills_family_pigman", + name: "Pigman", + head: "74e9c6e98582ffd8ff8feb3322cd1849c43fb16b158abb11ca7b42eda7743eb", + }, + { + id: "kills_family_wither_skeleton", + name: "Wither Skeleton", + head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", + }, + { + id: "kills_family_wither_spectre", + name: "Wither Spectre", + head: "f6aa5acfd973f67ba8e249ae07a11ae7ca713c900d90d09ce0903c79ddd7dd9e", + }, + ], + }, + end: { + max: 1000, + mobs: [ + { + id: "kills_family_enderman", + name: "Enderman", + head: "96c0b36d53fff69a49c7d6f3932f2b0fe948e032226d5e8045ec58408a36e951", + }, + { + id: "kills_family_obsidian_wither", + name: "Obsidian Defender", + head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", + }, + { + id: "kills_family_watcher", + name: "Watcher", + head: "daa8fc8de6417b48d48c80b443cf5326e3d9da4dbe9b25fcd49549d96168fc0", + }, + { + id: "kills_family_zealot_enderman", + name: "Zealot", + skyblockId: "SUMMONING_EYE", + itemId: 130, + damage: 0, + }, + { + id: "kills_family_endermite", + name: "Endermite", + head: "5bc7b9d36fb92b6bf292be73d32c6c5b0ecc25b44323a541fae1f1e67e393a3e", + }, + { + id: "kills_family_dragon", + boss: true, + name: "Dragon", + skyblockId: "DRAGON_EGG", + itemId: 122, + damage: 0, + }, + { + id: "kills_family_corrupted_protector", + boss: true, + name: "Endstone Protector", + head: "22bcaceeb4162f400d44743315932ac820d3119ac8986a0161a726161ccc93fc", + }, + { + id: "kills_family_voidling_fanatic", + name: "Voidling Fanatic", + head: "e53b7bcd56f0b95f87dd79ed17636beb9d8346744014228ea2f6b110b148c1", + }, + { + id: "kills_family_voidling_extremist", + name: "Voidling Extremist", + head: "eb07594e2df273921a77c101d0bfdfa1115abed5b9b2029eb496ceba9bdbb4b3", + }, + ], + }, + caverns: { + max: 1000, + mobs: [ + { + id: "kills_family_invisible_creeper", + name: "Sneaky Creeper", + skyblockId: "CREEPER_SKULL", + itemId: 397, + damage: 4, + }, + { + id: "kills_family_lapis_zombie", + name: "Lapis Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 351, + damage: 4, + }, + { + id: "kills_family_redstone_pigman", + name: "Redstone Pigman", + skyblockId: "REDSTONE", + itemId: 331, + damage: 0, + }, + { + id: "kills_family_emerald_slime", + name: "Emerald Slime", + head: "5774e86aa4cff792395b77add57b00bb1a102f8f0f0980f4d55b3d7aff1e6da9", + }, + { + id: "kills_family_diamond_zombie", + name: "Miner Zombie", + head: "d28d9ff54188a1afee65b94f3bfcce321c643a34590c14b192b2e3ec2f525d3", + }, + { + id: "kills_family_diamond_skeleton", + name: "Miner Skeleton", + head: "836bbc4215cea1b6a484e893b116e73459ef36bffc622741e577e9493a41e6e", + }, + { + id: "kills_family_caverns_ghost", + name: "Ghost", + head: "981977918a1180e0dec879e6bcd1aa39494977bb913be2ab01aff1db1fa4", + }, + { + id: "kills_family_goblin", + name: "Goblin", + head: "b6b972e32d761b192626e5d6d01edc094940910103cea5e2e2d1f231adb755d5", + }, + { + id: "kills_family_treasure_hoarder", + name: "Treasure Hoarder", + head: "b2b12a814ced8af02cddf29a37e7f3011e430e8a18b38b706f27c6bd31650b65", + }, + { + id: "kills_family_ice_walker", + name: "Ice Walker", + skyblockId: "PACKED_ICE", + itemId: 174, + damage: 0, + }, + { + id: "kills_family_automaton", + name: "Automaton", + head: "22bcaceeb4162f400d44743315932ac820d3119ac8986a0161a726161ccc93fc", + }, + { + id: "kills_family_butterfly", + name: "Butterfly", + head: "9fd806defdfdf59b1f2609c8ee364666de66127a623415b5430c9358c601ef7c", + }, + { + id: "kills_family_team_treasurite", + name: "Grunt", + head: "ef5e03b8de119f8589a808224cbea737f5dcf24235799b7378ac5bf06abf6dd4", + }, + { + id: "kills_family_sludge", + name: "Sludge", + head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", + }, + { + id: "kills_family_thyst", + name: "Thyst", + head: "5bc7b9d36fb92b6bf292be73d32c6c5b0ecc25b44323a541fae1f1e67e393a3e", + }, + { + id: "kills_family_worms", + name: "Worm", + head: "df03ad96092f3f789902436709cdf69de6b727c121b3c2daef9ffa1ccaed186c", + }, + { + id: "kills_family_yog", + name: "Yog", + head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", + }, + ], + }, + park: { + max: 1000, + mobs: [ + { + id: "kills_family_pack_spirit", + name: "Pack Spirit", + head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", + }, + { + id: "kills_family_howling_spirit", + name: "Howling Spirit", + head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", + }, + { + id: "kills_family_soul_of_the_alpha", + name: "Soul of the Alpha", + head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", + }, + ], + }, + spooky: { + max: 1000, + mobs: [ + { + id: "kills_family_trick_or_treater", + name: "Trick or Treater", + head: "d7cbe061b445b88cb2df59accc8d2c1c12118fe0b2127e6e75813550adac67cf", + }, + { + id: "kills_family_wither_gourd", + name: "Wither Gourd", + head: "68f2ffc6fb4e9959b9a7a317f51a6775a159ddc2241dbd6c774d3ac08b6", + }, + { + id: "kills_family_phantom_spirit", + name: "Phantom Spirit", + head: "653b2f7c5e177bd67cead30d0ee53425c7684c975c8c2a5273a09ca49a1f6cdd", + }, + { + id: "kills_family_scary_jerry", + name: "Scary Jerry", + head: "df202dc24d15f7ce36e02fb4b3e8153b146ab9c1724aaa5d484c741da0eeb6fd", + }, + { + id: "kills_family_wraith", + name: "Wraith", + head: "aeabc3075cf41f38e6df1236b95caafcba1bee22c49d804b9427488c2f6e0efc", + }, + { + id: "kills_family_batty_witch", + name: "Crazy Witch", + head: "fce6604157fc4ab5591e4bcf507a749918ee9c41e357d47376e0ee7342074c90", + }, + { + id: "kills_family_headless_horseman", + boss: true, + name: "Headless Horseman", + head: "4c6570f1242992f6eba23ee582598c39e3e745383273deef8b3977583fe3cf5", + }, + ], + }, + catacombs: { + max: 1000, + mobs: [ + { + id: "kills_family_lost_adventurer", + name: "Lost Adventurer", + head: "1e0329f42192ee7c1a0c704f82dbbbe7c00fbfa3f020c1067a208630b991b988", + }, + { + id: "kills_family_zombie_grunt", + name: "Zombie Grunt", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_zombie_soldier", + name: "Zombie Soldier", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_zombie_knight", + name: "Zombie Soldier", + head: "25d2f31ba162fe6272e831aed17f53213db6fa1c4cbe4fc827f3963cc98b9", + }, + { + id: "kills_family_skeleton_grunt", + name: "Skeleton Grunt", + head: "70471677b37ae842c2bd232e16eeb84d5a493231eecec072da38be3127dd5c8", + }, + { + id: "kills_family_skeleton_soldier", + name: "Skeleton Soldier", + head: "219688e0c2f05aeb979d6a1b8c911957b7d3657e14b57af93c5ef6f6a59569dd", + }, + { + id: "kills_family_skeleton_master", + name: "Skeleton Master", + head: "74e95e1b7dc82ba7845a68fc6a312f4cd90ee2f6cce26a68c88b04b1072d879", + }, + { + id: "kills_family_scared_skeleton", + name: "Scared Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + }, + { + id: "kills_family_diamond_guy", + name: "Angry Archeologist", + head: "c48c783458e4cf8518e8ab5863fbc4cb948f90568eeb9a60d16c4fde2b96c033", + }, + { + id: "kills_family_dungeon_respawning_skeleton", + name: "Undead Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + }, + { + id: "kills_family_skeletor", + name: "Skeletor", + head: "89d074ad9b9971879eb325bddff3675f7224856bd6d569fc8d483c133d73005d", + }, + { + id: "kills_family_sniper_skeleton", + name: "Sniper", + head: "b18c071f080dba50a62a6263ff724edc157ce4fb4883cceff2491d5bbde830c1", + }, + { + id: "kills_family_crypt_souleater", + name: "Crypt Souleater", + head: "66f349270a3b851896cdad842f5eec6e140bd9119b75c074955c3be7865e27c7", + }, + { + id: "kills_family_crypt_dreadlord", + name: "Crypt Dreadlord", + head: "66f349270a3b851896cdad842f5eec6e140bd9119b75c074955c3be7865e27c7", + }, + { + id: "kills_family_crypt_tank_zombie", + name: "Tank Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_super_tank_zombie", + name: "Super Tank Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_crypt_lurker", + name: "Crypt Lurker", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_cellar_spider", + name: "Cellar Spider", + head: "41645dfd77d09923107b3496e94eeb5c30329f97efc96ed76e226e98224", + }, + { + id: "kills_family_watcher_summon_undead", + name: "Undead", + head: "f4624a9a8c69ca204504abb043d47456cd9b09749a36357462303f276a229d4", + }, + { + id: "kills_family_lonely_spider", + name: "Lonely Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + id: "kills_family_shadow_assassin", + name: "Shadow Assassin", + head: "3399e00f404411e465d74388df132d51fe868ecf86f1c073faffa1d9172ec0f3", + }, + { + id: "kills_family_king_midas", + name: "King Midas", + head: "62bca085750043503f5df9f7def824a2e3acfc27842bcd09d2b6695881e832f5", + }, + { + id: "kills_family_super_archer", + name: "Super Archer", + head: "dcae6db0b59a64305076d966d8e7b9a97be46dae3a807714fa86d37848f6", + }, + { + id: "kills_family_crypt_witherskeleton", + name: "Withermancer", + head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", + }, + { + id: "kills_family_zombie_commander", + name: "Zombie Commander", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + ], + }, + }; + + export const BEASTIARY_KILLS = { + regular: [ + 10, 25, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 200000, 300000, 400000, 500000, 600000, + 700000, 800000, 900000, 1000000, 1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 1900000, + 2000000, 2100000, 2200000, 2300000, 2400000, 2500000, 2600000, 2700000, 2800000, 2900000, 3000000, + ], + boss: [ + 2, 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, + 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, + ], + }; \ No newline at end of file diff --git a/src/constants/misc.js b/src/constants/misc.js index 7289349106..9be8202752 100644 --- a/src/constants/misc.js +++ b/src/constants/misc.js @@ -66,6 +66,7 @@ export const BASE_STATS = { social_wisdom: 0, }; + export const STAT_TEMPLATE = { health: 0, defense: 0, @@ -89,9 +90,9 @@ export const STAT_TEMPLATE = { damage: 0, damage_increase: 0, fishing_speed: 0, - health_regen: 0, - vitality: 0, - mending: 0, + health_regen: 100, + vitality: 100, + mending: 100, combat_wisdom: 0, mining_wisdom: 0, farming_wisdom: 0, @@ -418,3 +419,27 @@ export const ESSENCE = { export const STAT_MAPPINGS = { walk_speed: "speed", }; + +export const FORBIDDEN_STATS ={ + speed: 1, + intelligence: 2, + health: 2, + defense: 1, + strength: 1, +} + +export const HARP_QUEST = { + song_hymn_joy_best_completion: 1, + song_frere_jacques_best_completion: 1, + song_amazing_grace_best_completion: 1, + song_brahms_best_completion: 2, + song_happy_birthday_best_completion: 2, + song_greensleeves_best_completion: 2, + song_jeopardy_best_completion: 3, + song_minuet_best_completion: 3, + song_joy_world_best_completion: 3, + song_pure_imagination_best_completion: 4, + song_vie_en_rose_best_completion: 4, + song_fire_and_flames_best_completion: 1, + song_pachelbel_best_completion: 1, +} \ No newline at end of file diff --git a/src/hotm.js b/src/hotm.js new file mode 100644 index 0000000000..55b2a8c663 --- /dev/null +++ b/src/hotm.js @@ -0,0 +1,1437 @@ +import { SYMBOLS } from "../../common/constants.js"; +import { round, floor, ceil, convertHMS, titleCase } from "../helper.js"; + +const UPGRADE_TYPES = { + mithril_powder: { + name: "Mithril Powder", + color: "2", + }, + gemstone_powder: { + name: "Gemstone Powder", + color: "d", + }, + token_of_the_mountain: { + name: "Token of the Mountain", + color: "5", + }, + free: { + name: "FREE", + color: "a", + }, +}; + +const rewards = { + hotm: { + 1: { + token_of_the_mountain: 1, + }, + 2: { + token_of_the_mountain: 2, + access_to_forge: 0, + new_forgeable_items: 0, + }, + 3: { + token_of_the_mountain: 2, + forge_slot: 1, + new_forgeable_items: 0, + access_crystal_hollows: 0, + emissary_braum_crystal_hollows: 0, + }, + 4: { + token_of_the_mountain: 2, + forge_slot: 1, + new_forgeable_items: 0, + }, + 5: { + token_of_the_mountain: 2, + new_forgeable_items: 0, + }, + 6: { + token_of_the_mountain: 2, + new_forgeable_items: 0, + }, + 7: { + token_of_the_mountain: 2, + new_forgeable_items: 0, + }, + }, + potm: { + 1: { + pickaxe_ability_level: 1, + token_of_the_mountain: 1, + }, + 2: { + forge_slot: 1, + }, + 3: { + commission_slot: 1, + }, + 4: { + mithril_powder_when_mining_mithril: 1, + }, + 5: { + token_of_the_mountain: 1, + }, + 6: { + token_of_the_mountain: 1, + }, + 7: {}, + }, + rewards: { + token_of_the_mountain: { + formatted: "§5Token of the Mountain", + qtyColor: "5", + }, + access_to_forge: { + formatted: "§eAccess to the Forge", + qtyColor: "e", + }, + new_forgeable_items: { + formatted: "§eNew Forgeable Items", + qtyColor: "e", + }, + forge_slot: { + formatted: "§aForge Slot", + qtyColor: "a", + }, + access_crystal_hollows: { + formatted: "§dAccess to the §5Crystal Hollows", + qtyColor: "d", + }, + emissary_braum_crystal_hollows: { + formatted: "§eEmissary Braum §f- §bCrystal Hollows", + qtyColor: "e", + }, + pickaxe_ability_level: { + formatted: "§cPickaxe Ability Level", + qtyColor: "c", + }, + commission_slot: { + formatted: "§aCommission Slot", + qtyColor: "a", + }, + mithril_powder_when_mining_mithril: { + formatted: "§2Mithril Powder §7when mining §fMithril", + qtyColor: "2", + }, + }, +}; + +const nodeNames = { + mining_speed_2: "Mining Speed II", + powder_buff: "Powder Buff", + mining_fortune_2: "Mining Fortune II", + vein_seeker: "Vein Seeker", + lonesome_miner: "Lonesome Miner", + professional: "Professional", + mole: "Mole", + fortunate: "Fortunate", + great_explorer: "Great Explorer", + maniac_miner: "Maniac Miner", + goblin_killer: "Goblin Killer", + special_0: "Peak of the Mountain", + star_powder: "Star Powder", + daily_effect: "Sky Mall", + mining_madness: "Mining Madness", + mining_experience: "Seasoned Mineman", + efficient_miner: "Efficient Miner", + experience_orbs: "Orbiter", + front_loaded: "Front Loaded", + precision_mining: "Precision Mining", + random_event: "Luck of the Cave", + daily_powder: "Daily Powder", + fallen_star_bonus: "Crystallized", + mining_speed_boost: "Mining Speed Boost", + titanium_insanium: "Titanium Insanium", + mining_fortune: "Mining Fortune", + forge_time: "Quick Forge", + pickaxe_toss: "Pickobulus", + mining_speed: "Mining Speed", +}; + +/* +.##.....##..#######..########.##.....## +.##.....##.##.....##....##....###...### +.##.....##.##.....##....##....####.#### +.#########.##.....##....##....##.###.## +.##.....##.##.....##....##....##.....## +.##.....##.##.....##....##....##.....## +.##.....##..#######.....##....##.....## +*/ + +class HotM { + constructor(tier, level) { + this.tier = tier; + this.level = level.level; + this.progress = level.progress; + this.levelWithProgress = level.levelWithProgress; + this.xp = level.xp; + this.xpCurrent = level.xpCurrent; + this.xpForNext = level.xpForNext; + } + + get lore() { + const output = []; + + // name + output.push(this.displayName, ""); + + // main + if (this.status === "unlocked") { + output.push( + "§7You have unlocked this tier. All perks and abilities on this tier are available for unlocking with §5Token of the Mountain§7.", + "" + ); + } else { + output.push( + "§7Progress through your Heart of the Mountain by gaining §5HotM Exp§7, which is earned through completing §aCommissions§7.", + "", + "§7Commissions are tasks given by the §e§lKing§r§7 in the §bRoyal Palace§7. Complete them to earn bountiful rewards!", + "" + ); + } + + // progress + if (this.status === "next") { + const progress = round(this.progress * 100); + const greenBars = ceil(progress / 5); + const whiteBars = 20 - greenBars; + output.push( + `§7Progress: §e${progress}%`, + `${"§2-".repeat(greenBars)}${"§f-".repeat( + whiteBars + )} §e${this.xpCurrent.toLocaleString()} §6/ §e${this.xpForNext.toLocaleString()}`, + "" + ); + } + + // rewards + output.push("§7Rewards"); + for (const [reward, qty] of Object.entries(rewards.hotm[this.tier])) { + const quantity = qty > 0 ? `§${rewards.rewards[reward].qtyColor}${qty} ` : ""; + const name = rewards.rewards[reward].formatted; + output.push(`§8+ ${quantity}${name}`); + } + output.push(""); + + // status + output.push(this.status === "unlocked" ? "§aUNLOCKED" : "§cLOCKED"); + + return output; + } + + get displayName() { + const color = this.status === "unlocked" ? "a" : this.status === "next" ? "e" : "c"; + return `§${color}Tier ${this.tier}`; + } + + get status() { + if (this.tier <= this.level) { + return "unlocked"; + } + + if (this.tier === ceil(this.levelWithProgress)) { + return "next"; + } + + return "locked"; + } + + get itemData() { + const data = { + locked: "160:14", + next: "160:4", + unlocked: "160:5", + }; + + return { + id: parseInt(data[this.status].split(":")[0], 10), + Damage: parseInt(data[this.status].split(":")[1], 10), + glowing: false, + }; + } + + get position7x9() { + return 9 * (HOTM.tiers - this.tier) + 1; + } +} + +/* +.##....##..#######..########..########..######. +.###...##.##.....##.##.....##.##.......##....## +.####..##.##.....##.##.....##.##.......##...... +.##.##.##.##.....##.##.....##.######....######. +.##..####.##.....##.##.....##.##.............## +.##...###.##.....##.##.....##.##.......##....## +.##....##..#######..########..########..######. +*/ + +class Node { + constructor(data) { + this.nodeType = "normal"; + this.level = data.level; + this.enabled = data.enabled; + this.nodes = data.nodes; + this.hotmTier = data.hotmLevelData.level; + this.potmLevel = data.nodes.special_0; + this.selectedPickaxeAbility = data.selectedPickaxeAbility; + } + + get position7x9() { + return this.position + 1 + (ceil(this.position / HOTM.tiers) - 1) * 2; + } + + get itemData() { + const data = { + normal: { + locked: "263:0", + unlocked: "388:0", + maxed: "264:0", + }, + pickaxe_ability: { + locked: "173:0", + unlocked: "133:0", + maxed: "133:0", + }, + special: { + locked: "7:0", + unlocked: "152:0", + maxed: "152:0", + }, + }; + + return { + id: parseInt(data[this.nodeType][this.status].split(":")[0], 10), + Damage: parseInt(data[this.nodeType][this.status].split(":")[1], 10), + glowing: this.selectedPickaxeAbility === this.id, + }; + } + + get lore() { + const output = []; + + // Name + output.push(this.displayName); + + // Level + if (this.max_level > 1) { + if (this.maxed) { + output.push(`§7Level ${Math.max(1, this.level)}`); + } else { + output.push(`§7Level ${Math.max(1, this.level)}§8/${this.max_level}`); + } + } + output.push(""); + + // Perk + output.push(...this.perk(Math.max(1, this.level))); + + // Upgradeable + if (this.level > 0 && this.level < this.max_level) { + // header + output.push("", "§a=====[ §a§lUPGRADE §a] ====="); + + // upgrade perk + output.push(`§7Level ${this.level + 1}§8/${this.max_level}`, "", ...this.perk(this.level + 1)); + + // upgrade cost + output.push( + "", + "§7Cost", + `§${UPGRADE_TYPES[this.upgrade_type].color}${this.upgradeCost.toLocaleString()} ${ + UPGRADE_TYPES[this.upgrade_type].name + }` + ); + } + + // Maxed perk + if (this.maxed && this.nodeType !== "pickaxe_ability") { + output.push("", "§aUNLOCKED"); + } + + // Unlock cost + if (this.level === 0) { + output.push("", "§7Cost"); + for (const [upgradeId, upgradeQty] of Object.entries(this.unlockCost)) { + output.push( + `§${UPGRADE_TYPES[upgradeId].color}${upgradeQty > 0 ? `${upgradeQty} ` : ""}${UPGRADE_TYPES[upgradeId].name}` + ); + } + } + + // Requirements + if (this.level === 0) { + if (this.requires.length > 0 && !this.requires.some((x) => Object.keys(this.nodes).includes(x))) { + const reqs = this.requires.map((x) => nodeNames[x]); + const reqsFriendly = reqs.length > 1 ? reqs.slice(0, -1).join(", ") + " or " + reqs.slice(-1) : reqs[0]; + output.push("", `§cRequires ${reqsFriendly}.`); + } + + if (this.requiredHotmTier > this.hotmTier) { + output.push("", `§cRequires HotM Tier ${this.requiredHotmTier}.`); + } + } + + // Status + if (this.level > 0 && this.nodeType === "normal") { + output.push("", this.enabled ? "§aENABLED" : "§cDISABLED"); + } + + // Selected Pickaxe Ability + if (this.level > 0 && this.nodeType === "pickaxe_ability") { + if (this.selectedPickaxeAbility === this.id) { + output.push("", "§aSELECTED"); + } else { + output.push("", "§eClick to select!"); + } + } + + return output.map((x) => "§r" + x); + } + + get pickaxeAbilityLevel() { + // Blue Omelette gives +1 level, impossible to account for in here + let level = 1; + + if (this.potmLevel >= 1) { + level += 1; + } + + return level; + } + + get requiredHotmTier() { + return Math.abs(ceil(this.position / 7) - 7) + 1; + } + + get unlockCost() { + return { + token_of_the_mountain: 1, + }; + } + + get displayName() { + const nameColor = this.status === "maxed" ? "a" : this.status === "unlocked" ? "e" : "c"; + return `§${nameColor}§l${this.name}`; + } + + get status() { + if (this.level === this.max_level) { + return "maxed"; + } + + if (this.level === 0) { + return "locked"; + } + + return "unlocked"; + } + + get maxed() { + return this.level === this.max_level; + } + + get upgradeCost() { + return -1; + } + + perk(level) { + return ["Missing perk description."]; + } + + get totalUpgradeCost() { + let total = 0; + const originalLevel = this.level; + + for (let level = 1; level < this.max_level; level++) { + this.level = level; + total += this.upgradeCost; + } + + this.level = originalLevel; + + return total; + } +} + +class MiningSpeed2 extends Node { + constructor(data) { + super(data); + this.id = "mining_speed_2"; + this.name = nodeNames[this.id]; + this.position = 2; + this.max_level = 50; + this.upgrade_type = "gemstone_powder"; + this.requires = ["lonesome_miner"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.2)); + } + + perk(level) { + const val = level * 40; + return [`§7Grants §a+${val} §6${SYMBOLS.mining_speed} Mining Speed§7.`]; + } +} + +class PowderBuff extends Node { + constructor(data) { + super(data); + this.id = "powder_buff"; + this.name = nodeNames[this.id]; + this.position = 4; + this.max_level = 50; + this.upgrade_type = "gemstone_powder"; + this.requires = ["mole"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.2)); + } + + perk(level) { + const val = level * 1; + return [`§7Gain §a${val}% §7more Mithril Powder and Gemstone Powder.`]; + } +} + +class MiningFortune2 extends Node { + constructor(data) { + super(data); + this.id = "mining_fortune_2"; + this.name = nodeNames[this.id]; + this.position = 6; + this.max_level = 50; + this.upgrade_type = "gemstone_powder"; + this.requires = ["great_explorer"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.2)); + } + + perk(level) { + const val = level * 5; + return [`§7Grants §a+${val} §6${SYMBOLS.mining_fortune} Mining Fortune§7.`]; + } +} + +class VeinSeeker extends Node { + constructor(data) { + super(data); + this.id = "vein_seeker"; + this.name = nodeNames[this.id]; + this.position = 8; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["lonesome_miner"]; + this.nodeType = "pickaxe_ability"; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + const spread = [2, 3, 4][this.pickaxeAbilityLevel - 1]; + const duration = [12, 14, 16][this.pickaxeAbilityLevel - 1]; + const cooldown = [60, 60, 60][this.pickaxeAbilityLevel - 1]; + return [ + "§6Pickaxe Ability: Vein Seeker", + `§7Points in the direction of the nearest vein and grants §a+${spread} §6Mining Spread §7for §a${duration}s§7.`, + `§8Cooldown: §a${cooldown}s`, + "", + "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", + "", + "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", + ]; + } +} + +class LonesomeMiner extends Node { + constructor(data) { + super(data); + this.id = "lonesome_miner"; + this.name = nodeNames[this.id]; + this.position = 9; + this.max_level = 45; + this.upgrade_type = "gemstone_powder"; + this.requires = ["goblin_killer", "professional"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.07)); + } + + perk(level) { + const val = round(5 + (level - 1) * 0.5); + return [ + `§7Increases §c${SYMBOLS.strength} Strength, §9${SYMBOLS.crit_chance} Crit Chance, §9${SYMBOLS.crit_damage} Crit Damage, §a${SYMBOLS.defense} Defense, and §c${SYMBOLS.health} Health §7statistics gain by §a${val}% §7while in the Crystal Hollows.`, + ]; + } +} + +class Professional extends Node { + constructor(data) { + super(data); + this.id = "professional"; + this.name = nodeNames[this.id]; + this.position = 10; + this.max_level = 140; + this.upgrade_type = "gemstone_powder"; + this.requires = ["mole", "lonesome_miner"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 2.3)); + } + + perk(level) { + const val = 50 + level * 5; + return [`§7Gain §a+${val}§7 §6${SYMBOLS.mining_speed} Mining Speed§7 when mining Gemstones.`]; + } +} + +class Mole extends Node { + constructor(data) { + super(data); + this.id = "mole"; + this.name = nodeNames[this.id]; + this.position = 11; + this.max_level = 190; + this.upgrade_type = "gemstone_powder"; + this.requires = ["efficient_miner", "professional", "fortunate"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 2.2)); + } + + perk(level) { + const chance = 50 + (level - 1) * 5; + let blocks = 1 + floor(chance / 100); + let percent = chance - floor(chance / 100) * 100; + if (percent === 0) { + blocks -= 1; + percent = 100; + } + + switch (blocks) { + case 1: + blocks = "1"; + break; + case 2: + blocks = "a 2nd"; + break; + case 3: + blocks = "a 3rd"; + break; + default: + blocks = `a ${blocks}th`; + break; + } + + return [ + `§7When mining hard stone, you have a §a${percent}%§7 chance to mine §a${blocks}§7 adjacent hard stone block.`, + ]; + } +} + +class Fortunate extends Node { + constructor(data) { + super(data); + this.id = "fortunate"; + this.name = nodeNames[this.id]; + this.position = 12; + this.max_level = 20; + this.upgrade_type = "mithril_powder"; + this.requires = ["mole", "great_explorer"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.05)); + } + + perk(level) { + const val = 20 + level * 4; + return [`§7Grants §a+${val}§7 §6${SYMBOLS.mining_fortune} Mining Fortune§7 when mining Gemstone.`]; + } +} + +class GreatExplorer extends Node { + constructor(data) { + super(data); + this.id = "great_explorer"; + this.name = nodeNames[this.id]; + this.position = 13; + this.max_level = 20; + this.upgrade_type = "gemstone_powder"; + this.requires = ["star_powder", "fortunate"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 4)); + } + + perk(level) { + const val = 20 + (level - 1) * 4; + return [`§7Grants §a+${val}%§7 §7chance to find treasure.`]; + } +} + +class ManiacMiner extends Node { + constructor(data) { + super(data); + this.id = "maniac_miner"; + this.name = nodeNames[this.id]; + this.position = 14; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["great_explorer"]; + this.nodeType = "pickaxe_ability"; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + const speed = [1, 1, 1][this.pickaxeAbilityLevel - 1]; + const duration = [10, 15, 20][this.pickaxeAbilityLevel - 1]; + const cooldown = [60, 59, 59][this.pickaxeAbilityLevel - 1]; + return [ + "§6Pickaxe Ability: Maniac Miner", + `§7Spends all your Mana and grants §a+${speed} §6${SYMBOLS.mining_speed} Mining Speed §7for every 10 Mana spent, for §a${duration}s§7.`, + `§8Cooldown: §a${cooldown}s`, + "", + "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", + "", + "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", + ]; + } +} + +class GoblinKiller extends Node { + constructor(data) { + super(data); + this.id = "goblin_killer"; + this.name = nodeNames[this.id]; + this.position = 16; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["mining_madness", "lonesome_miner"]; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + return [ + `§7Killing a §6Golden Goblin §7gives §2200 §7extra §2Mithril Powder§7, while killing other Goblins gives some based on their wits.`, + ]; + } +} + +class PeakOfTheMountain extends Node { + constructor(data) { + super(data); + this.id = "special_0"; + this.name = nodeNames[this.id]; + this.position = 18; + this.max_level = 5; + this.upgrade_type = "mithril_powder"; + this.requires = ["efficient_miner"]; + this.nodeType = "special"; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(25000 * nextLevel); + } + + perk(level) { + const output = []; + + for (let tier = 1; tier <= level; tier++) { + for (const [reward, qty] of Object.entries(rewards.potm[tier])) { + const qtyColor = rewards.rewards[reward].qtyColor; + const formatted = rewards.rewards[reward].formatted; + output.push(`§8+ §${qtyColor}${qty} ${formatted}`); + } + } + + return output; + } + + get unlockCost() { + return { + free: 0, + }; + } +} + +class StarPowder extends Node { + constructor(data) { + super(data); + this.id = "star_powder"; + this.name = nodeNames[this.id]; + this.position = 20; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["front_loaded", "great_explorer"]; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + return [`§7Mining Mithril Ore near §5Fallen Crystals §7gives §a+3 §7extra Mithril Powder.`]; + } +} + +class SkyMall extends Node { + constructor(data) { + super(data); + this.id = "daily_effect"; + this.name = nodeNames[this.id]; + this.position = 22; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["mining_madness"]; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + return [ + "§7Every SkyBlock day, you receive a random buff in the §2Dwarven Mines§7.", + "", + "§7Possible Buffs", + `§8 ■ §7Gain §a+100 §6${SYMBOLS.mining_speed} Mining Speed.`, + `§8 ■ §7Gain §a+50 §6${SYMBOLS.mining_fortune} Mining Fortune.`, + "§8 ■ §7Gain §a+15% §7chance to gain extra Powder while mining.", + "§8 ■ §7Reduce Pickaxe Ability cooldown by §a20%", + "§8 ■ §7§a10x §7chance to find Goblins while mining.", + "§8 ■ §7Gain §a5x §9Titanium §7drops.", + ]; + } +} + +class MiningMadness extends Node { + constructor(data) { + super(data); + this.id = "mining_madness"; + this.name = nodeNames[this.id]; + this.position = 23; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["random_event", "mining_experience", "goblin_killer"]; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + return [ + `§7Grants §a+50 §6${SYMBOLS.mining_speed} Mining Speed §7and §6${SYMBOLS.mining_fortune} Mining Fortune§7.`, + ]; + } +} + +class SeasonedMineman extends Node { + constructor(data) { + super(data); + this.id = "mining_experience"; + this.name = nodeNames[this.id]; + this.position = 24; + this.max_level = 100; + this.upgrade_type = "mithril_powder"; + this.requires = ["efficient_miner", "mining_madness"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 2.3)); + } + + perk(level) { + const val = round(5 + level * 0.1, 1); + return [`§7Increases your Mining experience gain by §a${val}%§7.`]; + } +} + +class EfficientMiner extends Node { + constructor(data) { + super(data); + this.id = "efficient_miner"; + this.name = nodeNames[this.id]; + this.position = 25; + this.max_level = 100; + this.upgrade_type = "mithril_powder"; + this.requires = ["daily_powder", "mining_experience", "experience_orbs"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 2.6)); + } + + perk(level) { + const val1 = round(10 + level * 0.4, 1); + const val2 = ceil((level + 1) / 20); + return [`§7When mining ores, you have a §a${val1}%§7 chance to mine §a${val2} §7adjacent ores.`]; + } +} + +class Orbiter extends Node { + constructor(data) { + super(data); + this.id = "experience_orbs"; + this.name = nodeNames[this.id]; + this.position = 26; + this.max_level = 80; + this.upgrade_type = "mithril_powder"; + this.requires = ["efficient_miner", "front_loaded"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(70 * nextLevel); + } + + perk(level) { + const val = round(0.2 + level * 0.01, 2); + return [`§7When mining ores, you have a §a${val}%§7 chance to get a random amount of experience orbs.`]; + } +} + +class FrontLoaded extends Node { + constructor(data) { + super(data); + this.id = "front_loaded"; + this.name = nodeNames[this.id]; + this.position = 27; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["fallen_star_bonus", "experience_orbs", "star_powder"]; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + return [ + `§7Grants §a+100 §6${SYMBOLS.mining_speed} Mining Speed §7and §6${SYMBOLS.mining_fortune} Mining Fortune §7for the first §e2,500 §7ores you mine in a day.`, + ]; + } +} + +class PrecisionMining extends Node { + constructor(data) { + super(data); + this.id = "precision_mining"; + this.name = nodeNames[this.id]; + this.position = 28; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["front_loaded"]; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + return [ + `§7When mining ore, a particle target appears on the block that increases your §6${SYMBOLS.mining_speed} Mining Speed §7by §a30% §7when aiming at it.`, + ]; + } +} + +class LuckOfTheCave extends Node { + constructor(data) { + super(data); + this.id = "random_event"; + this.name = nodeNames[this.id]; + this.position = 30; + this.max_level = 45; + this.upgrade_type = "mithril_powder"; + this.requires = ["mining_speed_boost", "mining_madness"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.07)); + } + + perk(level) { + const val = 5 + level * 1; + return [`§7Increases the chance for you to trigger rare occurrences in §2Dwarven Mines §7by §a${val}%§7.`]; + } +} + +class DailyPowder extends Node { + constructor(data) { + super(data); + this.id = "daily_powder"; + this.name = nodeNames[this.id]; + this.position = 32; + this.max_level = 100; + this.upgrade_type = "mithril_powder"; + this.requires = ["mining_fortune"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(182 + 18 * nextLevel); + } + + perk(level) { + const val = 400 + (level - 1) * 36; + return [`§7Gain §a${val} Powder §7from the first ore you mine every day. Works for all Powder types.`]; + } +} + +class Crystallized extends Node { + constructor(data) { + super(data); + this.id = "fallen_star_bonus"; + this.name = nodeNames[this.id]; + this.position = 34; + this.max_level = 30; + this.upgrade_type = "mithril_powder"; + this.requires = ["pickaxe_toss", "front_loaded"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.4)); + } + + perk(level) { + const val = 20 + (level - 1) * 6; + return [ + `§7Grants §a+${val} §6${SYMBOLS.mining_speed} Mining Speed §7and a §a${val}% §7chance to deal §a+1 §7extra damage near §5Fallen Stars§7.`, + ]; + } +} + +class MiningSpeedBoost extends Node { + constructor(data) { + super(data); + this.id = "mining_speed_boost"; + this.name = nodeNames[this.id]; + this.position = 37; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["titanium_insanium", "random_event"]; + this.nodeType = "pickaxe_ability"; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + const effect = [200, 300, 400][this.pickaxeAbilityLevel - 1]; + const duration = [15, 20, 25][this.pickaxeAbilityLevel - 1]; + const cooldown = [120, 120, 120][this.pickaxeAbilityLevel - 1]; + return [ + "§6Pickaxe Ability: Mining Speed Boost", + `§7Grants §a+${effect}% §6${SYMBOLS.mining_speed} Mining Speed §7for §a${duration}s§7.`, + `§8Cooldown: §a${cooldown}s`, + "", + "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", + "", + "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", + ]; + } +} + +class TitaniumInsanium extends Node { + constructor(data) { + super(data); + this.id = "titanium_insanium"; + this.name = nodeNames[this.id]; + this.position = 38; + this.max_level = 50; + this.upgrade_type = "mithril_powder"; + this.requires = ["mining_fortune", "mining_speed_boost"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.1)); + } + + perk(level) { + const val = round(2 + level * 0.1, 1); + return [`§7When mining Mithril Ore, you have a §a${val}%§7 chance to convert the block into Titanium Ore.`]; + } +} + +class MiningFortune extends Node { + constructor(data) { + super(data); + this.id = "mining_fortune"; + this.name = nodeNames[this.id]; + this.position = 39; + this.max_level = 50; + this.upgrade_type = "mithril_powder"; + this.requires = ["mining_speed"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3.05)); + } + + perk(level) { + const val = level * 5; + return [`§7Grants §a+${val} §6${SYMBOLS.mining_fortune} Mining Fortune§7.`]; + } +} + +class QuickForge extends Node { + constructor(data) { + super(data); + this.id = "forge_time"; + this.name = nodeNames[this.id]; + this.position = 40; + this.max_level = 20; + this.upgrade_type = "mithril_powder"; + this.requires = ["mining_fortune", "pickaxe_toss"]; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 4)); + } + + perk(level) { + let val = round(10 + 0.5 * level, 1); + if (level === this.max_level) { + val = 30; + } + return [`§7Decreases the time it takes to forge by §a${val}%§7.`]; + } +} + +class Pickobulus extends Node { + constructor(data) { + super(data); + this.id = "pickaxe_toss"; + this.name = nodeNames[this.id]; + this.position = 41; + this.max_level = 1; + this.upgrade_type = null; + this.requires = ["forge_time", "fallen_star_bonus"]; + this.nodeType = "pickaxe_ability"; + } + + get upgradeCost() { + return 0; + } + + perk(level) { + const radius = [2, 2, 3][this.pickaxeAbilityLevel - 1]; + const cooldown = [120, 110, 110][this.pickaxeAbilityLevel - 1]; + return [ + "§6Pickaxe Ability: Pickobulus", + `§7Throw your pickaxe to create an explosion on impact, mining all ores within a §a${radius}§7 block radius.`, + `§8Cooldown: §a${cooldown}s`, + "", + "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", + "", + "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", + ]; + } +} + +class MiningSpeed extends Node { + constructor(data) { + super(data); + this.id = "mining_speed"; + this.name = nodeNames[this.id]; + this.position = 46; + this.max_level = 50; + this.upgrade_type = "mithril_powder"; + this.requires = []; + } + + get upgradeCost() { + const nextLevel = this.level + 1; + return floor(Math.pow(nextLevel + 1, 3)); + } + + perk(level) { + const val = level * 20; + return [`§7Grants §a+${val} §6${SYMBOLS.mining_speed} Mining Speed§7.`]; + } +} + +/* +.####.########.########.##.....##..######. +..##.....##....##.......###...###.##....## +..##.....##....##.......####.####.##...... +..##.....##....######...##.###.##..######. +..##.....##....##.......##.....##.......## +..##.....##....##.......##.....##.##....## +.####....##....########.##.....##..######. +*/ + +class HotmItem { + get position7x9() { + return 9 * (HOTM.tiers - this.position) + 9; + } +} + +class HotmStats extends HotmItem { + constructor(data) { + super(); + this.displayName = "§5Heart of the Mountain"; + this.position = 1; + this.itemData = { + id: 397, + Damage: 3, + glowing: false, + texture_path: "/head/86f06eaa3004aeed09b3d5b45d976de584e691c0e9cade133635de93d23b9edb", + }; + this.resources = { + token_of_the_mountain: data.resources.token_of_the_mountain.available || 0, + mithril_powder: data.resources.mithril_powder.available || 0, + gemstone_powder: data.resources.gemstone_powder.available || 0, + }; + } + + get lore() { + return [ + `§7Token of the Mountain: §5${this.resources.token_of_the_mountain.toLocaleString()}`, + "", + "§7§8Use §5Token of the Mountain §8to unlock perks and abilities above!", + "", + `§9${SYMBOLS.powder} Powder`, + "§9Powders §8are dropped from mining ores in the §2Dwarven Mines §8and are used to upgrade the perks you've unlocked!", + "", + `§7Mithril Powder: §2${this.resources.mithril_powder.toLocaleString()}`, + `§7Gemstone Powder: §d${this.resources.gemstone_powder.toLocaleString()}`, + "", + "§8Increase your chance to gain extra Powder by unlocking perks, equipping the §2Mithril Golem Pet§8, and more!", + ]; + } +} + +class CrystalHollowsCrystals extends HotmItem { + constructor(data) { + super(); + this.displayName = "§5Crystal Hollows Crystals"; + this.position = 2; + this.itemData = { + id: 397, + Damage: 3, + glowing: false, + texture_path: "/head/ef7835fc9e6daf632160e9b7ff378788a408064cc75ebf9f5158e615bdd59603", + }; + this.crystals = data.crystals; + } + + get lore() { + return [ + "§8Crystals are used to forge Gems into §dPerfect §8Gems. They can be found hidden within the §5Crystal Hollows§8.", + "", + "§8Find and place the full set of §55 §8Crystals in the §5Crystal Nucleus §8to unlock §6rare loot chests§8!", + "", + "§dYour §5Crystal Nucleus", + `§8- §aJade ${this.formatCrystal("jade", this.crystals.jade_crystal?.state)}`, + `§8- §6Amber ${this.formatCrystal("amber", this.crystals.amber_crystal?.state)}`, + `§8- §5Amethyst ${this.formatCrystal("amethyst", this.crystals.amethyst_crystal?.state)}`, + `§8- §bSapphire ${this.formatCrystal("sapphire", this.crystals.sapphire_crystal?.state)}`, + `§8- §eTopaz ${this.formatCrystal("topaz", this.crystals.topaz_crystal?.state)}`, + "", + "§dYour Other Crystals", + `§8- §dJasper ${this.formatCrystal("jasper", this.crystals.jasper_crystal?.state)}`, + `§8- §cRuby ${this.formatCrystal("ruby", this.crystals.ruby_crystal?.state)}`, + ]; + } + + formatCrystal(crystal, state) { + if (!state) { + state = "NOT_FOUND"; + } + let formatted = state.split("_").join(" ").trim(); + formatted = titleCase(formatted); + + let color = "r"; + let symbol = ""; + switch (state) { + case "NOT_FOUND": + color = "c"; + symbol = "✖"; + break; + case "FOUND": + color = "e"; + symbol = "✖"; + break; + case "PLACED": + color = "a"; + symbol = "✔"; + break; + } + + // Jasper and Ruby do not have a PLACED state + if (["jasper", "ruby"].includes(crystal) && state === "FOUND") { + color = "a"; + symbol = "✔"; + } + + return `§${color}${symbol} ${formatted}`; + } +} + +class HotmReset extends HotmItem { + constructor(data) { + super(); + this.displayName = "§cReset Heart of the Mountain"; + this.position = 3; + this.itemData = { + id: 397, + Damage: 3, + glowing: false, + texture_path: "/head/6448e275313532f54c4ba21894809a23dce52af01ddd1e89fc7689481fab737e", + }; + this.last_reset = data.last_reset; + this.resources = { + token_of_the_mountain: data.resources.token_of_the_mountain.spent || 0, + mithril_powder: data.resources.mithril_powder.spent || 0, + gemstone_powder: data.resources.gemstone_powder.spent || 0, + }; + } + + get lore() { + const output = [ + "§7Resets the Perks and Abilities of your §5Heart of the Mountain§7, locking them and resetting their levels.", + "", + "§7You will be reimbursed with:", + `§8- §5${this.resources.token_of_the_mountain.toLocaleString()} Token of the Mountain`, + `§8- §2${this.resources.mithril_powder.toLocaleString()} Mithril Powder`, + `§8- §d${this.resources.gemstone_powder.toLocaleString()} Gemstone Powder`, + "", + "§7You will §akeep §7any Tiers and §cPeak of the Mountain §7that you have unlocked.", + ]; + + // cost + output.push("", "§7Cost"); + if (this.last_reset === 0) { + output.push("§aFREE §7for your first reset."); + } else { + output.push("§6100,000 Coins"); + } + + // cooldown or warning + if (Date.now() - this.last_reset > 24 * 60 * 60 * 1000) { + output.push( + "", + "§7§c§lWARNING: This is permanent.", + "§c§lYou can not go back after resetting your Heart of the Mountain!" + ); + } else { + const timeLeft = Math.abs(Date.now() - (this.last_reset + 24 * 60 * 60 * 1000)); // ms + output.push("", `§c§lYou can reset again in ${convertHMS(timeLeft / 1000, "friendlyhhmm")}`); + } + + return output; + } +} + +/* +.########.##.....##.########...#######..########..########..######. +.##........##...##..##.....##.##.....##.##.....##....##....##....## +.##.........##.##...##.....##.##.....##.##.....##....##....##...... +.######......###....########..##.....##.########.....##.....######. +.##.........##.##...##........##.....##.##...##......##..........## +.##........##...##..##........##.....##.##....##.....##....##....## +.########.##.....##.##.........#######..##.....##....##.....######. +*/ + +const nodeClasses = { + mining_speed_2: MiningSpeed2, + powder_buff: PowderBuff, + mining_fortune_2: MiningFortune2, + vein_seeker: VeinSeeker, + lonesome_miner: LonesomeMiner, + professional: Professional, + mole: Mole, + fortunate: Fortunate, + great_explorer: GreatExplorer, + maniac_miner: ManiacMiner, + goblin_killer: GoblinKiller, + special_0: PeakOfTheMountain, + star_powder: StarPowder, + daily_effect: SkyMall, + mining_madness: MiningMadness, + mining_experience: SeasonedMineman, + efficient_miner: EfficientMiner, + experience_orbs: Orbiter, + front_loaded: FrontLoaded, + precision_mining: PrecisionMining, + random_event: LuckOfTheCave, + daily_powder: DailyPowder, + fallen_star_bonus: Crystallized, + mining_speed_boost: MiningSpeedBoost, + titanium_insanium: TitaniumInsanium, + mining_fortune: MiningFortune, + forge_time: QuickForge, + pickaxe_toss: Pickobulus, + mining_speed: MiningSpeed, +}; + +const powderForMaxNodes = {}; +for (const nodeClass of Object.values(nodeClasses)) { + const node = new nodeClass({ + level: 0, + enabled: true, + nodes: [], + hotmLevelData: { + level: Object.keys(rewards.hotm).length, + }, + }); + + if (node.nodeType === "normal" && node.upgrade_type !== null) { + powderForMaxNodes[node.upgrade_type] ??= 0; + powderForMaxNodes[node.upgrade_type] += node.totalUpgradeCost; + } +} + +export const HOTM = { + tiers: Object.keys(rewards.hotm).length, + rewards: rewards, + names: nodeNames, + hotm: HotM, + nodes: nodeClasses, + items: [HotmStats, CrystalHollowsCrystals, HotmReset], + powder_for_max_nodes: powderForMaxNodes, +}; + +export const PRECURSOR_PARTS = { + ELECTRON_TRANSMITTER: "Electron Transmitter", + FTX_3070: "FTX 3070", + ROBOTRON_REFLECTOR: "Robotron Reflector", + SUPERLITE_MOTOR: "Superlite Motor", + CONTROL_SWITCH: "Control Switch", + SYNTHETIC_HEART: "Synthetic Heart", +}; \ No newline at end of file diff --git a/src/lib.js b/src/lib.js index d113a09064..2f880022e8 100644 --- a/src/lib.js +++ b/src/lib.js @@ -1748,10 +1748,13 @@ export async function getStats( output.minions = getMinions(profile.members); output.minion_slots = getMinionSlots(output.minions); output.collections = await getCollections(profile.uuid, profile, options.cacheOnly); + output.bestiary = getBestiary(profile.uuid, profile); output.social = hypixelProfile.socials; output.dungeons = getDungeons(userProfile, hypixelProfile); + output.perks = userProfile.perks; + output.essence = getEssence(userProfile, hypixelProfile); output.fishing = { @@ -2659,6 +2662,65 @@ export async function getCollections(uuid, profile, cacheOnly = false) { return output; } +export function getBestiary(uuid, profile) { + const output = {}; + + const userProfile = profile.members[uuid]; + + if (!("unlocked_coll_tiers" in userProfile) || !("collection" in userProfile)) { + return output; + } + + const result = { + level: 0, + categories: {}, + }; + + let totalCollection = 0; + const bestiaryFamilies = {}; + for (const [name, value] of Object.entries(userProfile.bestiary || {})) { + if (name.startsWith("kills_family_")) { + bestiaryFamilies[name] = value; + } + } + + for (const family of Object.keys(constants.BESTIARY)) { + result.categories[family] = {}; + for (const mob of constants.BESTIARY[family].mobs) { + const mobName = mob.id.substring(13); + + const boss = mob.boss == true ? "boss" : "regular"; + + let kills = bestiaryFamilies[mob.id] || 0; + let head = mob.head; + let itemId = mob.itemId; + let damage = mob.damage; + let name = mob.name; + let maxTier = mob.maxTier ?? 41; + let tier = + constants.BEASTIARY_KILLS[boss].filter((k) => k <= kills).length > maxTier + ? maxTier + : constants.BEASTIARY_KILLS[boss].filter((k) => k <= kills).length; + totalCollection += tier; + + result.categories[family][mobName] = { + head: head, + name: name, + itemId: itemId, + damage: damage, + tier: tier, + maxTier: maxTier, + kills: kills, + }; + } + } + result.tiersUnlocked = totalCollection; + result.level = totalCollection / 10; + result.bonus = result.level.toFixed(0) * 2; + + return result; +} + export function getDungeons(userProfile, hypixelProfile) { const output = {}; From b412a15911fd59ce12ad29e1260b2056463f3e6a Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Fri, 30 Sep 2022 22:11:36 +0200 Subject: [PATCH 03/42] feat: add Bestiary, Unique Pets, Jacob's Shop --- public/resources/ts/calculate-player-stats.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 9f7b987b57..7ac02c993e 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -1,5 +1,6 @@ import * as helper from "../../../common/helper.js"; import { STATS_BONUS } from "../../../common/constants.js"; +import { FORBIDDEN_STATS } from "../../../src/constants"; export function getPlayerStats() { const stats: PlayerStats = { @@ -39,6 +40,29 @@ export function getPlayerStats() { }; const allowedStats = Object.keys(stats); + try { + // Bestiary Level + if (calculated.bestiary?.bonus) { + stats.health.bestiary ??= 0; + stats.health.bestiary += calculated.bestiary.bonus; + } + + // Unique Pets + if (calculated.pet_score_bonus.magic_find > 0) { + stats.magic_find.pet_score ??= 0; + stats.magic_find.pet_score += calculated.pet_score_bonus.magic_find; + } + + // Jacob's Farming Shop + if (calculated.farming?.perks?.double_drops > 0) { + stats.farming_fortune.jacob_double_drops ??= 0; + stats.farming_fortune.jacob_double_drops += calculated.farming.perks.double_drops * 2; + } + + } catch (error) { + console.error(error); + } + // Active armor stats for (const piece of items.armor) { const bonusStats: ItemStats = helper.getStatsFromItem(piece as Item); From 288c964e68261945630c49f57dd9ba29ec12066f Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 01:00:43 +0200 Subject: [PATCH 04/42] feat: add Slayer Completion, Harp, Essence Shop --- common/constants/stats.js | 117 ++++++++++++++++++ public/resources/featured-profiles.json | 1 + public/resources/file-name-map.json | 1 + public/resources/scss/stats.scss | 21 +++- public/resources/ts/calculate-player-stats.ts | 56 +++++++++ src/constants/misc.js | 54 ++++---- src/lib.js | 1 + 7 files changed, 228 insertions(+), 23 deletions(-) create mode 100644 public/resources/featured-profiles.json create mode 100644 public/resources/file-name-map.json diff --git a/common/constants/stats.js b/common/constants/stats.js index 007eb080f7..6084ffba81 100644 --- a/common/constants/stats.js +++ b/common/constants/stats.js @@ -236,6 +236,123 @@ export const STATS_DATA = { suffix: "", color: "3", }, + combat_wisdom: { + name: "Combat Wisdom", + nameLore: "Combat Wisdom", + nameShort: "Combat Wisdom", + nameTiny: "CbWis", + symbol: "☯", + suffix: "", + color: "3", + }, + mining_wisdom: { + name: "Mining Wisdom", + nameLore: "Mining Wisdom", + nameShort: "Mining Wisdom", + nameTiny: "MnWis", + symbol: "☯", + suffix: "", + color: "3", + }, + farming_wisdom: { + name: "Farming Wisdom", + nameLore: "Farming Wisdom", + nameShort: "Farming Wisdom", + nameTiny: "FrmWis", + symbol: "☯", + suffix: "", + color: "3", + }, + foraging_wisdom: { + name: "Foraging Wisdom", + nameLore: "Foraging Wisdom", + nameShort: "Foraging Wisdom", + nameTiny: "ForWis", + symbol: "☯", + suffix: "", + color: "3", + }, + fishing_wisdom: { + name: "Fishing Wisdom", + nameLore: "Fishing Wisdom", + nameShort: "Fishing Wisdom", + nameTiny: "FshWis", + symbol: "☯", + suffix: "", + color: "3", + }, + enchanting_wisdom: { + name: "Enchanting Wisdom", + nameLore: "Enchanting Wisdom", + nameShort: "Enchanting Wisdom", + nameTiny: "EnchWis", + symbol: "☯", + suffix: "", + color: "3", + }, + alchemy_wisdom: { + name: "Alchemy Wisdom", + nameLore: "Alchemy Wisdom", + nameShort: "Alchemy Wisdom", + nameTiny: "AlchWis", + symbol: "☯", + suffix: "", + color: "3", + }, + carpentry_wisdom: { + name: "Carpentry Wisdom", + nameLore: "Carpentry Wisdom", + nameShort: "Carpentry Wisdom", + nameTiny: "CrpWis", + symbol: "☯", + suffix: "", + color: "3", + }, + runecrafting_wisdom: { + name: "Runecrafting Wisdom", + nameLore: "Runecrafting Wisdom", + nameShort: "Runecrafting Wisdom", + nameTiny: "RneWis", + symbol: "☯", + suffix: "", + color: "3", + }, + social_wisdom: { + name: "Social Wisdom", + nameLore: "Social Wisdom", + nameShort: "Social Wisdom", + nameTiny: "SclWis", + symbol: "☯", + suffix: "", + color: "3", + }, + effective_health: { + name: "Effective Health", + nameLore: "Effective Health", + nameShort: "EHP", + nameTiny: "EHP", + symbol: "❤", + suffix: "", + color: "2", + }, + damage_increase: { + name: "Damage Increase", + nameLore: "Damage Increase", + nameShort: "Damage Increase", + nameTiny: "Damage Increase", + symbol: "", + suffix: "", + color: "", + }, + damage: { + name: "Damage", + nameLore: "Damage", + nameShort: "Damage", + nameTiny: "Dmg", + symbol: "❁", + suffix: "", + color: "c", + }, }; const symbols = { diff --git a/public/resources/featured-profiles.json b/public/resources/featured-profiles.json new file mode 100644 index 0000000000..ad489b37e2 --- /dev/null +++ b/public/resources/featured-profiles.json @@ -0,0 +1 @@ +[{"uuid":"b44d2d5272dc49c28185b2d6a158d80a","type":"MAINTAINER","message":"a dev or something idk","username":"LesbianCatgirl"},{"uuid":"f5667ad6b4b3434ba58f2ed2396f62f2","type":"MAINTAINER","message":"\"lazy dev\"   (ノ´・ω・)ノ ミ ┸━┸","username":"MartinNemi03"},{"uuid":"20d6334b7f9541ebbf7f860205ebf846","type":"MAINTAINER","message":"bob","username":"jjww2"},{"uuid":"aad581b2f90048a785a7573d31d7b862","type":"MAINTAINER","message":"ember armor no longer on top :((","username":"FantasmicGalaxy"},{"uuid":"d705483c5157460dad39712e4d74dfe1","type":"HOST","message":"Last online: January 1st, 1970","username":"Shiiyu"},{"uuid":"1915444928b64d8b8973df8044f8cdb7","type":"CONTRIBUTOR","message":"lea plant","username":"LeaPhant"},{"uuid":"8a3fa60d87aa4240bcdc624b90632529","type":"CONTRIBUTOR","message":"Nate: CSS Wizard","username":"Cookie_Wookie_7"},{"uuid":"5435b597612f4554a3c651fd1c3ee96a","type":"CONTRIBUTOR","message":"/visit dukioooo","username":"dukioooo"},{"uuid":"b876ec32e396476ba1158438d83c67d4","type":"TECHNOBLADE","message":"Long live the Potato King!","username":"Technoblade"}] diff --git a/public/resources/file-name-map.json b/public/resources/file-name-map.json new file mode 100644 index 0000000000..7605e34064 --- /dev/null +++ b/public/resources/file-name-map.json @@ -0,0 +1 @@ +{"browser-compat-check":"browser-compat-check.5a722e1f.js","common":"common.c93a96c4.js","stats-defer":"stats-defer.0e4d269c.js","development-defer":"development-defer.b168e5cd.js","themes":"themes.c08c5ad7.js","local-time":"local-time.0913d9a3.js","rich-item":"rich-item.d16316a4.js","skill-component":"skill-component.186c15c4.js","player-stat":"player-stat.edc7475f.js","bonus-stats":"bonus-stats.0e5ef448.js","common-defer":"common-defer.3712ab8e.js","helper":"helper.32cc478c.js","query-assigned-elements":"query-assigned-elements.79237350.js","if-defined":"if-defined.4ae23b87.js","directive":"directive.272a8723.js","theme-list":"theme-list.4989ba47.js","inventory-view":"inventory-view.05395207.js"} \ No newline at end of file diff --git a/public/resources/scss/stats.scss b/public/resources/scss/stats.scss index 9fd710b2ee..6ac2eaf300 100644 --- a/public/resources/scss/stats.scss +++ b/public/resources/scss/stats.scss @@ -930,7 +930,26 @@ a.additional-player-stat:hover { .stat-sea-creature-chance, .color-sea-creature-chance, -[class$="wisdom"] { +.stat-combat-wisdom, +.color-combat-wisdom, +.stat-mining-wisdom, +.color-mining-wisdom, +.stat-farming-wisdom, +.color-farming-wisdom, +.stat-foraging-wisdom, +.color-foraging-wisdom, +.stat-fishing-wisdom, +.color-fishing-wisdom, +.stat-enchanting-wisdom, +.color-carpentry-wisdom, +.stat-alchemy-wisdom, +.color-alchemy-wisdom, +.stat-carpentry-wisdom, +.color-carpentry-wisdom, +.stat-runecrafting-wisdom, +.color-runecrafting-wisdom, +.stat-social-wisdom, +.color-social-wisdom { color: var(--§3); } diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 7ac02c993e..d165bf6921 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -1,6 +1,8 @@ import * as helper from "../../../common/helper.js"; +import * as bonuses from "../../../common/constants/bonuses.js"; import { STATS_BONUS } from "../../../common/constants.js"; import { FORBIDDEN_STATS } from "../../../src/constants"; +import { HARP_QUEST } from "../../../src/constants"; export function getPlayerStats() { const stats: PlayerStats = { @@ -39,6 +41,7 @@ export function getPlayerStats() { social_wisdom: { base: 0 }, }; const allowedStats = Object.keys(stats); + const temp = {}; try { // Bestiary Level @@ -59,6 +62,49 @@ export function getPlayerStats() { stats.farming_fortune.jacob_double_drops += calculated.farming.perks.double_drops * 2; } + // Slayer Completion + for (const type of Object.keys(calculated.slayers) || []) { + for (const tiers of Object.keys(calculated.slayers[type]?.kills)) { + if (parseInt(tiers) <= 3) { + temp[type] ??= 0; + temp[type] += 1; + } else if (parseInt(tiers) == 5) { // Hypixel admins forgot to add tier 5 bosses to Wisdom calculation :/ + temp[type] ??= 0; + temp[type] += 2; + } + } + } + + for (const type of Object.keys(temp)) { + stats.combat_wisdom.slayer ??= 0; + stats.combat_wisdom.slayer += temp[type]; + } + + // ? Doesn't work, not sure why + // Harp + /* + for (const harp in calculated.harp_quest || []) { + if (!harp.endsWith('_best_completion')) continue; + stats['intelligence'].harp_quest ??= 0; + stats['intelligence'].harp_quest += HARP_QUEST[`${harp}`]; + } + */ + + // Dungeon Essence Shop + /* + if (Object.keys(calculated.perks).length > 0) { + for (let [name, perkData] of Object.entries(calculated.perks)) { + name = name.replaceAll('permanent_', '') + if (Object.keys(FORBIDDEN_STATS).includes(name)) { + console.log(name, perkData) + stats[name].essence_shop_perk ??= 0; + stats[name].essence_shop_perk += perkData * FORBIDDEN_STATS[name]; + } + } + } + */ + + } catch (error) { console.error(error); } @@ -94,7 +140,11 @@ export function getPlayerStats() { } // Active accessories stats + let accessoryDuplicates = []; for (const item of items.accessories.filter((item) => !(item as Item).isInactive)) { + if (accessoryDuplicates.includes(item.tag?.ExtraAttributes?.id)) continue; + accessoryDuplicates.push(item.tag?.ExtraAttributes?.id) + const bonusStats: ItemStats = helper.getStatsFromItem(item as Item); for (const [name, value] of Object.entries(bonusStats)) { @@ -104,6 +154,12 @@ export function getPlayerStats() { stats[name].accessories ??= 0; stats[name].accessories += value; + + if (item.tag?.ExtraAttributes?.id == 'NIGHT_CRYSTAL' || item.tag?.ExtraAttributes?.id == 'DAY_CRYSTAL') { + accessoryDuplicates.push(item.tag?.ExtraAttributes?.id); + stats.health.accessories += 5; + stats.strength.accessories += 5; + } } } diff --git a/src/constants/misc.js b/src/constants/misc.js index 9be8202752..360e2d08d6 100644 --- a/src/constants/misc.js +++ b/src/constants/misc.js @@ -33,27 +33,29 @@ export const BASE_STATS = { defense: 0, effective_health: 0, strength: 0, - speed: 0, + intelligence: 0, crit_chance: 0, crit_damage: 0, bonus_attack_speed: 0, - intelligence: 0, - sea_creature_chance: 0, - magic_find: 0, - pet_luck: 0, - ferocity: 0, ability_damage: 0, + true_defense: 0, + ferocity: 0, + health_regen: 100, + vitality: 100, + mending: 100, + mining_speed: 0, mining_fortune: 0, farming_fortune: 0, foraging_fortune: 0, pristine: 0, - damage: 0, - damage_increase: 0, + + speed: 0, + magic_find: 0, + pet_luck: 0, + sea_creature_chance: 0, fishing_speed: 0, - health_regen: 100, - vitality: 100, - mending: 100, + combat_wisdom: 0, mining_wisdom: 0, farming_wisdom: 0, @@ -64,6 +66,9 @@ export const BASE_STATS = { carpentry_wisdom: 0, runecrafting_wisdom: 0, social_wisdom: 0, + + damage: 0, + damage_increase: 0, }; @@ -72,27 +77,29 @@ export const STAT_TEMPLATE = { defense: 0, effective_health: 0, strength: 0, - speed: 0, + intelligence: 0, crit_chance: 0, crit_damage: 0, bonus_attack_speed: 0, - intelligence: 0, - sea_creature_chance: 0, - magic_find: 0, - pet_luck: 0, - ferocity: 0, ability_damage: 0, + true_defense: 0, + ferocity: 0, + health_regen: 0, + vitality: 0, + mending: 0, + mining_speed: 0, mining_fortune: 0, farming_fortune: 0, foraging_fortune: 0, pristine: 0, - damage: 0, - damage_increase: 0, + + speed: 0, + magic_find: 0, + pet_luck: 0, + sea_creature_chance: 0, fishing_speed: 0, - health_regen: 100, - vitality: 100, - mending: 100, + combat_wisdom: 0, mining_wisdom: 0, farming_wisdom: 0, @@ -103,6 +110,9 @@ export const STAT_TEMPLATE = { carpentry_wisdom: 0, runecrafting_wisdom: 0, social_wisdom: 0, + + damage: 0, + damage_increase: 0, }; export const SLAYER_COST = { diff --git a/src/lib.js b/src/lib.js index 2f880022e8..e339962cd7 100644 --- a/src/lib.js +++ b/src/lib.js @@ -1754,6 +1754,7 @@ export async function getStats( output.dungeons = getDungeons(userProfile, hypixelProfile); output.perks = userProfile.perks; + output.harp_quest = userProfile.harp_quest; output.essence = getEssence(userProfile, hypixelProfile); From e548c13a55b93a7c6ca51b82ddf1c3c72a3e3257 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 12:56:43 +0200 Subject: [PATCH 05/42] feat: add HOTM, Armor Abilities | Fix: Harp, EShop --- public/resources/ts/calculate-player-stats.ts | 243 +++++++++++++++--- public/resources/ts/elements/player-stat.ts | 32 +-- src/constants/misc.js | 26 +- src/lib.js | 4 +- 4 files changed, 234 insertions(+), 71 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index d165bf6921..28080622d8 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -1,8 +1,102 @@ import * as helper from "../../../common/helper.js"; -import * as bonuses from "../../../common/constants/bonuses.js"; import { STATS_BONUS } from "../../../common/constants.js"; -import { FORBIDDEN_STATS } from "../../../src/constants"; -import { HARP_QUEST } from "../../../src/constants"; + +const HARP_QUEST = { + song_hymn_joy_best_completion: 1, + song_frere_jacques_best_completion: 1, + song_amazing_grace_best_completion: 1, + song_brahms_best_completion: 2, + song_happy_birthday_best_completion: 2, + song_greensleeves_best_completion: 2, + song_jeopardy_best_completion: 3, + song_minuet_best_completion: 3, + song_joy_world_best_completion: 3, + song_pure_imagination_best_completion: 4, + song_vie_en_rose_best_completion: 4, + song_fire_and_flames_best_completion: 1, + song_pachelbel_best_completion: 1, +}; +const FORBIDDEN_STATS = { + speed: 1, + intelligence: 2, + health: 2, + defense: 1, + strength: 1, +}; + +const ARMOR_SETS = { + SUPERIOR_DRAGON_ARMOR: { + name: "Superior Dragon Armor", + helmet: "SUPERIOR_DRAGON_HELMET", + chestplate: "SUPERIOR_DRAGON_CHESTPLATE", + leggings: "SUPERIOR_DRAGON_LEGGINGS", + boots: "SUPERIOR_DRAGON_BOOTS", + bonus: { + statsMultiplier: 0.05, + }, + }, + YOUNG_DRAGON_ARMOR: { + name: "Young Dragon Armor", + helmet: "YOUNG_DRAGON_HELMET", + chestplate: "YOUNG_DRAGON_CHESTPLATE", + leggings: "YOUNG_DRAGON_LEGGINGS", + boots: "YOUNG_DRAGON_BOOTS", + bonus: { + speed: 75, + speed_cap: 500, + }, + }, + HOLY_DRAGON_ARMOR: { + name: "Holy Dragon Armor", + helmet: "HOLY_DRAGON_HELMET", + chestplate: "HOLY_DRAGON_CHESTPLATE", + leggings: "HOLY_DRAGON_LEGGINGS", + boots: "HOLY_DRAGON_BOOTS", + bonus: { + health_regen: 200, + }, + }, + LAPIS_ARMOR: { + name: "Lapis Armor", + helmet: "LAPIS_ARMOR_HELMET", + chestplate: "LAPIS_ARMOR_CHESTPLATE", + leggings: "LAPIS_ARMOR_LEGGINGS", + boots: "LAPIS_ARMOR_BOOTS", + bonus: { + health: 60, + }, + }, + CHEAP_TUXEDO_ARMOR: { + name: "Cheap Tuxedo Armor", + helmet: "CHEAP_TUXEDO_HELMET", + chestplate: "CHEAP_TUXEDO_CHESTPLATE", + leggings: "CHEAP_TUXEDO_LEGGINGS", + boots: "CHEAP_TUXEDO_BOOTS", + bonus: { + health_cap: 75, + }, + }, + FANCY_TUXEDO_ARMOR: { + name: "Fancy Tuxedo Armor", + helmet: "FANCY_TUXEDO_HELMET", + chestplate: "FANCY_TUXEDO_CHESTPLATE", + leggings: "FANCY_TUXEDO_LEGGINGS", + boots: "FANCY_TUXEDO_BOOTS", + bonus: { + health_cap: 150, + }, + }, + ELEGANT_TUXEDO_ARMOR: { + name: "Elegant Tuxedo Armor", + helmet: "ELEGANT_TUXEDO_HELMET", + chestplate: "ELEGANT_TUXEDO_CHESTPLATE", + leggings: "ELEGANT_TUXEDO_LEGGINGS", + boots: "ELEGANT_TUXEDO_BOOTS", + bonus: { + health_cap: 250, + }, + }, +}; export function getPlayerStats() { const stats: PlayerStats = { @@ -39,38 +133,41 @@ export function getPlayerStats() { carpentry_wisdom: { base: 0 }, runecrafting_wisdom: { base: 0 }, social_wisdom: { base: 0 }, + speed_cap: { base: 0}, + health_cap: { base: 0}, }; const allowedStats = Object.keys(stats); const temp = {}; try { - // Bestiary Level + // Bestiary Level if (calculated.bestiary?.bonus) { stats.health.bestiary ??= 0; stats.health.bestiary += calculated.bestiary.bonus; } - + // Unique Pets if (calculated.pet_score_bonus.magic_find > 0) { stats.magic_find.pet_score ??= 0; stats.magic_find.pet_score += calculated.pet_score_bonus.magic_find; } - + // Jacob's Farming Shop if (calculated.farming?.perks?.double_drops > 0) { stats.farming_fortune.jacob_double_drops ??= 0; stats.farming_fortune.jacob_double_drops += calculated.farming.perks.double_drops * 2; } - + // Slayer Completion for (const type of Object.keys(calculated.slayers) || []) { for (const tiers of Object.keys(calculated.slayers[type]?.kills)) { if (parseInt(tiers) <= 3) { - temp[type] ??= 0; - temp[type] += 1; - } else if (parseInt(tiers) == 5) { // Hypixel admins forgot to add tier 5 bosses to Wisdom calculation :/ - temp[type] ??= 0; - temp[type] += 2; + temp[type] ??= 0; + temp[type] += 1; + } else if (parseInt(tiers) == 5) { + // Hypixel admins forgot to add tier 5 bosses to Wisdom calculation :/ + temp[type] ??= 0; + temp[type] += 2; } } } @@ -78,32 +175,120 @@ export function getPlayerStats() { for (const type of Object.keys(temp)) { stats.combat_wisdom.slayer ??= 0; stats.combat_wisdom.slayer += temp[type]; - } + } + + // Heart Of The Mountain + for (const a of calculated?.hotm || []) { + if ( + a?.display_name == "Mining Speed I" || + a?.display_name == "Mining Speed II" || + a?.display_name == "Mining Fortune I" || + a?.display_name == "Mining Fortune II" || + a?.display_name == "Mining Madness" || + a?.display_name == "Seasoned Mineman" + ) { + a.level = a.tag.display.Lore[1].split(" ")[1] || 0; + a.disabled = a.tag.display.Lore[a.tag.display?.Lore.length - 1].includes("ENABLED") ? false : true || false; + if (a?.display_name == "Mining Speed I" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain ??= 0; + stats.mining_speed.heart_of_the_mountain += a.level * 20; + } + if (a?.display_name == "Mining Speed II" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain ??= 0; + stats.mining_speed.heart_of_the_mountain += a.level * 40; + } + if (a?.display_name == "Mining Fortune I" && a.disabled == false) { + stats.mining_fortune.heart_of_the_mountain ??= 0; + stats.mining_fortune.heart_of_the_mountain += a.level * 5; + } + if (a?.display_name == "Mining Fortune II" && a.disabled == false) { + stats.mining_fortune.heart_of_the_mountain ??= 0; + stats.mining_fortune.heart_of_the_mountain += a.level * 5; + } + if (a?.display_name == "Seasoned Mineman" && a.disabled == false) { + stats.mining_wisdom.heart_of_the_mountain ??= 0; + stats.mining_wisdom.heart_of_the_mountain += 5 + a.level * 0.1; + } + if (a?.display_name == "Mining Madness" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain ??= 0; + stats.mining_speed.heart_of_the_mountain += 50; + stats.mining_fortune.heart_of_the_mountain ??= 0; + stats.mining_fortune.heart_of_the_mountain += 50; + } + } + } - // ? Doesn't work, not sure why - // Harp - /* + // Harp Quest for (const harp in calculated.harp_quest || []) { - if (!harp.endsWith('_best_completion')) continue; - stats['intelligence'].harp_quest ??= 0; - stats['intelligence'].harp_quest += HARP_QUEST[`${harp}`]; - } - */ - + if (harp?.endsWith("_best_completion")) { + stats.intelligence.harp ??= 0; + stats.intelligence.harp += HARP_QUEST[harp]; + } + } + // Dungeon Essence Shop - /* if (Object.keys(calculated.perks).length > 0) { for (let [name, perkData] of Object.entries(calculated.perks)) { - name = name.replaceAll('permanent_', '') + name = name.replaceAll("permanent_", ""); if (Object.keys(FORBIDDEN_STATS).includes(name)) { - console.log(name, perkData) stats[name].essence_shop_perk ??= 0; stats[name].essence_shop_perk += perkData * FORBIDDEN_STATS[name]; } } } - */ + + // Armor Abiltiies + let boots, leggings, chestplate, helmet; + for (const piece of items.armor) { + if (piece.categories.includes("boots")) boots = piece; + if (piece.categories.includes("leggings")) leggings = piece; + if (piece.categories.includes("chestplate")) chestplate = piece; + if (piece.categories.includes("helmet")) helmet = piece; + } + + for (const armorSet of Object.keys(ARMOR_SETS)) { + if (helmet?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].helmet && chestplate?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].chestplate && leggings?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].leggings && boots?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].boots) { + for (const [stat, value] of Object.entries(ARMOR_SETS[armorSet].bonus)) { + console.log(armorSet, stat, value) + stats[stat].armor ??= 0; + stat.includes('_cap') ? stats[stat].armor = value : stats[armor] += value; + } + } + + // TODO: Make Special Abilities work with format above + // ? Mastiff Armor + if (helmet?.tag.ExtraAttributes.id == 'MASTIFF_HELMET' && chestplate?.tag.ExtraAttributes.id == 'MASTIFF_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'MASTIFF_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'MASTIFF_BOOTS') { + stats.health.armor += (stats.crit_damage || 0) * 50; + stats.crit_damage.armor = stats['crit_damage'] / 2; + } + + // ? Obsidian Chestplate + /* + if (chestplate?.tag.ExtraAttributes.id == 'OBSIDIAN_CHESTPLATE') { + stats.speed.armor += itemCount.OBSIDIAN.armor / 20 ? (itemCount.OBSIDIAN.armor / 20).toFixed(0) : 0; + } + */ + + // ? Glacite Armor + if (helmet?.tag.ExtraAttributes.id == 'GLACITE_HELMET' && chestplate?.tag.ExtraAttributes.id == 'GLACITE_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'GLACITE_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'GLACITE_BOOTS') { + stats.mining_speed.armor += calculated.levels.mining.level * 2; + } + + // ? Fairy Armor + if (helmet?.tag.ExtraAttributes.id == 'FAIRY_HELMET' && chestplate?.tag.ExtraAttributes.id == 'FAIRY_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'FAIRY_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'FAIRY_BOOTS') { + stats.health.armor += calculated.fairy_souls.collected || 0; + } + + // ? Emerald Armor + if (helmet?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_HELMET' && chestplate?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_BOOTS') { + const amount = calculated.collections.EMERALD.amount || 0; + stats.health.armor ??= 0; + stats.health.armor += (amount / 3000).toFixed(0) > 350 ? 350 : (amount / 3000).toFixed(0); + stats.defense.armor ??= 0; + stats.defense.armor += (amount / 3000).toFixed(0) > 350 ? 350 : (amount / 3000).toFixed(0); + } + } } catch (error) { console.error(error); @@ -143,7 +328,7 @@ export function getPlayerStats() { let accessoryDuplicates = []; for (const item of items.accessories.filter((item) => !(item as Item).isInactive)) { if (accessoryDuplicates.includes(item.tag?.ExtraAttributes?.id)) continue; - accessoryDuplicates.push(item.tag?.ExtraAttributes?.id) + accessoryDuplicates.push(item.tag?.ExtraAttributes?.id); const bonusStats: ItemStats = helper.getStatsFromItem(item as Item); @@ -155,11 +340,11 @@ export function getPlayerStats() { stats[name].accessories ??= 0; stats[name].accessories += value; - if (item.tag?.ExtraAttributes?.id == 'NIGHT_CRYSTAL' || item.tag?.ExtraAttributes?.id == 'DAY_CRYSTAL') { + if (item.tag?.ExtraAttributes?.id == "NIGHT_CRYSTAL" || item.tag?.ExtraAttributes?.id == "DAY_CRYSTAL") { accessoryDuplicates.push(item.tag?.ExtraAttributes?.id); stats.health.accessories += 5; stats.strength.accessories += 5; - } + } } } diff --git a/public/resources/ts/elements/player-stat.ts b/public/resources/ts/elements/player-stat.ts index c8f28a9f5e..f528baf3da 100644 --- a/public/resources/ts/elements/player-stat.ts +++ b/public/resources/ts/elements/player-stat.ts @@ -22,22 +22,24 @@ export class PlayerStat extends LitElement { return; } - const value = Math.round(+this.value); - const icon = STATS_DATA[this.stat].symbol; - const name = STATS_DATA[this.stat].nameShort; - const suffix = STATS_DATA[this.stat].suffix; - - const tooltip = this.getTooltip(this.data, name, suffix, value, this.special); - - return html` -
-
- ${icon} - ${name} - ${value.toLocaleString()}${suffix} + if (!this.stat.includes("_cap")) { + const value = Math.round(+this.value); + const icon = STATS_DATA[this.stat].symbol; + const name = STATS_DATA[this.stat].nameShort; + const suffix = STATS_DATA[this.stat].suffix; + + const tooltip = this.getTooltip(this.data, name, suffix, value, this.special); + + return html` +
+
+ ${icon} + ${name} + ${value.toLocaleString()}${suffix} +
-
- `; + `; + } } private getTooltip( diff --git a/src/constants/misc.js b/src/constants/misc.js index 360e2d08d6..74926f1747 100644 --- a/src/constants/misc.js +++ b/src/constants/misc.js @@ -428,28 +428,4 @@ export const ESSENCE = { export const STAT_MAPPINGS = { walk_speed: "speed", -}; - -export const FORBIDDEN_STATS ={ - speed: 1, - intelligence: 2, - health: 2, - defense: 1, - strength: 1, -} - -export const HARP_QUEST = { - song_hymn_joy_best_completion: 1, - song_frere_jacques_best_completion: 1, - song_amazing_grace_best_completion: 1, - song_brahms_best_completion: 2, - song_happy_birthday_best_completion: 2, - song_greensleeves_best_completion: 2, - song_jeopardy_best_completion: 3, - song_minuet_best_completion: 3, - song_joy_world_best_completion: 3, - song_pure_imagination_best_completion: 4, - song_vie_en_rose_best_completion: 4, - song_fire_and_flames_best_completion: 1, - song_pachelbel_best_completion: 1, -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/lib.js b/src/lib.js index e339962cd7..115e7eb365 100644 --- a/src/lib.js +++ b/src/lib.js @@ -1755,7 +1755,7 @@ export async function getStats( output.perks = userProfile.perks; output.harp_quest = userProfile.harp_quest; - + output.hotm = "mining_core" in userProfile ? await getHotmItems(userProfile) : []; output.essence = getEssence(userProfile, hypixelProfile); output.fishing = { @@ -3002,7 +3002,7 @@ function getEssence(userProfile, hypixelProfile) { return output; } -function getHotmItems(userProfile, packs) { +async function getHotmItems(userProfile, packs) { const data = userProfile.mining_core; const output = []; From bd9660e07940d8952be83a812b769cc11aa362c7 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 14:27:32 +0200 Subject: [PATCH 06/42] feat: potions, reforge, custom pet abilities --- common/constants/stats.js | 18 + public/resources/ts/calculate-player-stats.ts | 1052 ++++++++++++++++- src/lib.js | 3 + 3 files changed, 1051 insertions(+), 22 deletions(-) diff --git a/common/constants/stats.js b/common/constants/stats.js index 6084ffba81..78259670bf 100644 --- a/common/constants/stats.js +++ b/common/constants/stats.js @@ -353,6 +353,24 @@ export const STATS_DATA = { suffix: "", color: "c", }, + soulflow: { + name: "Soulflow", + nameLore: "Soulflow", + nameShort: "Soulflow", + nameTiny: "Sf", + symbol: "⸎", + suffix: "", + color: "3", + }, + overflow_mana: { + name: "Overflow Mana", + nameLore: "Overflow Mana", + nameShort: "Overflow Mana", + nameTiny: "OMn", + symbol: "ʬ", + suffix: "", + color: "3", + }, }; const symbols = { diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 28080622d8..e908dd03df 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -1,5 +1,7 @@ import * as helper from "../../../common/helper.js"; import { STATS_BONUS } from "../../../common/constants.js"; +import { STATS_DATA } from "../../../common/constants/stats.js"; +const symbols = STATS_DATA; const HARP_QUEST = { song_hymn_joy_best_completion: 1, @@ -16,6 +18,7 @@ const HARP_QUEST = { song_fire_and_flames_best_completion: 1, song_pachelbel_best_completion: 1, }; + const FORBIDDEN_STATS = { speed: 1, intelligence: 2, @@ -98,6 +101,686 @@ const ARMOR_SETS = { }, }; +const MAXED_EFFECTS = { + true_defense: { + 4: { + name: "True Resistance 4 Potion", + description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 20, + }, + }, + }, + strength: { + 8: { + name: "Strength 8 Potion", + Description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 75, + }, + }, + }, + regeneration: { + 9: { + name: "Regeneration 9 Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 63, + }, + }, + }, + enchanting_xp_boost: { + 3: { + name: "Enchanting XP Boost III Potion", + description: `Grants +20 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, + bonus: { + enchanting_wisdom: 20, + }, + }, + }, + stun: { + 4: { + name: "Stun 4 Potion", + description: + "When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", + bonus: {}, + }, + }, + experience: { + 4: { + name: "Experience 4 Potion", + description: "Gain 40% more experience orbs.", + bonus: { + combat_wisdom: 10, + }, + }, + }, + rabbit: { + 6: { + name: "Rabbit 6 Potion", + description: `Grants Jump Boost III and +60 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 60, + }, + }, + }, + magic_find: { + 4: { + name: "Magic Find 4 Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 75, + }, + }, + }, + night_vision: { + 1: { + name: "Night Vision Potion", + description: `Grants greater visiblity at night.`, + bonus: {}, + }, + }, + absorption: { + 8: { + name: "Absorption 8 Potion", + description: `Grants a boost to absorption health.`, + bonus: { + //absorption: 375, + }, + }, + }, + water_breathing: { + 6: { + name: "Water Breathing 6 Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + }, + combat_xp_boost: { + 3: { + name: "Combat XP Boost III Potion", + description: `Grants +20 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, + bonus: { + combat_wisdom: 20, + }, + }, + }, + fire_resistance: { + 1: { + name: "Fire Resistance Potion", + description: `Receive a 10% reduced damage from fire and lava.`, + bonus: {}, + }, + }, + jump_boost: { + 4: { + name: "Jump Boost 4 Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + }, + resistance: { + 8: { + name: "Resistance 8 Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 66, + }, + }, + }, + fishing_xp_boost: { + 3: { + name: "Fishing XP Boost III Potion", + description: `Grants +20 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, + bonus: { + fishing_wisdom: 20, + }, + }, + }, + agility: { + 4: { + name: "Agility 4 Potion", + description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 40, + }, + }, + }, + archery: { + 4: { + name: "Archery 4 Potion", + description: `Increases bow damage by 75%.`, + bonus: {}, + }, + }, + critical: { + 4: { + name: "Critical 4 Potion", + description: `Increases ${symbols.crit_chance.symbol} Crit Change by 25% and ${symbols.crit_damage.symbol} Crit Damage by 40%.`, + bonus: { + crit_chance: 25, + crit_damage: 40, + magic_find: 10, + }, + }, + }, + speed: { + 8: { + name: "Speed 8 Potion", + description: `Grants +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 48, + }, + }, + }, + farming_xp_boost: { + 3: { + name: "Farming XP Boost III Potion", + description: `Grants +20 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, + bonus: { + farming_wisdom: 20, + }, + }, + }, + adrenaline: { + 8: { + name: "Adrenaline 8 Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + //absorption: 300, + speed: 40, + }, + }, + }, + spelunker: { + 5: { + name: "Spelunker 5 Potion", + description: `Increases 25 ${symbols.mining_fortune.symbol} Mining Fortune.`, + bonus: { + mining_fortune: 25, + }, + }, + }, + dodge: { + 4: { + name: "Dodge 4 Potion", + description: `Mobs attacks have a 40% chance to miss.`, + bonus: {}, + }, + }, + spirit: { + 4: { + name: "Spirit 4 Potion", + description: `Grants +40 ${symbols.speed.symbol} Speed and +40 ${symbols.crit_damage.symbol} Crit Damage.`, + bonus: { + speed: 40, + crit_damage: 40, + }, + }, + }, + pet_luck: { + 4: { + name: "Pet Luck 4 Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 20, + }, + }, + }, + mining_xp_boost: { + 3: { + name: "Mining XP Boost III Potion", + description: `Grants +20 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, + bonus: { + mining_wisdom: 20, + }, + }, + }, + haste: { + 4: { + name: "Haste 4 Potion", + description: `Increases your mining speed by 80%.`, + bonus: {}, + }, + }, + burning: { + 4: { + name: "Burning 4 Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 20%.`, + bonus: {}, + }, + }, + mana: { + 8: { + name: "Mana 8 Potion", + description: `Grants 8 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + }, + foraging_xp_boost: { + 3: { + name: "Foraging XP Boost III Potion", + description: `Grants +20 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, + bonus: { + foraging_wisdom: 20, + }, + }, + }, + alchemy_xp_boost: { + 3: { + name: "Alchemy XP Boost III Potion", + description: `Grants +20 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, + bonus: { + alchemy_wisdom: 20, + }, + }, + }, + invisibility: { + 1: { + name: "Invisibility Potion", + description: `Grants invisibility from players and mobs.`, + bonus: {}, + }, + }, + jerry_candy: { + 1: { + name: "Jerry Candy", + description: `Grants +100 ${symbols.health.symbol} Health, +20 ${symbols.strength.symbol} Strength, +2 ${symbols.ferocity.symbol} Ferocity, +100 ${symbols.intelligence.symbol} Inteligence, +3 ${symbols.magic_find.symbol} Magic Find`, + bonus: { + health: 100, + strength: 20, + ferocity: 2, + intelligence: 100, + magic_find: 3, + }, + }, + }, + GABAGOEY: { + 1: { + name: "Gabagoey Mixin", + description: `Increases your ${symbols.true_defense.symbol} True Defense by 5.`, + bonus: { + true_defense: 5, + }, + }, + }, + END_PORTAL_FUMES: { + 1: { + name: "End Portal Fumes", + description: `${symbols.soulflow.symbol} Soulflow conversions provide +30% more ${symbols.overflow_mana.symbol} Overflow.`, + bonus: {}, + }, + }, + SPIDER_EGG: { + 1: { + name: "Spider Egg Mixin", + description: `Gain 5% dodge chance!`, + bonus: {}, + }, + }, + ZOMBIE_BRAIN: { + 1: { + name: "Zombie Brain Mixin", + description: `Gain +10 ${symbols.ferocity.symbol} Ferocity!`, + description: { + ferocity: 10, + }, + }, + }, + WOLF_FUR: { + 1: { + name: "Wolf Fur Mixin", + Description: `Gain +7 ${symbols.magic_find.symbol} Magic Find when slaying monsters in one hit!`, + bonus: {}, + }, + }, +}; + +const REFORGES = { + // ! FREE + lucky: { + prefix: "Lucky", + name: null, + reforge: { + crit_chance: 42/250, + crit_damage: 46/250, + health: 32/250, + defense: 12/250, + strength: 46/250, + } + }, + warrior: { + prefix: "Warrior", + name: null, + reforge : { + crit_chance: 23/250, + crit_damage: 58/250, + health: 32/250, + defense: 12/250, + strength: 81/250, + } + }, + pretty: { + prefix: "Pretty", + name: null, + reforge: { + crit_chance: 44/250, + speed: 6/250, + crit_damage: 46/250, + health: 16/250, + defense: 12/250, + strength: 46/250, + intelligence: 104/250, + } + }, + protected: { + prefix: "Protected", + name: null, + reforge: { + crit_chance: 5/250, + crit_damage: 12/250, + health: 113/250, + defense: 104/250, + strength: 23/250, + } + }, + simple: { + prefix: "Simple", + name: null, + reforge: { + crit_chance: 14/250, + speed: 12/250, + crit_damage: 35/250, + health: 49/250, + defense: 35/250, + strength: 32/250, + intelligence: 52/250, + } + }, + disciplined: { + prefix: "Disciplined", + name: null, + reforge: { + crit_chance: 14/250, + crit_damage: 69/250, + health: 49/250, + defense: 23/250, + strength: 69/250, + } + }, + commando: { + prefix: "Commando", + name: null, + reforge: { + crit_chance: 5/250, + crit_damage: 81/250, + health: 49/250, + defense: 23/250, + strength: 81/250, + } + }, + inspired: { + prefix: "Inspired", + name: null, + reforge: { + crit_chance: 9/250, + crit_damage: 35/250, + health: 16/250, + defense: 12/250, + strength: 46/250, + intelligence: 156/250, + } + }, + prepared: { + prefix: "Prepared", + name: null, + reforge: { + crit_chance: 4/250, + crit_damage: 9/250, + health: 120/250, + defense: 109/250, + strength: 19/250, + } + }, + ominous: { + prefix: "Ominous", + name: null, + reforge: { + crit_chance: 14/250, + speed: 9/250, + bonus_attack_speed: 14, + crit_damage: 35/250, + health: 49/250, + strength: 35/250, + intelligence: 42/250, + } + }, + + // ! PAID + silky: { + prefix: "Silky", + name: "Luxurious Spool", + power_bonus: { + bonus_attack_speed: 5 + }, + reforge: { + speed: 6/250, + crit_damage: 220/250, + } + }, + sweet: { + prefix: "Sweet", + name: "Rock Candy", + power_bonus: { + speed: 5 + }, + reforge: { + speed: 0.048, + health: 0.584, + defense: 0.416, + } + }, + bloody: { + prefix: "Bloody", + name: "Beating Heart", + power_bonus: { + bonus_attack_speed: 10 + }, + reforge: { + strength: 0.416, + crit_damage: 0.416, + intelligence: 0.14, + } + }, + itchy: { + prefix: "Itchy", + name: "Furball", + power_bonus: { + strength: 15, + crit_damage: 15, + }, + reforge: { + speed: 6/250, + bonus_attack_speed: 21/250, + crit_damage: 81/250, + strength: 69/250, + } + }, + sighted: { + prefix: "Sighted", + name: "Ender Monocle", + power_bonus: { + ability_damage: 3, + }, + reforge: { + intelligence: 1.388, + } + }, + adept: { + prefix: "Adept", + name: "End Stone Shulker", + power_bonus: { + health: 100, + defense: 50, + }, + reforge: { + health: 0.648, + defense: 0.372, + intelligence: 0.14 + } + }, + mythical: { + prefix: "Mythical", + name: "Obsidian Tablet", + power_bonus: { + health: 150, + strength: 40, + }, + reforge: { + crit_chance: 0.064, + speed: 0.036, + crit_damage: 0.156, + health: 0.22, + defense: 0.156, + strength: 0.156, + intelligence: 0.236, + } + }, + forceful: { + prefix: "Forceful", + name: "Acacia Birdhouse", + power_bonus: { + ferocity: 4 + }, + reforge: { + crit_damage: 0.184, + health: 0.064, + strength: 0.696, + } + }, + shaded: { + prefix: "Shaded", + name: "Dark Orb", + power_bonus: { + bonus_attack_speed: 3, + ferocity: 3, + }, + reforge: { + speed: 0.024, + crit_damage: 0.696, + strength: 0.184, + } + }, + strong: { + prefix: "Strong", + name: "Mandraa", + power_bonus: { + strength: 25, + crit_damage: 25 + }, + reforge: { + crit_damage: 0.464, + strength: 0.464, + } + }, + demonic: { + prefix: "Demonic", + name: "Horns of Torment", + power_bonus: { + crit_damage: 50, + }, + reforge: { + strenght: 0.212, + intelligence: 1.068, + } + }, + pleasent: { + prefix: "Pleasant", + name: "Precious Pearl", + power_bonus: { + health_regen: 10, + //vitality: 10, + }, + reforge: { + health: 0.52, + defense: 0.556, + } + }, + hurtful: { + prefix: "Hurtful", + name: "Magma Urchin", + power_bonus: { + bonus_attack_speed: 15, + }, + reforge: { + crit_damage: 0.74, + strength: 0.184, + } + }, + bizarre: { + prefix: "Bizarre", + name: "Eccentric Painting", + power_bonus: { + ability_damage: 5, + }, + reforge: { + crit_damage: -0.092, + strength: -0.092, + intelligence: 1.668, + } + }, + healthy: { + prefix: "Healthy", + name: "Vitamin Death", + power_bonus: { + health: 200, + }, + reforge: { + health: 1.296 + } + }, + slender: { + prefix: "Slender", + name: "Hazmat Enderman", + power_bonus: { + defense: 100, + strenght: 50, + }, + reforge: { + speed: 6/250, + bonus_attack_speed: 10/250, + crit_damage: 58/250, + health: 81/250, + defense: 58/250, + strenght: 58/250, + intelligence: 87/250, + } + }, + scorching: { + prefix: "Scorching", + name: "Scorched Books", + power_bonus: { + ferocity: 7 + }, + reforge: { + bonus_attack_speed: 0.068, + crit_damage: 0.372, + strength: 0.324, + } + } +} + +const MAGICAL_POWER = { + common: 3, + uncommon: 5, + rare: 8, + epic: 12, + legendary: 16, + mythic: 22, + special: 3, + very_special: 5, +}; + export function getPlayerStats() { const stats: PlayerStats = { health: { base: 100 }, @@ -133,8 +816,8 @@ export function getPlayerStats() { carpentry_wisdom: { base: 0 }, runecrafting_wisdom: { base: 0 }, social_wisdom: { base: 0 }, - speed_cap: { base: 0}, - health_cap: { base: 0}, + speed_cap: { base: 0 }, + health_cap: { base: 0 }, }; const allowedStats = Object.keys(stats); const temp = {}; @@ -207,7 +890,7 @@ export function getPlayerStats() { } if (a?.display_name == "Seasoned Mineman" && a.disabled == false) { stats.mining_wisdom.heart_of_the_mountain ??= 0; - stats.mining_wisdom.heart_of_the_mountain += 5 + a.level * 0.1; + stats.mining_wisdom.heart_of_the_mountain += 5 + a.level.split("/")[1] * 0.1 || 0; } if (a?.display_name == "Mining Madness" && a.disabled == false) { stats.mining_speed.heart_of_the_mountain ??= 0; @@ -231,12 +914,12 @@ export function getPlayerStats() { for (let [name, perkData] of Object.entries(calculated.perks)) { name = name.replaceAll("permanent_", ""); if (Object.keys(FORBIDDEN_STATS).includes(name)) { - stats[name].essence_shop_perk ??= 0; - stats[name].essence_shop_perk += perkData * FORBIDDEN_STATS[name]; + stats[name].essence_shop ??= 0; + stats[name].essence_shop += perkData * FORBIDDEN_STATS[name]; } } } - + // Armor Abiltiies let boots, leggings, chestplate, helmet; for (const piece of items.armor) { @@ -244,23 +927,32 @@ export function getPlayerStats() { if (piece.categories.includes("leggings")) leggings = piece; if (piece.categories.includes("chestplate")) chestplate = piece; if (piece.categories.includes("helmet")) helmet = piece; - } - + } + for (const armorSet of Object.keys(ARMOR_SETS)) { - if (helmet?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].helmet && chestplate?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].chestplate && leggings?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].leggings && boots?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].boots) { - for (const [stat, value] of Object.entries(ARMOR_SETS[armorSet].bonus)) { - console.log(armorSet, stat, value) - stats[stat].armor ??= 0; - stat.includes('_cap') ? stats[stat].armor = value : stats[armor] += value; - } + if ( + helmet?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].helmet && + chestplate?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].chestplate && + leggings?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].leggings && + boots?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].boots + ) { + for (const [stat, value] of Object.entries(ARMOR_SETS[armorSet].bonus)) { + console.log(armorSet, stat, value); + stats[stat].armor ??= 0; + stat.includes("_cap") ? (stats[stat].armor = value) : (stats[armor] += value); + } } - // TODO: Make Special Abilities work with format above // ? Mastiff Armor - if (helmet?.tag.ExtraAttributes.id == 'MASTIFF_HELMET' && chestplate?.tag.ExtraAttributes.id == 'MASTIFF_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'MASTIFF_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'MASTIFF_BOOTS') { - stats.health.armor += (stats.crit_damage || 0) * 50; - stats.crit_damage.armor = stats['crit_damage'] / 2; + if ( + helmet?.tag.ExtraAttributes.id == "MASTIFF_HELMET" && + chestplate?.tag.ExtraAttributes.id == "MASTIFF_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "MASTIFF_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "MASTIFF_BOOTS" + ) { + stats.health.armor += (stats.crit_damage || 0) * 50; + stats.crit_damage.armor = stats["crit_damage"] / 2; } // ? Obsidian Chestplate @@ -271,24 +963,84 @@ export function getPlayerStats() { */ // ? Glacite Armor - if (helmet?.tag.ExtraAttributes.id == 'GLACITE_HELMET' && chestplate?.tag.ExtraAttributes.id == 'GLACITE_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'GLACITE_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'GLACITE_BOOTS') { + if ( + helmet?.tag.ExtraAttributes.id == "GLACITE_HELMET" && + chestplate?.tag.ExtraAttributes.id == "GLACITE_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "GLACITE_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "GLACITE_BOOTS" + ) { stats.mining_speed.armor += calculated.levels.mining.level * 2; } // ? Fairy Armor - if (helmet?.tag.ExtraAttributes.id == 'FAIRY_HELMET' && chestplate?.tag.ExtraAttributes.id == 'FAIRY_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'FAIRY_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'FAIRY_BOOTS') { + if ( + helmet?.tag.ExtraAttributes.id == "FAIRY_HELMET" && + chestplate?.tag.ExtraAttributes.id == "FAIRY_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "FAIRY_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "FAIRY_BOOTS" + ) { stats.health.armor += calculated.fairy_souls.collected || 0; } // ? Emerald Armor - if (helmet?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_HELMET' && chestplate?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_CHESTPLATE' && leggings?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_LEGGINGS' && boots?.tag.ExtraAttributes.id == 'EMERALD_ARMOR_BOOTS') { + if ( + helmet?.tag.ExtraAttributes.id == "EMERALD_ARMOR_HELMET" && + chestplate?.tag.ExtraAttributes.id == "EMERALD_ARMOR_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "EMERALD_ARMOR_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "EMERALD_ARMOR_BOOTS" + ) { const amount = calculated.collections.EMERALD.amount || 0; stats.health.armor ??= 0; stats.health.armor += (amount / 3000).toFixed(0) > 350 ? 350 : (amount / 3000).toFixed(0); stats.defense.armor ??= 0; stats.defense.armor += (amount / 3000).toFixed(0) > 350 ? 350 : (amount / 3000).toFixed(0); } - } + } + + // Custom pet abilities + const petStats = getPetData( + stats, + calculated.pets.find((a) => a.active), + calculated + ); + Object.assign(stats, petStats.stats); + + // Potion Effects + for (const effect of calculated.active_effects) { + if (!effect.effect || !MAXED_EFFECTS[effect.effect][effect.level]?.bonus) continue; + for (const [stat, value] of Object.entries(MAXED_EFFECTS[effect.effect][effect.level]?.bonus) || []) { + stats[stat].potion ??= 0; + stats[stat].potion += value; + } + } + + // Reforge + // REFORGES + + const rarities = items.accessory_rarities; + const player_magical_power = {} + + for (const rarity in MAGICAL_POWER) { + player_magical_power[rarity] = 0 + player_magical_power[rarity] += rarities[rarity] * MAGICAL_POWER[rarity]; + } + + const mp_hegemony = rarities.hegemony ? MAGICAL_POWER[rarities.hegemony.rarity] : 0 + const mp_total = Object.values(player_magical_power).reduce((a, b) => a + b) + mp_hegemony; + + // ? Accessory reforge + if (calculated.selected_reforge && REFORGES[calculated.selected_reforge]?.reforge) { + for (const [stat, value] of Object.entries(REFORGES[calculated.selected_reforge].reforge)) { + stats[stat].reforge ??= 0; + stats[stat].reforge += value * mp_total || 0; + } + + // ? Power Bonus from Reforge + for (const [stat, value] of Object.entries(REFORGES[calculated.selected_reforge].power_bonus)) { + stats[stat].reforge ??= 0; + stats[stat].reforge += value || 0; + } + } } catch (error) { console.error(error); @@ -496,3 +1248,259 @@ function getFairyBonus(fairyExchanges: number) { return bonus; } + +function getPetData(stats, pet, calculated) { + let statsMultiplier = 0, + healthMultiplier = 0, + defenseMultiplier = 0, + strengthMultiplier = 0, + bonusAttackSpeedMultiplier = 0; + + if (!pet) { + return { + stats: stats, + statsMultiplier: statsMultiplier, + healthMultiplier: healthMultiplier, + defenseMultiplier: defenseMultiplier, + strengthMultiplier: strengthMultiplier, + bonusAttackSpeedMultiplier: bonusAttackSpeedMultiplier, + } + } + + // ? OVERALL + if (pet.type == "ENDER_DRAGON") { + if (pet.tier != "LEGENDARY") { + statsMultiplier += 0.001 * pet.level.level; + } + } + + // ? HEALTH + if (pet.type == "BLUE_WHALE") { + if (pet.tier == "LEGENDARY") { + healthMultiplier += 0.002 * pet.level.level; + } + } + + // ? DEFENSE (SPEED, HEALTH, FARMING FORTUNE, TRUE DEFENSE) + if (pet.type == "AMMONITE") { + if (pet.tier == "LEGENDARY") { + stats.defense.pet ??= 0; + stats.defense.pet += + calculated.levels.mining.level * (0.02 * pet.level.level) + calculated.levels.fishing.level * (0.02 * pet.level.level); + stats.speed.pet ??= 0; + stats.speed.pet += + calculated.levels.mining.level * (0.02 * pet.level.level) + calculated.levels.fishing.level * (0.02 * pet.level.level); + } + } + + if (pet.type == "ELEPHANT") { + if (pet.tier == "COMMON" || pet.tier == "UNCOMMON") { + stats.defense.pet ??= 0; + stats.defense.pet += (stats.speed.pet / 100) * 0.15 * pet.level.level; + } + if (pet.tier == "RARE") { + stats.defense.pet ??= 0; + stats.health.pet ??= 0; + stats.defense.pet += (stats.speed / 100) * 0.15 * pet.level.level; + stats.health.pet += (stats.defense / 10) * 0.01 * pet.level.level; + } + if (pet.tier == "EPIC") { + stats.defense.pet ??= 0; + stats.health.pet ??= 0; + stats.defense.pet += (stats.speed / 100) * 0.2 * pet.level.level; + stats.health.pet += (stats.defense / 10) * 0.01 * pet.level.level; + } + if (pet.tier == "LEGENDARY") { + stats.defense.pet ??= 0; + stats.health.pet ??= 0; + stats.defense.pet += (stats.speed / 100) * 0.2 * pet.level.level; + stats.health.pet += (stats.defense / 10) * 0.01 * pet.level.level; + } + } + + if (pet.type == "BABY_YETI") { + if (pet.tier == "EPIC") { + stats.defense.pet ??= 0; + stats.defense.pet += stats.strength / (0.5 * pet.level.level); + } + if (pet.tier == "LEGENDARY") { + stats.defense.pet ??= 0; + stats.defense.pet += stats.strength / (0.75 * pet.level.level); + } + } + + if (pet.type == "SILVERFISH") { + if (pet.tier == "COMMON") { + stats.true_defense.pet ??= 0; + stats.true_defense.pet += 0.05 * pet.level.level; + } + if (pet.tier == "UNCOMMON") { + stats.true_defense.pet ??= 0; + stats.true_defense.pet += 0.1 * pet.level.level; + } + if (pet.tier == "RARE") { + stats.true_defense.pet ??= 0; + stats.mining_wisdom.pet ??= 0; + stats.true_defense.pet += 0.1 * pet.level.level; + stats.mining_wisdom.pet += 0.25 * pet.level.level; + } + if (pet.tier == "EPIC" || pet.tier == "LEGENDARY") { + stats.true_defense.pet ??= 0; + stats.mining_wisdom.pet ??= 0; + stats.true_defense.pet += 0.15 * pet.level.level; + stats.mining_wisdom.pet += 0.3 * pet.level.level; + } + } + + if (pet.type == "TURTLE") { + if (pet.tier == "EPIC" || pet.tier == "LEGENDARY") { + defenseMultiplier += 0.33 + 0.27 * pet.level.level; + } + } + + // ? TRUE DEFENSE (DEFENSE, COMBAT WISDOM) + if (pet.type == "DROPLET_WISP") { + stats.combat_wisdom.pet ??= 0; + stats.combat_wisdom.pet += 0.3 * pet.level.level; + } + + if (pet.type == "FROST_WISP") { + stats.combat_wisdom.pet ??= 0; + stats.combat_wisdom.pet += 0.4 * pet.level.level; + } + + if (pet.type == "GLACIAL_WISP") { + stats.combat_wisdom.pet ??= 0; + stats.combat_wisdom.pet += 0.45 * pet.level.level; + } + + if (pet.type == "SUBZERO_WISP") { + stats.combat_wisdom.pet ??= 0; + stats.combat_wisdom.pet += 0.5 * pet.level.level; + } + + // ? STRENGTH (MAGIC FIND) + if (pet.type == "GRIFFIN") { + if (pet.tier == "LEGENDARY") { + strengthMultiplier += 1 + 0.14 * pet.level.level; + } + } + + // ? SPEED (MINING SPEED, MAGIC FIND, PET LUCK, SPEED CAP) + + if (pet.type == "BLACK_CAT") { + if (pet.tier == "LEGENDARY") { + stats.speed.pet ??= 0; + stats.speed.pet += pet.level.level; + stats.magic_find.pet ??= 0; + stats.magic_find.pet += 0.15 * pet.level.level; + stats.pet_luck.pet ??= 0; + stats.pet_luck.pet += 0.15 * pet.level.level; + stats.speed_cap.pet = 500; + } + } + + if (pet.type == "ARMADILO") { + if (pet.tier == "LEGENDARY") { + stats.speed.pet ??= 0; + stats.speed.pet += stats.defense.pet / (100 - pet.level.level * 0.5); + stats.mining_speed.pet ??= 0; + stats.mining_speed.pet += stats.defense.pet / (100 - pet.level.level * 0.5); + } + } + + // ? FEROCITY + if (pet.type == "TIGER") { + if (pet.tier == "COMMON") { + ferocityMultiplier += 0.1 * pet.level.level; + } + if (pet.tier == "UNCOMMON" || pet.tier == "RARE") { + ferocityMultiplier += 0.2 * pet.level.level; + } + if (pet.tier == "EPIC" || pet.tier == "LEGENDARY") { + ferocityMultiplier += 0.3 * pet.level.level; + } + } + + // ? VITALITY + if (pet.type == "GHOUL") { + if (pet.tier == "EPIC" || pet.tier == "LEGENDARY") { + stats.vitality.pet ??= 0; + stats.vitality.pet += 0.25 * pet.level.level; + } + } + + // ? BONUS ATTACK SPEED + if (pet.type == "HOUND") { + if (pet.tier == "LEGENDARY") { + bonusAttackSpeedMultiplier += 0.1 * pet.level.level; + } + } + // ? MINING FORTUNE + if (pet.type == "SCATHA") { + if (pet.tier == "LEGENDARY") { + stats.mining_fortune.pet ??= 0; + stats.mining_fortune.pet += 1.25 * pet.level.level; + } + } + + // ? FISHING SPEED + if (pet.type == "FLYING_FIISH") { + if (pet.tier == "RARE") { + stats.fishing_speed.pet ??= 0; + stats.fishing_speed.pet += 0.6 * pet.level.level; + } + if (pet.tier == "EPIC" || pet.tier == "LEGENDARY" || pet.tier == "MYTHIC") { + stats.fishing_speed.pet ??= 0; + stats.fishing_speed.pet += 0.75 * pet.level.level; + } + } + + // ? SEA CREATURE CHANCE + if (pet.type == "AMMONITE") { + if (pet.tier == "LEGENDARY") { + stats.sea_creature_chance.pet ??= 0; + stats.sea_creature_chance.pet += mining.hotM_tree.level ?? 0; + } + } + + // ? FORAGING FORTUNE + if (pet.type == "MONKEY") { + if (pet.tier == "COMMON") { + stats.foraging_fortune.pet ??= 0; + stats.foraging_fortune.pet += 0.4 * pet.level.level; + } + if (pet.tier == "UNCOMMON" || pet.tier == "RARE") { + stats.foraging_fortune.pet ??= 0; + stats.foraging_fortune.pet += 0.5 * pet.level.level; + } + if (pet.tier == "EPIC" || pet.tier == "LEGENDARY") { + stats.foraging_fortune.pet ??= 0; + stats.foraging_fortune.pet += 0.6 * pet.level.level; + } + } + + // ? FARMING FORTUNE + if (pet.type == "ELEPHANT") { + if (pet.tier == "LEGENDARY") { + stats.farming_fortune.pet ??= 0; + stats.farming_fortune.pet += 1.8 * 100; + } + } + + if (pet.type == "MOOSHROOM_COW") { + if (pet.tier == "LEGENDARY") { + stats.farming_fortune.pet ??= 0; + stats.farming_fortune.pet += stats.strength.pet / (40 - pet.level.level * 0.2); + } + } + + return { + stats: stats, + statsMultiplier: statsMultiplier, + healthMultiplier: healthMultiplier, + defenseMultiplier: defenseMultiplier, + strengthMultiplier: strengthMultiplier, + bonusAttackSpeedMultiplier: bonusAttackSpeedMultiplier, + }; +} diff --git a/src/lib.js b/src/lib.js index 115e7eb365..488f7697c8 100644 --- a/src/lib.js +++ b/src/lib.js @@ -1756,6 +1756,9 @@ export async function getStats( output.perks = userProfile.perks; output.harp_quest = userProfile.harp_quest; output.hotm = "mining_core" in userProfile ? await getHotmItems(userProfile) : []; + output.active_effects = userProfile.active_effects || []; + output.selected_reforge = userProfile.accessory_bag_storage.selected_power || null; + output.essence = getEssence(userProfile, hypixelProfile); output.fishing = { From 6e6be099269fe6d3adf7ad04c40a83b91dff7125 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 14:42:59 +0200 Subject: [PATCH 07/42] refactor: code cleaning and improvement --- common/constants/bonuses.js | 6 +- common/constants/stats.js | 2 +- public/resources/featured-profiles.json | 47 +- public/resources/file-name-map.json | 20 +- public/resources/ts/calculate-player-stats.ts | 820 +----------- src/constants/armor.js | 74 + src/constants/bestiary.js | 1188 ++++++++--------- src/constants/misc.js | 27 +- src/constants/potions.js | 337 +++++ src/constants/reforges.js | 333 +++++ src/hotm.js | 2 +- 11 files changed, 1456 insertions(+), 1400 deletions(-) create mode 100644 src/constants/potions.js create mode 100644 src/constants/reforges.js diff --git a/common/constants/bonuses.js b/common/constants/bonuses.js index bc8fc4e8c6..f9b2764ccc 100644 --- a/common/constants/bonuses.js +++ b/common/constants/bonuses.js @@ -42,9 +42,9 @@ export const STATS_BONUS = { }, skill_social: {}, skill_carpentry: { - 1: { health: 1}, + 1: { health: 1 }, // ! Hypixel Admins made a mistake here, Carpentry 50 for some reason doesn't give health either - 50: { health: 49 } + 50: { health: 49 }, }, skill_runecrafting: {}, // ? Slayers @@ -103,4 +103,4 @@ export const STATS_BONUS = { 8: { true_defense: 2 }, 9: { health: 7 }, }, -}; \ No newline at end of file +}; diff --git a/common/constants/stats.js b/common/constants/stats.js index 78259670bf..d78a828bf6 100644 --- a/common/constants/stats.js +++ b/common/constants/stats.js @@ -344,7 +344,7 @@ export const STATS_DATA = { suffix: "", color: "", }, - damage: { + damage: { name: "Damage", nameLore: "Damage", nameShort: "Damage", diff --git a/public/resources/featured-profiles.json b/public/resources/featured-profiles.json index ad489b37e2..9a3a54ded4 100644 --- a/public/resources/featured-profiles.json +++ b/public/resources/featured-profiles.json @@ -1 +1,46 @@ -[{"uuid":"b44d2d5272dc49c28185b2d6a158d80a","type":"MAINTAINER","message":"a dev or something idk","username":"LesbianCatgirl"},{"uuid":"f5667ad6b4b3434ba58f2ed2396f62f2","type":"MAINTAINER","message":"\"lazy dev\"   (ノ´・ω・)ノ ミ ┸━┸","username":"MartinNemi03"},{"uuid":"20d6334b7f9541ebbf7f860205ebf846","type":"MAINTAINER","message":"bob","username":"jjww2"},{"uuid":"aad581b2f90048a785a7573d31d7b862","type":"MAINTAINER","message":"ember armor no longer on top :((","username":"FantasmicGalaxy"},{"uuid":"d705483c5157460dad39712e4d74dfe1","type":"HOST","message":"Last online: January 1st, 1970","username":"Shiiyu"},{"uuid":"1915444928b64d8b8973df8044f8cdb7","type":"CONTRIBUTOR","message":"lea plant","username":"LeaPhant"},{"uuid":"8a3fa60d87aa4240bcdc624b90632529","type":"CONTRIBUTOR","message":"Nate: CSS Wizard","username":"Cookie_Wookie_7"},{"uuid":"5435b597612f4554a3c651fd1c3ee96a","type":"CONTRIBUTOR","message":"/visit dukioooo","username":"dukioooo"},{"uuid":"b876ec32e396476ba1158438d83c67d4","type":"TECHNOBLADE","message":"Long live the Potato King!","username":"Technoblade"}] +[ + { + "uuid": "b44d2d5272dc49c28185b2d6a158d80a", + "type": "MAINTAINER", + "message": "a dev or something idk", + "username": "LesbianCatgirl" + }, + { + "uuid": "f5667ad6b4b3434ba58f2ed2396f62f2", + "type": "MAINTAINER", + "message": "\"lazy dev\"   (ノ´・ω・)ノ ミ ┸━┸", + "username": "MartinNemi03" + }, + { "uuid": "20d6334b7f9541ebbf7f860205ebf846", "type": "MAINTAINER", "message": "bob", "username": "jjww2" }, + { + "uuid": "aad581b2f90048a785a7573d31d7b862", + "type": "MAINTAINER", + "message": "ember armor no longer on top :((", + "username": "FantasmicGalaxy" + }, + { + "uuid": "d705483c5157460dad39712e4d74dfe1", + "type": "HOST", + "message": "Last online: January 1st, 1970", + "username": "Shiiyu" + }, + { "uuid": "1915444928b64d8b8973df8044f8cdb7", "type": "CONTRIBUTOR", "message": "lea plant", "username": "LeaPhant" }, + { + "uuid": "8a3fa60d87aa4240bcdc624b90632529", + "type": "CONTRIBUTOR", + "message": "Nate: CSS Wizard", + "username": "Cookie_Wookie_7" + }, + { + "uuid": "5435b597612f4554a3c651fd1c3ee96a", + "type": "CONTRIBUTOR", + "message": "/visit dukioooo", + "username": "dukioooo" + }, + { + "uuid": "b876ec32e396476ba1158438d83c67d4", + "type": "TECHNOBLADE", + "message": "Long live the Potato King!", + "username": "Technoblade" + } +] diff --git a/public/resources/file-name-map.json b/public/resources/file-name-map.json index 7605e34064..ed1419ae34 100644 --- a/public/resources/file-name-map.json +++ b/public/resources/file-name-map.json @@ -1 +1,19 @@ -{"browser-compat-check":"browser-compat-check.5a722e1f.js","common":"common.c93a96c4.js","stats-defer":"stats-defer.0e4d269c.js","development-defer":"development-defer.b168e5cd.js","themes":"themes.c08c5ad7.js","local-time":"local-time.0913d9a3.js","rich-item":"rich-item.d16316a4.js","skill-component":"skill-component.186c15c4.js","player-stat":"player-stat.edc7475f.js","bonus-stats":"bonus-stats.0e5ef448.js","common-defer":"common-defer.3712ab8e.js","helper":"helper.32cc478c.js","query-assigned-elements":"query-assigned-elements.79237350.js","if-defined":"if-defined.4ae23b87.js","directive":"directive.272a8723.js","theme-list":"theme-list.4989ba47.js","inventory-view":"inventory-view.05395207.js"} \ No newline at end of file +{ + "browser-compat-check": "browser-compat-check.5a722e1f.js", + "common": "common.c93a96c4.js", + "stats-defer": "stats-defer.0e4d269c.js", + "development-defer": "development-defer.b168e5cd.js", + "themes": "themes.c08c5ad7.js", + "local-time": "local-time.0913d9a3.js", + "rich-item": "rich-item.d16316a4.js", + "skill-component": "skill-component.186c15c4.js", + "player-stat": "player-stat.edc7475f.js", + "bonus-stats": "bonus-stats.0e5ef448.js", + "common-defer": "common-defer.3712ab8e.js", + "helper": "helper.32cc478c.js", + "query-assigned-elements": "query-assigned-elements.79237350.js", + "if-defined": "if-defined.4ae23b87.js", + "directive": "directive.272a8723.js", + "theme-list": "theme-list.4989ba47.js", + "inventory-view": "inventory-view.05395207.js" +} diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index e908dd03df..45a627246b 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -1,785 +1,10 @@ import * as helper from "../../../common/helper.js"; import { STATS_BONUS } from "../../../common/constants.js"; -import { STATS_DATA } from "../../../common/constants/stats.js"; -const symbols = STATS_DATA; - -const HARP_QUEST = { - song_hymn_joy_best_completion: 1, - song_frere_jacques_best_completion: 1, - song_amazing_grace_best_completion: 1, - song_brahms_best_completion: 2, - song_happy_birthday_best_completion: 2, - song_greensleeves_best_completion: 2, - song_jeopardy_best_completion: 3, - song_minuet_best_completion: 3, - song_joy_world_best_completion: 3, - song_pure_imagination_best_completion: 4, - song_vie_en_rose_best_completion: 4, - song_fire_and_flames_best_completion: 1, - song_pachelbel_best_completion: 1, -}; - -const FORBIDDEN_STATS = { - speed: 1, - intelligence: 2, - health: 2, - defense: 1, - strength: 1, -}; - -const ARMOR_SETS = { - SUPERIOR_DRAGON_ARMOR: { - name: "Superior Dragon Armor", - helmet: "SUPERIOR_DRAGON_HELMET", - chestplate: "SUPERIOR_DRAGON_CHESTPLATE", - leggings: "SUPERIOR_DRAGON_LEGGINGS", - boots: "SUPERIOR_DRAGON_BOOTS", - bonus: { - statsMultiplier: 0.05, - }, - }, - YOUNG_DRAGON_ARMOR: { - name: "Young Dragon Armor", - helmet: "YOUNG_DRAGON_HELMET", - chestplate: "YOUNG_DRAGON_CHESTPLATE", - leggings: "YOUNG_DRAGON_LEGGINGS", - boots: "YOUNG_DRAGON_BOOTS", - bonus: { - speed: 75, - speed_cap: 500, - }, - }, - HOLY_DRAGON_ARMOR: { - name: "Holy Dragon Armor", - helmet: "HOLY_DRAGON_HELMET", - chestplate: "HOLY_DRAGON_CHESTPLATE", - leggings: "HOLY_DRAGON_LEGGINGS", - boots: "HOLY_DRAGON_BOOTS", - bonus: { - health_regen: 200, - }, - }, - LAPIS_ARMOR: { - name: "Lapis Armor", - helmet: "LAPIS_ARMOR_HELMET", - chestplate: "LAPIS_ARMOR_CHESTPLATE", - leggings: "LAPIS_ARMOR_LEGGINGS", - boots: "LAPIS_ARMOR_BOOTS", - bonus: { - health: 60, - }, - }, - CHEAP_TUXEDO_ARMOR: { - name: "Cheap Tuxedo Armor", - helmet: "CHEAP_TUXEDO_HELMET", - chestplate: "CHEAP_TUXEDO_CHESTPLATE", - leggings: "CHEAP_TUXEDO_LEGGINGS", - boots: "CHEAP_TUXEDO_BOOTS", - bonus: { - health_cap: 75, - }, - }, - FANCY_TUXEDO_ARMOR: { - name: "Fancy Tuxedo Armor", - helmet: "FANCY_TUXEDO_HELMET", - chestplate: "FANCY_TUXEDO_CHESTPLATE", - leggings: "FANCY_TUXEDO_LEGGINGS", - boots: "FANCY_TUXEDO_BOOTS", - bonus: { - health_cap: 150, - }, - }, - ELEGANT_TUXEDO_ARMOR: { - name: "Elegant Tuxedo Armor", - helmet: "ELEGANT_TUXEDO_HELMET", - chestplate: "ELEGANT_TUXEDO_CHESTPLATE", - leggings: "ELEGANT_TUXEDO_LEGGINGS", - boots: "ELEGANT_TUXEDO_BOOTS", - bonus: { - health_cap: 250, - }, - }, -}; - -const MAXED_EFFECTS = { - true_defense: { - 4: { - name: "True Resistance 4 Potion", - description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, - bonus: { - true_defense: 20, - }, - }, - }, - strength: { - 8: { - name: "Strength 8 Potion", - Description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 75, - }, - }, - }, - regeneration: { - 9: { - name: "Regeneration 9 Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 63, - }, - }, - }, - enchanting_xp_boost: { - 3: { - name: "Enchanting XP Boost III Potion", - description: `Grants +20 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, - bonus: { - enchanting_wisdom: 20, - }, - }, - }, - stun: { - 4: { - name: "Stun 4 Potion", - description: - "When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", - bonus: {}, - }, - }, - experience: { - 4: { - name: "Experience 4 Potion", - description: "Gain 40% more experience orbs.", - bonus: { - combat_wisdom: 10, - }, - }, - }, - rabbit: { - 6: { - name: "Rabbit 6 Potion", - description: `Grants Jump Boost III and +60 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 60, - }, - }, - }, - magic_find: { - 4: { - name: "Magic Find 4 Potion", - description: `Increases the chanfe of finding rare items.`, - bonus: { - magic_find: 75, - }, - }, - }, - night_vision: { - 1: { - name: "Night Vision Potion", - description: `Grants greater visiblity at night.`, - bonus: {}, - }, - }, - absorption: { - 8: { - name: "Absorption 8 Potion", - description: `Grants a boost to absorption health.`, - bonus: { - //absorption: 375, - }, - }, - }, - water_breathing: { - 6: { - name: "Water Breathing 6 Potion", - description: `Grants a chance of not taking drowning damage.`, - bonus: {}, - }, - }, - combat_xp_boost: { - 3: { - name: "Combat XP Boost III Potion", - description: `Grants +20 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, - bonus: { - combat_wisdom: 20, - }, - }, - }, - fire_resistance: { - 1: { - name: "Fire Resistance Potion", - description: `Receive a 10% reduced damage from fire and lava.`, - bonus: {}, - }, - }, - jump_boost: { - 4: { - name: "Jump Boost 4 Potion", - description: `Increases your jump height.`, - bonus: {}, - }, - }, - resistance: { - 8: { - name: "Resistance 8 Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 66, - }, - }, - }, - fishing_xp_boost: { - 3: { - name: "Fishing XP Boost III Potion", - description: `Grants +20 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, - bonus: { - fishing_wisdom: 20, - }, - }, - }, - agility: { - 4: { - name: "Agility 4 Potion", - description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, - bonus: { - speed: 40, - }, - }, - }, - archery: { - 4: { - name: "Archery 4 Potion", - description: `Increases bow damage by 75%.`, - bonus: {}, - }, - }, - critical: { - 4: { - name: "Critical 4 Potion", - description: `Increases ${symbols.crit_chance.symbol} Crit Change by 25% and ${symbols.crit_damage.symbol} Crit Damage by 40%.`, - bonus: { - crit_chance: 25, - crit_damage: 40, - magic_find: 10, - }, - }, - }, - speed: { - 8: { - name: "Speed 8 Potion", - description: `Grants +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 48, - }, - }, - }, - farming_xp_boost: { - 3: { - name: "Farming XP Boost III Potion", - description: `Grants +20 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, - bonus: { - farming_wisdom: 20, - }, - }, - }, - adrenaline: { - 8: { - name: "Adrenaline 8 Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - //absorption: 300, - speed: 40, - }, - }, - }, - spelunker: { - 5: { - name: "Spelunker 5 Potion", - description: `Increases 25 ${symbols.mining_fortune.symbol} Mining Fortune.`, - bonus: { - mining_fortune: 25, - }, - }, - }, - dodge: { - 4: { - name: "Dodge 4 Potion", - description: `Mobs attacks have a 40% chance to miss.`, - bonus: {}, - }, - }, - spirit: { - 4: { - name: "Spirit 4 Potion", - description: `Grants +40 ${symbols.speed.symbol} Speed and +40 ${symbols.crit_damage.symbol} Crit Damage.`, - bonus: { - speed: 40, - crit_damage: 40, - }, - }, - }, - pet_luck: { - 4: { - name: "Pet Luck 4 Potion", - description: `Increases how many pets you can find and gives you better luck in crafting pets.`, - bonus: { - pet_luck: 20, - }, - }, - }, - mining_xp_boost: { - 3: { - name: "Mining XP Boost III Potion", - description: `Grants +20 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, - bonus: { - mining_wisdom: 20, - }, - }, - }, - haste: { - 4: { - name: "Haste 4 Potion", - description: `Increases your mining speed by 80%.`, - bonus: {}, - }, - }, - burning: { - 4: { - name: "Burning 4 Potion", - description: `Increases the duration of fire damage that you inflict on enemies by 20%.`, - bonus: {}, - }, - }, - mana: { - 8: { - name: "Mana 8 Potion", - description: `Grants 8 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - }, - foraging_xp_boost: { - 3: { - name: "Foraging XP Boost III Potion", - description: `Grants +20 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, - bonus: { - foraging_wisdom: 20, - }, - }, - }, - alchemy_xp_boost: { - 3: { - name: "Alchemy XP Boost III Potion", - description: `Grants +20 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, - bonus: { - alchemy_wisdom: 20, - }, - }, - }, - invisibility: { - 1: { - name: "Invisibility Potion", - description: `Grants invisibility from players and mobs.`, - bonus: {}, - }, - }, - jerry_candy: { - 1: { - name: "Jerry Candy", - description: `Grants +100 ${symbols.health.symbol} Health, +20 ${symbols.strength.symbol} Strength, +2 ${symbols.ferocity.symbol} Ferocity, +100 ${symbols.intelligence.symbol} Inteligence, +3 ${symbols.magic_find.symbol} Magic Find`, - bonus: { - health: 100, - strength: 20, - ferocity: 2, - intelligence: 100, - magic_find: 3, - }, - }, - }, - GABAGOEY: { - 1: { - name: "Gabagoey Mixin", - description: `Increases your ${symbols.true_defense.symbol} True Defense by 5.`, - bonus: { - true_defense: 5, - }, - }, - }, - END_PORTAL_FUMES: { - 1: { - name: "End Portal Fumes", - description: `${symbols.soulflow.symbol} Soulflow conversions provide +30% more ${symbols.overflow_mana.symbol} Overflow.`, - bonus: {}, - }, - }, - SPIDER_EGG: { - 1: { - name: "Spider Egg Mixin", - description: `Gain 5% dodge chance!`, - bonus: {}, - }, - }, - ZOMBIE_BRAIN: { - 1: { - name: "Zombie Brain Mixin", - description: `Gain +10 ${symbols.ferocity.symbol} Ferocity!`, - description: { - ferocity: 10, - }, - }, - }, - WOLF_FUR: { - 1: { - name: "Wolf Fur Mixin", - Description: `Gain +7 ${symbols.magic_find.symbol} Magic Find when slaying monsters in one hit!`, - bonus: {}, - }, - }, -}; - -const REFORGES = { - // ! FREE - lucky: { - prefix: "Lucky", - name: null, - reforge: { - crit_chance: 42/250, - crit_damage: 46/250, - health: 32/250, - defense: 12/250, - strength: 46/250, - } - }, - warrior: { - prefix: "Warrior", - name: null, - reforge : { - crit_chance: 23/250, - crit_damage: 58/250, - health: 32/250, - defense: 12/250, - strength: 81/250, - } - }, - pretty: { - prefix: "Pretty", - name: null, - reforge: { - crit_chance: 44/250, - speed: 6/250, - crit_damage: 46/250, - health: 16/250, - defense: 12/250, - strength: 46/250, - intelligence: 104/250, - } - }, - protected: { - prefix: "Protected", - name: null, - reforge: { - crit_chance: 5/250, - crit_damage: 12/250, - health: 113/250, - defense: 104/250, - strength: 23/250, - } - }, - simple: { - prefix: "Simple", - name: null, - reforge: { - crit_chance: 14/250, - speed: 12/250, - crit_damage: 35/250, - health: 49/250, - defense: 35/250, - strength: 32/250, - intelligence: 52/250, - } - }, - disciplined: { - prefix: "Disciplined", - name: null, - reforge: { - crit_chance: 14/250, - crit_damage: 69/250, - health: 49/250, - defense: 23/250, - strength: 69/250, - } - }, - commando: { - prefix: "Commando", - name: null, - reforge: { - crit_chance: 5/250, - crit_damage: 81/250, - health: 49/250, - defense: 23/250, - strength: 81/250, - } - }, - inspired: { - prefix: "Inspired", - name: null, - reforge: { - crit_chance: 9/250, - crit_damage: 35/250, - health: 16/250, - defense: 12/250, - strength: 46/250, - intelligence: 156/250, - } - }, - prepared: { - prefix: "Prepared", - name: null, - reforge: { - crit_chance: 4/250, - crit_damage: 9/250, - health: 120/250, - defense: 109/250, - strength: 19/250, - } - }, - ominous: { - prefix: "Ominous", - name: null, - reforge: { - crit_chance: 14/250, - speed: 9/250, - bonus_attack_speed: 14, - crit_damage: 35/250, - health: 49/250, - strength: 35/250, - intelligence: 42/250, - } - }, - - // ! PAID - silky: { - prefix: "Silky", - name: "Luxurious Spool", - power_bonus: { - bonus_attack_speed: 5 - }, - reforge: { - speed: 6/250, - crit_damage: 220/250, - } - }, - sweet: { - prefix: "Sweet", - name: "Rock Candy", - power_bonus: { - speed: 5 - }, - reforge: { - speed: 0.048, - health: 0.584, - defense: 0.416, - } - }, - bloody: { - prefix: "Bloody", - name: "Beating Heart", - power_bonus: { - bonus_attack_speed: 10 - }, - reforge: { - strength: 0.416, - crit_damage: 0.416, - intelligence: 0.14, - } - }, - itchy: { - prefix: "Itchy", - name: "Furball", - power_bonus: { - strength: 15, - crit_damage: 15, - }, - reforge: { - speed: 6/250, - bonus_attack_speed: 21/250, - crit_damage: 81/250, - strength: 69/250, - } - }, - sighted: { - prefix: "Sighted", - name: "Ender Monocle", - power_bonus: { - ability_damage: 3, - }, - reforge: { - intelligence: 1.388, - } - }, - adept: { - prefix: "Adept", - name: "End Stone Shulker", - power_bonus: { - health: 100, - defense: 50, - }, - reforge: { - health: 0.648, - defense: 0.372, - intelligence: 0.14 - } - }, - mythical: { - prefix: "Mythical", - name: "Obsidian Tablet", - power_bonus: { - health: 150, - strength: 40, - }, - reforge: { - crit_chance: 0.064, - speed: 0.036, - crit_damage: 0.156, - health: 0.22, - defense: 0.156, - strength: 0.156, - intelligence: 0.236, - } - }, - forceful: { - prefix: "Forceful", - name: "Acacia Birdhouse", - power_bonus: { - ferocity: 4 - }, - reforge: { - crit_damage: 0.184, - health: 0.064, - strength: 0.696, - } - }, - shaded: { - prefix: "Shaded", - name: "Dark Orb", - power_bonus: { - bonus_attack_speed: 3, - ferocity: 3, - }, - reforge: { - speed: 0.024, - crit_damage: 0.696, - strength: 0.184, - } - }, - strong: { - prefix: "Strong", - name: "Mandraa", - power_bonus: { - strength: 25, - crit_damage: 25 - }, - reforge: { - crit_damage: 0.464, - strength: 0.464, - } - }, - demonic: { - prefix: "Demonic", - name: "Horns of Torment", - power_bonus: { - crit_damage: 50, - }, - reforge: { - strenght: 0.212, - intelligence: 1.068, - } - }, - pleasent: { - prefix: "Pleasant", - name: "Precious Pearl", - power_bonus: { - health_regen: 10, - //vitality: 10, - }, - reforge: { - health: 0.52, - defense: 0.556, - } - }, - hurtful: { - prefix: "Hurtful", - name: "Magma Urchin", - power_bonus: { - bonus_attack_speed: 15, - }, - reforge: { - crit_damage: 0.74, - strength: 0.184, - } - }, - bizarre: { - prefix: "Bizarre", - name: "Eccentric Painting", - power_bonus: { - ability_damage: 5, - }, - reforge: { - crit_damage: -0.092, - strength: -0.092, - intelligence: 1.668, - } - }, - healthy: { - prefix: "Healthy", - name: "Vitamin Death", - power_bonus: { - health: 200, - }, - reforge: { - health: 1.296 - } - }, - slender: { - prefix: "Slender", - name: "Hazmat Enderman", - power_bonus: { - defense: 100, - strenght: 50, - }, - reforge: { - speed: 6/250, - bonus_attack_speed: 10/250, - crit_damage: 58/250, - health: 81/250, - defense: 58/250, - strenght: 58/250, - intelligence: 87/250, - } - }, - scorching: { - prefix: "Scorching", - name: "Scorched Books", - power_bonus: { - ferocity: 7 - }, - reforge: { - bonus_attack_speed: 0.068, - crit_damage: 0.372, - strength: 0.324, - } - } -} - -const MAGICAL_POWER = { - common: 3, - uncommon: 5, - rare: 8, - epic: 12, - legendary: 16, - mythic: 22, - special: 3, - very_special: 5, -}; +import { REFORGES } from "../../../src/constants/reforges.js"; +import { HARP_QUEST, FORBIDDEN_STATS } from "../../../src/constants/misc.js"; +import { MAGICAL_POWER } from "../../../src/constants/accessories.js"; +import { CUSTOM_ARMOR_ABILTIES } from "../../../src/constants/armor.js"; +import { POTION_EFFECTS } from "../../../src/constants/potions.js"; export function getPlayerStats() { const stats: PlayerStats = { @@ -929,14 +154,14 @@ export function getPlayerStats() { if (piece.categories.includes("helmet")) helmet = piece; } - for (const armorSet of Object.keys(ARMOR_SETS)) { + for (const armorSet of Object.keys(CUSTOM_ARMOR_ABILTIES)) { if ( - helmet?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].helmet && - chestplate?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].chestplate && - leggings?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].leggings && - boots?.tag.ExtraAttributes.id == ARMOR_SETS[armorSet].boots + helmet?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].helmet && + chestplate?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && + leggings?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].leggings && + boots?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].boots ) { - for (const [stat, value] of Object.entries(ARMOR_SETS[armorSet].bonus)) { + for (const [stat, value] of Object.entries(CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { console.log(armorSet, stat, value); stats[stat].armor ??= 0; stat.includes("_cap") ? (stats[stat].armor = value) : (stats[armor] += value); @@ -1007,25 +232,25 @@ export function getPlayerStats() { // Potion Effects for (const effect of calculated.active_effects) { - if (!effect.effect || !MAXED_EFFECTS[effect.effect][effect.level]?.bonus) continue; - for (const [stat, value] of Object.entries(MAXED_EFFECTS[effect.effect][effect.level]?.bonus) || []) { + if (!effect.effect || !POTION_EFFECTS[effect.effect][effect.level]?.bonus) continue; + for (const [stat, value] of Object.entries(POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { stats[stat].potion ??= 0; stats[stat].potion += value; } } - // Reforge + // Reforge // REFORGES const rarities = items.accessory_rarities; - const player_magical_power = {} + const player_magical_power = {}; for (const rarity in MAGICAL_POWER) { - player_magical_power[rarity] = 0 + player_magical_power[rarity] = 0; player_magical_power[rarity] += rarities[rarity] * MAGICAL_POWER[rarity]; } - const mp_hegemony = rarities.hegemony ? MAGICAL_POWER[rarities.hegemony.rarity] : 0 + const mp_hegemony = rarities.hegemony ? MAGICAL_POWER[rarities.hegemony.rarity] : 0; const mp_total = Object.values(player_magical_power).reduce((a, b) => a + b) + mp_hegemony; // ? Accessory reforge @@ -1034,14 +259,13 @@ export function getPlayerStats() { stats[stat].reforge ??= 0; stats[stat].reforge += value * mp_total || 0; } - + // ? Power Bonus from Reforge for (const [stat, value] of Object.entries(REFORGES[calculated.selected_reforge].power_bonus)) { stats[stat].reforge ??= 0; stats[stat].reforge += value || 0; } } - } catch (error) { console.error(error); } @@ -1264,7 +488,7 @@ function getPetData(stats, pet, calculated) { defenseMultiplier: defenseMultiplier, strengthMultiplier: strengthMultiplier, bonusAttackSpeedMultiplier: bonusAttackSpeedMultiplier, - } + }; } // ? OVERALL @@ -1286,10 +510,12 @@ function getPetData(stats, pet, calculated) { if (pet.tier == "LEGENDARY") { stats.defense.pet ??= 0; stats.defense.pet += - calculated.levels.mining.level * (0.02 * pet.level.level) + calculated.levels.fishing.level * (0.02 * pet.level.level); + calculated.levels.mining.level * (0.02 * pet.level.level) + + calculated.levels.fishing.level * (0.02 * pet.level.level); stats.speed.pet ??= 0; stats.speed.pet += - calculated.levels.mining.level * (0.02 * pet.level.level) + calculated.levels.fishing.level * (0.02 * pet.level.level); + calculated.levels.mining.level * (0.02 * pet.level.level) + + calculated.levels.fishing.level * (0.02 * pet.level.level); } } diff --git a/src/constants/armor.js b/src/constants/armor.js index 8343112918..c07a2f6cf6 100644 --- a/src/constants/armor.js +++ b/src/constants/armor.js @@ -32,3 +32,77 @@ export const SPECIAL_SETS = [ name: "Adaptive Armor", }, ]; + +export const CUSTOM_ARMOR_ABILTIES = { + SUPERIOR_DRAGON_ARMOR: { + name: "Superior Dragon Armor", + helmet: "SUPERIOR_DRAGON_HELMET", + chestplate: "SUPERIOR_DRAGON_CHESTPLATE", + leggings: "SUPERIOR_DRAGON_LEGGINGS", + boots: "SUPERIOR_DRAGON_BOOTS", + bonus: { + statsMultiplier: 0.05, + }, + }, + YOUNG_DRAGON_ARMOR: { + name: "Young Dragon Armor", + helmet: "YOUNG_DRAGON_HELMET", + chestplate: "YOUNG_DRAGON_CHESTPLATE", + leggings: "YOUNG_DRAGON_LEGGINGS", + boots: "YOUNG_DRAGON_BOOTS", + bonus: { + speed: 75, + speed_cap: 500, + }, + }, + HOLY_DRAGON_ARMOR: { + name: "Holy Dragon Armor", + helmet: "HOLY_DRAGON_HELMET", + chestplate: "HOLY_DRAGON_CHESTPLATE", + leggings: "HOLY_DRAGON_LEGGINGS", + boots: "HOLY_DRAGON_BOOTS", + bonus: { + health_regen: 200, + }, + }, + LAPIS_ARMOR: { + name: "Lapis Armor", + helmet: "LAPIS_ARMOR_HELMET", + chestplate: "LAPIS_ARMOR_CHESTPLATE", + leggings: "LAPIS_ARMOR_LEGGINGS", + boots: "LAPIS_ARMOR_BOOTS", + bonus: { + health: 60, + }, + }, + CHEAP_TUXEDO_ARMOR: { + name: "Cheap Tuxedo Armor", + helmet: "CHEAP_TUXEDO_HELMET", + chestplate: "CHEAP_TUXEDO_CHESTPLATE", + leggings: "CHEAP_TUXEDO_LEGGINGS", + boots: "CHEAP_TUXEDO_BOOTS", + bonus: { + health_cap: 75, + }, + }, + FANCY_TUXEDO_ARMOR: { + name: "Fancy Tuxedo Armor", + helmet: "FANCY_TUXEDO_HELMET", + chestplate: "FANCY_TUXEDO_CHESTPLATE", + leggings: "FANCY_TUXEDO_LEGGINGS", + boots: "FANCY_TUXEDO_BOOTS", + bonus: { + health_cap: 150, + }, + }, + ELEGANT_TUXEDO_ARMOR: { + name: "Elegant Tuxedo Armor", + helmet: "ELEGANT_TUXEDO_HELMET", + chestplate: "ELEGANT_TUXEDO_CHESTPLATE", + leggings: "ELEGANT_TUXEDO_LEGGINGS", + boots: "ELEGANT_TUXEDO_BOOTS", + bonus: { + health_cap: 250, + }, + }, +}; diff --git a/src/constants/bestiary.js b/src/constants/bestiary.js index f1f3135816..e392d4910c 100644 --- a/src/constants/bestiary.js +++ b/src/constants/bestiary.js @@ -1,597 +1,597 @@ export const BESTIARY = { - private: { - max: 5, - mobs: [ - { - id: "kills_family_zombie", - name: "Zombie", - skyblockId: "ZOMBIE_SKULL", - itemId: 397, - damage: 2, - maxTier: 5, - }, - { - id: "kills_family_skeleton", - name: "Skeleton", - skyblockId: "SKELETON_SKULL", - itemId: 397, - damage: 0, - maxTier: 5, - }, - { - id: "kills_family_spider", - name: "Spider", - head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", - maxTier: 5, - }, - { - id: "kills_family_cave_spider", - name: "Cave Spider", - head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", - maxTier: 5, - }, - { - id: "kills_family_enderman_private", - name: "Enderman", - head: "96c0b36d53fff69a49c7d6f3932f2b0fe948e032226d5e8045ec58408a36e951", - maxTier: 5, - }, - { - id: "kills_family_slime", - name: "Slime", - head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", - maxTier: 5, - }, - { - id: "kills_family_witch", - name: "Witch", - head: "fce6604157fc4ab5591e4bcf507a749918ee9c41e357d47376e0ee7342074c90", - maxTier: 5, - }, - ], - }, - hub: { - max: 1000, - mobs: [ - { - id: "kills_family_zombie_villager", - name: "Zombie Villager", - head: "e5e08a8776c1764c3fe6a6ddd412dfcb87f41331dad479ac96c21df4bf3ac89c", - }, - { - id: "kills_family_unburried_zombie", - name: "Crypt Ghoul", - skyblockId: "GOLD_SWORD", - itemId: 283, - damage: 0, - }, - { - id: "kills_family_ruin_wolf", - name: "Wolf", - head: "69d1d3113ec43ac2961dd59f28175fb4718873c6c448dfca8722317d67", - }, - { - id: "kills_family_old_wolf", - name: "Old Wolf", - head: "d359537c15534f61c1cd886bc118774ed22280e7cdab6613870160aad4ca39", - }, - ], - }, - spiders: { - max: 1000, - mobs: [ - { - id: "kills_family_dasher_spider", - name: "Dasher Spider", - head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", - }, - { - id: "kills_family_spider_jockey", - name: "Spider Jockey", - head: "70939373cafe4b1f5397aafd09f3bb1663e7b629a41a75fbdc1860b6bf8b475f", - }, - { - id: "kills_family_weaver_spider", - name: "Weaver Spider", - head: "921438f646dc04515967e8195ccc3d31e23b02f9aa0ac914edc2822f98394b86", - }, - { - id: "kills_family_voracious_spider", - name: "Voracious Spider", - head: "8300986ed0a04ea79904f6ae53f49ed3a0ff5b1df62bba622ecbd3777f156df8", - }, - { - id: "kills_family_splitter_spider", - name: "Splitter Spider", - head: "2acf69fc7af5497a1741891d1e5bf32b96ae0d6c0bbd3c14758ea44a03c57283", - }, - { - id: "kills_family_brood_mother_spider", - boss: true, - name: "Brood Mother", - head: "cf0622b3998d42b34d5bc760bb2c83fdbc6e68fab05b7ea17b35097ed81190d6", - }, - { - id: "kills_family_respawning_skeleton", - name: "Gravel Skeleton", - skyblockId: "SKELETON_SKULL", - itemId: 397, - damage: 0, - }, - { - id: "kills_family_random_slime", - name: "Rain Slime", - head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", - }, - { - id: "kills_family_arachne_keeper", - name: "Arachne's Keeper", - head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", - }, - { - id: "kills_family_arachne_brood", - name: "Arachne's Brood", - head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", - }, - { - boss: true, - id: "kills_family_arachne", - name: "Arachne", - head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", - }, - ], - }, - fortress: { - max: 1000, - mobs: [ - { - id: "kills_family_ashfang", - boss: true, - name: "Ashfang", - head: "3d2a5b4b109bd788edba0171d0aab8a55305ac2f56184df70a319cd488a36c3e", - }, - { - id: "kills_family_barbarian_duke_x", - boss: true, - name: "Barbarian Duke X", - head: "fee9fc7c181e2f630f6b1af85d4951359cafcfa82ff5ea3bc283e0e6088c6e54", - }, - { - id: "kills_family_bladesoul", - boss: true, - name: "Bladesoul", - head: "7f5f3384384d7f03bf97a73099b0bafb72c538fc0415ac8613b664f87579a379", - }, - { - id: "kills_family_blaze", - name: "Blaze", - head: "b78ef2e4cf2c41a2d14bfde9caff10219f5b1bf5b35a49eb51c6467882cb5f0", - }, - { - id: "kills_family_flaming_spider", - name: "Flaming Spider", - head: "5a65ef23ea35047150d33880473a47fe635f0c0e3c823bd76dc849cb02441655", - }, - { - id: "kills_family_ghast", - name: "Ghast", - head: "de8a38e9afbd3da10d19b577c55c7bfd6b4f2e407e44d4017b23be9167abff02", - }, - { - id: "kills_family_mage_outlaw", - boss: true, - name: "Mage Outlaw", - head: "ebec99b3a050fd277528407676366e20b92006ad88d14727a4d99eb8cb273b62", - }, - { - id: "kills_family_magma_cube", - name: "Magma Cube", - head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", - }, - { - id: "kills_family_magma_cube_boss", - boss: true, - name: "Magma Cube Boss", - head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", - }, - { - id: "kills_family_matcho", - name: "Matcho", - head: "ef2daabb78a1f7aa12d145d88c0ca46b9e856f5534e9286e555faf0c291f4fd5", - }, - { - id: "kills_family_charging_mushroom_cow", - name: "Mushroom Bull", - head: "2b52841f2fd589e0bc84cbabf9e1c27cb70cac98f8d6b3dd065e55a4dcb70d77", - }, - { - id: "kills_family_pigman", - name: "Pigman", - head: "74e9c6e98582ffd8ff8feb3322cd1849c43fb16b158abb11ca7b42eda7743eb", - }, - { - id: "kills_family_wither_skeleton", - name: "Wither Skeleton", - head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", - }, - { - id: "kills_family_wither_spectre", - name: "Wither Spectre", - head: "f6aa5acfd973f67ba8e249ae07a11ae7ca713c900d90d09ce0903c79ddd7dd9e", - }, - ], - }, - end: { - max: 1000, - mobs: [ - { - id: "kills_family_enderman", - name: "Enderman", - head: "96c0b36d53fff69a49c7d6f3932f2b0fe948e032226d5e8045ec58408a36e951", - }, - { - id: "kills_family_obsidian_wither", - name: "Obsidian Defender", - head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", - }, - { - id: "kills_family_watcher", - name: "Watcher", - head: "daa8fc8de6417b48d48c80b443cf5326e3d9da4dbe9b25fcd49549d96168fc0", - }, - { - id: "kills_family_zealot_enderman", - name: "Zealot", - skyblockId: "SUMMONING_EYE", - itemId: 130, - damage: 0, - }, - { - id: "kills_family_endermite", - name: "Endermite", - head: "5bc7b9d36fb92b6bf292be73d32c6c5b0ecc25b44323a541fae1f1e67e393a3e", - }, - { - id: "kills_family_dragon", - boss: true, - name: "Dragon", - skyblockId: "DRAGON_EGG", - itemId: 122, - damage: 0, - }, - { - id: "kills_family_corrupted_protector", - boss: true, - name: "Endstone Protector", - head: "22bcaceeb4162f400d44743315932ac820d3119ac8986a0161a726161ccc93fc", - }, - { - id: "kills_family_voidling_fanatic", - name: "Voidling Fanatic", - head: "e53b7bcd56f0b95f87dd79ed17636beb9d8346744014228ea2f6b110b148c1", - }, - { - id: "kills_family_voidling_extremist", - name: "Voidling Extremist", - head: "eb07594e2df273921a77c101d0bfdfa1115abed5b9b2029eb496ceba9bdbb4b3", - }, - ], - }, - caverns: { - max: 1000, - mobs: [ - { - id: "kills_family_invisible_creeper", - name: "Sneaky Creeper", - skyblockId: "CREEPER_SKULL", - itemId: 397, - damage: 4, - }, - { - id: "kills_family_lapis_zombie", - name: "Lapis Zombie", - skyblockId: "ZOMBIE_SKULL", - itemId: 351, - damage: 4, - }, - { - id: "kills_family_redstone_pigman", - name: "Redstone Pigman", - skyblockId: "REDSTONE", - itemId: 331, - damage: 0, - }, - { - id: "kills_family_emerald_slime", - name: "Emerald Slime", - head: "5774e86aa4cff792395b77add57b00bb1a102f8f0f0980f4d55b3d7aff1e6da9", - }, - { - id: "kills_family_diamond_zombie", - name: "Miner Zombie", - head: "d28d9ff54188a1afee65b94f3bfcce321c643a34590c14b192b2e3ec2f525d3", - }, - { - id: "kills_family_diamond_skeleton", - name: "Miner Skeleton", - head: "836bbc4215cea1b6a484e893b116e73459ef36bffc622741e577e9493a41e6e", - }, - { - id: "kills_family_caverns_ghost", - name: "Ghost", - head: "981977918a1180e0dec879e6bcd1aa39494977bb913be2ab01aff1db1fa4", - }, - { - id: "kills_family_goblin", - name: "Goblin", - head: "b6b972e32d761b192626e5d6d01edc094940910103cea5e2e2d1f231adb755d5", - }, - { - id: "kills_family_treasure_hoarder", - name: "Treasure Hoarder", - head: "b2b12a814ced8af02cddf29a37e7f3011e430e8a18b38b706f27c6bd31650b65", - }, - { - id: "kills_family_ice_walker", - name: "Ice Walker", - skyblockId: "PACKED_ICE", - itemId: 174, - damage: 0, - }, - { - id: "kills_family_automaton", - name: "Automaton", - head: "22bcaceeb4162f400d44743315932ac820d3119ac8986a0161a726161ccc93fc", - }, - { - id: "kills_family_butterfly", - name: "Butterfly", - head: "9fd806defdfdf59b1f2609c8ee364666de66127a623415b5430c9358c601ef7c", - }, - { - id: "kills_family_team_treasurite", - name: "Grunt", - head: "ef5e03b8de119f8589a808224cbea737f5dcf24235799b7378ac5bf06abf6dd4", - }, - { - id: "kills_family_sludge", - name: "Sludge", - head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", - }, - { - id: "kills_family_thyst", - name: "Thyst", - head: "5bc7b9d36fb92b6bf292be73d32c6c5b0ecc25b44323a541fae1f1e67e393a3e", - }, - { - id: "kills_family_worms", - name: "Worm", - head: "df03ad96092f3f789902436709cdf69de6b727c121b3c2daef9ffa1ccaed186c", - }, - { - id: "kills_family_yog", - name: "Yog", - head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", - }, - ], - }, - park: { - max: 1000, - mobs: [ - { - id: "kills_family_pack_spirit", - name: "Pack Spirit", - head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", - }, - { - id: "kills_family_howling_spirit", - name: "Howling Spirit", - head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", - }, - { - id: "kills_family_soul_of_the_alpha", - name: "Soul of the Alpha", - head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", - }, - ], - }, - spooky: { - max: 1000, - mobs: [ - { - id: "kills_family_trick_or_treater", - name: "Trick or Treater", - head: "d7cbe061b445b88cb2df59accc8d2c1c12118fe0b2127e6e75813550adac67cf", - }, - { - id: "kills_family_wither_gourd", - name: "Wither Gourd", - head: "68f2ffc6fb4e9959b9a7a317f51a6775a159ddc2241dbd6c774d3ac08b6", - }, - { - id: "kills_family_phantom_spirit", - name: "Phantom Spirit", - head: "653b2f7c5e177bd67cead30d0ee53425c7684c975c8c2a5273a09ca49a1f6cdd", - }, - { - id: "kills_family_scary_jerry", - name: "Scary Jerry", - head: "df202dc24d15f7ce36e02fb4b3e8153b146ab9c1724aaa5d484c741da0eeb6fd", - }, - { - id: "kills_family_wraith", - name: "Wraith", - head: "aeabc3075cf41f38e6df1236b95caafcba1bee22c49d804b9427488c2f6e0efc", - }, - { - id: "kills_family_batty_witch", - name: "Crazy Witch", - head: "fce6604157fc4ab5591e4bcf507a749918ee9c41e357d47376e0ee7342074c90", - }, - { - id: "kills_family_headless_horseman", - boss: true, - name: "Headless Horseman", - head: "4c6570f1242992f6eba23ee582598c39e3e745383273deef8b3977583fe3cf5", - }, - ], - }, - catacombs: { - max: 1000, - mobs: [ - { - id: "kills_family_lost_adventurer", - name: "Lost Adventurer", - head: "1e0329f42192ee7c1a0c704f82dbbbe7c00fbfa3f020c1067a208630b991b988", - }, - { - id: "kills_family_zombie_grunt", - name: "Zombie Grunt", - skyblockId: "ZOMBIE_SKULL", - itemId: 397, - damage: 2, - }, - { - id: "kills_family_zombie_soldier", - name: "Zombie Soldier", - skyblockId: "ZOMBIE_SKULL", - itemId: 397, - damage: 2, - }, - { - id: "kills_family_zombie_knight", - name: "Zombie Soldier", - head: "25d2f31ba162fe6272e831aed17f53213db6fa1c4cbe4fc827f3963cc98b9", - }, - { - id: "kills_family_skeleton_grunt", - name: "Skeleton Grunt", - head: "70471677b37ae842c2bd232e16eeb84d5a493231eecec072da38be3127dd5c8", - }, - { - id: "kills_family_skeleton_soldier", - name: "Skeleton Soldier", - head: "219688e0c2f05aeb979d6a1b8c911957b7d3657e14b57af93c5ef6f6a59569dd", - }, - { - id: "kills_family_skeleton_master", - name: "Skeleton Master", - head: "74e95e1b7dc82ba7845a68fc6a312f4cd90ee2f6cce26a68c88b04b1072d879", - }, - { - id: "kills_family_scared_skeleton", - name: "Scared Skeleton", - skyblockId: "SKELETON_SKULL", - itemId: 397, - damage: 0, - }, - { - id: "kills_family_diamond_guy", - name: "Angry Archeologist", - head: "c48c783458e4cf8518e8ab5863fbc4cb948f90568eeb9a60d16c4fde2b96c033", - }, - { - id: "kills_family_dungeon_respawning_skeleton", - name: "Undead Skeleton", - skyblockId: "SKELETON_SKULL", - itemId: 397, - damage: 0, - }, - { - id: "kills_family_skeletor", - name: "Skeletor", - head: "89d074ad9b9971879eb325bddff3675f7224856bd6d569fc8d483c133d73005d", - }, - { - id: "kills_family_sniper_skeleton", - name: "Sniper", - head: "b18c071f080dba50a62a6263ff724edc157ce4fb4883cceff2491d5bbde830c1", - }, - { - id: "kills_family_crypt_souleater", - name: "Crypt Souleater", - head: "66f349270a3b851896cdad842f5eec6e140bd9119b75c074955c3be7865e27c7", - }, - { - id: "kills_family_crypt_dreadlord", - name: "Crypt Dreadlord", - head: "66f349270a3b851896cdad842f5eec6e140bd9119b75c074955c3be7865e27c7", - }, - { - id: "kills_family_crypt_tank_zombie", - name: "Tank Zombie", - skyblockId: "ZOMBIE_SKULL", - itemId: 397, - damage: 2, - }, - { - id: "kills_family_super_tank_zombie", - name: "Super Tank Zombie", - skyblockId: "ZOMBIE_SKULL", - itemId: 397, - damage: 2, - }, - { - id: "kills_family_crypt_lurker", - name: "Crypt Lurker", - skyblockId: "ZOMBIE_SKULL", - itemId: 397, - damage: 2, - }, - { - id: "kills_family_cellar_spider", - name: "Cellar Spider", - head: "41645dfd77d09923107b3496e94eeb5c30329f97efc96ed76e226e98224", - }, - { - id: "kills_family_watcher_summon_undead", - name: "Undead", - head: "f4624a9a8c69ca204504abb043d47456cd9b09749a36357462303f276a229d4", - }, - { - id: "kills_family_lonely_spider", - name: "Lonely Spider", - head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", - }, - { - id: "kills_family_shadow_assassin", - name: "Shadow Assassin", - head: "3399e00f404411e465d74388df132d51fe868ecf86f1c073faffa1d9172ec0f3", - }, - { - id: "kills_family_king_midas", - name: "King Midas", - head: "62bca085750043503f5df9f7def824a2e3acfc27842bcd09d2b6695881e832f5", - }, - { - id: "kills_family_super_archer", - name: "Super Archer", - head: "dcae6db0b59a64305076d966d8e7b9a97be46dae3a807714fa86d37848f6", - }, - { - id: "kills_family_crypt_witherskeleton", - name: "Withermancer", - head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", - }, - { - id: "kills_family_zombie_commander", - name: "Zombie Commander", - skyblockId: "ZOMBIE_SKULL", - itemId: 397, - damage: 2, - }, - ], - }, - }; - - export const BEASTIARY_KILLS = { - regular: [ - 10, 25, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 200000, 300000, 400000, 500000, 600000, - 700000, 800000, 900000, 1000000, 1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 1900000, - 2000000, 2100000, 2200000, 2300000, 2400000, 2500000, 2600000, 2700000, 2800000, 2900000, 3000000, + private: { + max: 5, + mobs: [ + { + id: "kills_family_zombie", + name: "Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + maxTier: 5, + }, + { + id: "kills_family_skeleton", + name: "Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + maxTier: 5, + }, + { + id: "kills_family_spider", + name: "Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + maxTier: 5, + }, + { + id: "kills_family_cave_spider", + name: "Cave Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + maxTier: 5, + }, + { + id: "kills_family_enderman_private", + name: "Enderman", + head: "96c0b36d53fff69a49c7d6f3932f2b0fe948e032226d5e8045ec58408a36e951", + maxTier: 5, + }, + { + id: "kills_family_slime", + name: "Slime", + head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", + maxTier: 5, + }, + { + id: "kills_family_witch", + name: "Witch", + head: "fce6604157fc4ab5591e4bcf507a749918ee9c41e357d47376e0ee7342074c90", + maxTier: 5, + }, ], - boss: [ - 2, 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, - 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, + }, + hub: { + max: 1000, + mobs: [ + { + id: "kills_family_zombie_villager", + name: "Zombie Villager", + head: "e5e08a8776c1764c3fe6a6ddd412dfcb87f41331dad479ac96c21df4bf3ac89c", + }, + { + id: "kills_family_unburried_zombie", + name: "Crypt Ghoul", + skyblockId: "GOLD_SWORD", + itemId: 283, + damage: 0, + }, + { + id: "kills_family_ruin_wolf", + name: "Wolf", + head: "69d1d3113ec43ac2961dd59f28175fb4718873c6c448dfca8722317d67", + }, + { + id: "kills_family_old_wolf", + name: "Old Wolf", + head: "d359537c15534f61c1cd886bc118774ed22280e7cdab6613870160aad4ca39", + }, ], - }; \ No newline at end of file + }, + spiders: { + max: 1000, + mobs: [ + { + id: "kills_family_dasher_spider", + name: "Dasher Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + id: "kills_family_spider_jockey", + name: "Spider Jockey", + head: "70939373cafe4b1f5397aafd09f3bb1663e7b629a41a75fbdc1860b6bf8b475f", + }, + { + id: "kills_family_weaver_spider", + name: "Weaver Spider", + head: "921438f646dc04515967e8195ccc3d31e23b02f9aa0ac914edc2822f98394b86", + }, + { + id: "kills_family_voracious_spider", + name: "Voracious Spider", + head: "8300986ed0a04ea79904f6ae53f49ed3a0ff5b1df62bba622ecbd3777f156df8", + }, + { + id: "kills_family_splitter_spider", + name: "Splitter Spider", + head: "2acf69fc7af5497a1741891d1e5bf32b96ae0d6c0bbd3c14758ea44a03c57283", + }, + { + id: "kills_family_brood_mother_spider", + boss: true, + name: "Brood Mother", + head: "cf0622b3998d42b34d5bc760bb2c83fdbc6e68fab05b7ea17b35097ed81190d6", + }, + { + id: "kills_family_respawning_skeleton", + name: "Gravel Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + }, + { + id: "kills_family_random_slime", + name: "Rain Slime", + head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", + }, + { + id: "kills_family_arachne_keeper", + name: "Arachne's Keeper", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + id: "kills_family_arachne_brood", + name: "Arachne's Brood", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + boss: true, + id: "kills_family_arachne", + name: "Arachne", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + ], + }, + fortress: { + max: 1000, + mobs: [ + { + id: "kills_family_ashfang", + boss: true, + name: "Ashfang", + head: "3d2a5b4b109bd788edba0171d0aab8a55305ac2f56184df70a319cd488a36c3e", + }, + { + id: "kills_family_barbarian_duke_x", + boss: true, + name: "Barbarian Duke X", + head: "fee9fc7c181e2f630f6b1af85d4951359cafcfa82ff5ea3bc283e0e6088c6e54", + }, + { + id: "kills_family_bladesoul", + boss: true, + name: "Bladesoul", + head: "7f5f3384384d7f03bf97a73099b0bafb72c538fc0415ac8613b664f87579a379", + }, + { + id: "kills_family_blaze", + name: "Blaze", + head: "b78ef2e4cf2c41a2d14bfde9caff10219f5b1bf5b35a49eb51c6467882cb5f0", + }, + { + id: "kills_family_flaming_spider", + name: "Flaming Spider", + head: "5a65ef23ea35047150d33880473a47fe635f0c0e3c823bd76dc849cb02441655", + }, + { + id: "kills_family_ghast", + name: "Ghast", + head: "de8a38e9afbd3da10d19b577c55c7bfd6b4f2e407e44d4017b23be9167abff02", + }, + { + id: "kills_family_mage_outlaw", + boss: true, + name: "Mage Outlaw", + head: "ebec99b3a050fd277528407676366e20b92006ad88d14727a4d99eb8cb273b62", + }, + { + id: "kills_family_magma_cube", + name: "Magma Cube", + head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", + }, + { + id: "kills_family_magma_cube_boss", + boss: true, + name: "Magma Cube Boss", + head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", + }, + { + id: "kills_family_matcho", + name: "Matcho", + head: "ef2daabb78a1f7aa12d145d88c0ca46b9e856f5534e9286e555faf0c291f4fd5", + }, + { + id: "kills_family_charging_mushroom_cow", + name: "Mushroom Bull", + head: "2b52841f2fd589e0bc84cbabf9e1c27cb70cac98f8d6b3dd065e55a4dcb70d77", + }, + { + id: "kills_family_pigman", + name: "Pigman", + head: "74e9c6e98582ffd8ff8feb3322cd1849c43fb16b158abb11ca7b42eda7743eb", + }, + { + id: "kills_family_wither_skeleton", + name: "Wither Skeleton", + head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", + }, + { + id: "kills_family_wither_spectre", + name: "Wither Spectre", + head: "f6aa5acfd973f67ba8e249ae07a11ae7ca713c900d90d09ce0903c79ddd7dd9e", + }, + ], + }, + end: { + max: 1000, + mobs: [ + { + id: "kills_family_enderman", + name: "Enderman", + head: "96c0b36d53fff69a49c7d6f3932f2b0fe948e032226d5e8045ec58408a36e951", + }, + { + id: "kills_family_obsidian_wither", + name: "Obsidian Defender", + head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", + }, + { + id: "kills_family_watcher", + name: "Watcher", + head: "daa8fc8de6417b48d48c80b443cf5326e3d9da4dbe9b25fcd49549d96168fc0", + }, + { + id: "kills_family_zealot_enderman", + name: "Zealot", + skyblockId: "SUMMONING_EYE", + itemId: 130, + damage: 0, + }, + { + id: "kills_family_endermite", + name: "Endermite", + head: "5bc7b9d36fb92b6bf292be73d32c6c5b0ecc25b44323a541fae1f1e67e393a3e", + }, + { + id: "kills_family_dragon", + boss: true, + name: "Dragon", + skyblockId: "DRAGON_EGG", + itemId: 122, + damage: 0, + }, + { + id: "kills_family_corrupted_protector", + boss: true, + name: "Endstone Protector", + head: "22bcaceeb4162f400d44743315932ac820d3119ac8986a0161a726161ccc93fc", + }, + { + id: "kills_family_voidling_fanatic", + name: "Voidling Fanatic", + head: "e53b7bcd56f0b95f87dd79ed17636beb9d8346744014228ea2f6b110b148c1", + }, + { + id: "kills_family_voidling_extremist", + name: "Voidling Extremist", + head: "eb07594e2df273921a77c101d0bfdfa1115abed5b9b2029eb496ceba9bdbb4b3", + }, + ], + }, + caverns: { + max: 1000, + mobs: [ + { + id: "kills_family_invisible_creeper", + name: "Sneaky Creeper", + skyblockId: "CREEPER_SKULL", + itemId: 397, + damage: 4, + }, + { + id: "kills_family_lapis_zombie", + name: "Lapis Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 351, + damage: 4, + }, + { + id: "kills_family_redstone_pigman", + name: "Redstone Pigman", + skyblockId: "REDSTONE", + itemId: 331, + damage: 0, + }, + { + id: "kills_family_emerald_slime", + name: "Emerald Slime", + head: "5774e86aa4cff792395b77add57b00bb1a102f8f0f0980f4d55b3d7aff1e6da9", + }, + { + id: "kills_family_diamond_zombie", + name: "Miner Zombie", + head: "d28d9ff54188a1afee65b94f3bfcce321c643a34590c14b192b2e3ec2f525d3", + }, + { + id: "kills_family_diamond_skeleton", + name: "Miner Skeleton", + head: "836bbc4215cea1b6a484e893b116e73459ef36bffc622741e577e9493a41e6e", + }, + { + id: "kills_family_caverns_ghost", + name: "Ghost", + head: "981977918a1180e0dec879e6bcd1aa39494977bb913be2ab01aff1db1fa4", + }, + { + id: "kills_family_goblin", + name: "Goblin", + head: "b6b972e32d761b192626e5d6d01edc094940910103cea5e2e2d1f231adb755d5", + }, + { + id: "kills_family_treasure_hoarder", + name: "Treasure Hoarder", + head: "b2b12a814ced8af02cddf29a37e7f3011e430e8a18b38b706f27c6bd31650b65", + }, + { + id: "kills_family_ice_walker", + name: "Ice Walker", + skyblockId: "PACKED_ICE", + itemId: 174, + damage: 0, + }, + { + id: "kills_family_automaton", + name: "Automaton", + head: "22bcaceeb4162f400d44743315932ac820d3119ac8986a0161a726161ccc93fc", + }, + { + id: "kills_family_butterfly", + name: "Butterfly", + head: "9fd806defdfdf59b1f2609c8ee364666de66127a623415b5430c9358c601ef7c", + }, + { + id: "kills_family_team_treasurite", + name: "Grunt", + head: "ef5e03b8de119f8589a808224cbea737f5dcf24235799b7378ac5bf06abf6dd4", + }, + { + id: "kills_family_sludge", + name: "Sludge", + head: "895aeec6b842ada8669f846d65bc49762597824ab944f22f45bf3bbb941abe6c", + }, + { + id: "kills_family_thyst", + name: "Thyst", + head: "5bc7b9d36fb92b6bf292be73d32c6c5b0ecc25b44323a541fae1f1e67e393a3e", + }, + { + id: "kills_family_worms", + name: "Worm", + head: "df03ad96092f3f789902436709cdf69de6b727c121b3c2daef9ffa1ccaed186c", + }, + { + id: "kills_family_yog", + name: "Yog", + head: "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429", + }, + ], + }, + park: { + max: 1000, + mobs: [ + { + id: "kills_family_pack_spirit", + name: "Pack Spirit", + head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", + }, + { + id: "kills_family_howling_spirit", + name: "Howling Spirit", + head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", + }, + { + id: "kills_family_soul_of_the_alpha", + name: "Soul of the Alpha", + head: "b7c8bef6beb77e29af8627ecdc38d86aa2fea7ccd163dc73c00f9f258f9a1457", + }, + ], + }, + spooky: { + max: 1000, + mobs: [ + { + id: "kills_family_trick_or_treater", + name: "Trick or Treater", + head: "d7cbe061b445b88cb2df59accc8d2c1c12118fe0b2127e6e75813550adac67cf", + }, + { + id: "kills_family_wither_gourd", + name: "Wither Gourd", + head: "68f2ffc6fb4e9959b9a7a317f51a6775a159ddc2241dbd6c774d3ac08b6", + }, + { + id: "kills_family_phantom_spirit", + name: "Phantom Spirit", + head: "653b2f7c5e177bd67cead30d0ee53425c7684c975c8c2a5273a09ca49a1f6cdd", + }, + { + id: "kills_family_scary_jerry", + name: "Scary Jerry", + head: "df202dc24d15f7ce36e02fb4b3e8153b146ab9c1724aaa5d484c741da0eeb6fd", + }, + { + id: "kills_family_wraith", + name: "Wraith", + head: "aeabc3075cf41f38e6df1236b95caafcba1bee22c49d804b9427488c2f6e0efc", + }, + { + id: "kills_family_batty_witch", + name: "Crazy Witch", + head: "fce6604157fc4ab5591e4bcf507a749918ee9c41e357d47376e0ee7342074c90", + }, + { + id: "kills_family_headless_horseman", + boss: true, + name: "Headless Horseman", + head: "4c6570f1242992f6eba23ee582598c39e3e745383273deef8b3977583fe3cf5", + }, + ], + }, + catacombs: { + max: 1000, + mobs: [ + { + id: "kills_family_lost_adventurer", + name: "Lost Adventurer", + head: "1e0329f42192ee7c1a0c704f82dbbbe7c00fbfa3f020c1067a208630b991b988", + }, + { + id: "kills_family_zombie_grunt", + name: "Zombie Grunt", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_zombie_soldier", + name: "Zombie Soldier", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_zombie_knight", + name: "Zombie Soldier", + head: "25d2f31ba162fe6272e831aed17f53213db6fa1c4cbe4fc827f3963cc98b9", + }, + { + id: "kills_family_skeleton_grunt", + name: "Skeleton Grunt", + head: "70471677b37ae842c2bd232e16eeb84d5a493231eecec072da38be3127dd5c8", + }, + { + id: "kills_family_skeleton_soldier", + name: "Skeleton Soldier", + head: "219688e0c2f05aeb979d6a1b8c911957b7d3657e14b57af93c5ef6f6a59569dd", + }, + { + id: "kills_family_skeleton_master", + name: "Skeleton Master", + head: "74e95e1b7dc82ba7845a68fc6a312f4cd90ee2f6cce26a68c88b04b1072d879", + }, + { + id: "kills_family_scared_skeleton", + name: "Scared Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + }, + { + id: "kills_family_diamond_guy", + name: "Angry Archeologist", + head: "c48c783458e4cf8518e8ab5863fbc4cb948f90568eeb9a60d16c4fde2b96c033", + }, + { + id: "kills_family_dungeon_respawning_skeleton", + name: "Undead Skeleton", + skyblockId: "SKELETON_SKULL", + itemId: 397, + damage: 0, + }, + { + id: "kills_family_skeletor", + name: "Skeletor", + head: "89d074ad9b9971879eb325bddff3675f7224856bd6d569fc8d483c133d73005d", + }, + { + id: "kills_family_sniper_skeleton", + name: "Sniper", + head: "b18c071f080dba50a62a6263ff724edc157ce4fb4883cceff2491d5bbde830c1", + }, + { + id: "kills_family_crypt_souleater", + name: "Crypt Souleater", + head: "66f349270a3b851896cdad842f5eec6e140bd9119b75c074955c3be7865e27c7", + }, + { + id: "kills_family_crypt_dreadlord", + name: "Crypt Dreadlord", + head: "66f349270a3b851896cdad842f5eec6e140bd9119b75c074955c3be7865e27c7", + }, + { + id: "kills_family_crypt_tank_zombie", + name: "Tank Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_super_tank_zombie", + name: "Super Tank Zombie", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_crypt_lurker", + name: "Crypt Lurker", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + { + id: "kills_family_cellar_spider", + name: "Cellar Spider", + head: "41645dfd77d09923107b3496e94eeb5c30329f97efc96ed76e226e98224", + }, + { + id: "kills_family_watcher_summon_undead", + name: "Undead", + head: "f4624a9a8c69ca204504abb043d47456cd9b09749a36357462303f276a229d4", + }, + { + id: "kills_family_lonely_spider", + name: "Lonely Spider", + head: "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1", + }, + { + id: "kills_family_shadow_assassin", + name: "Shadow Assassin", + head: "3399e00f404411e465d74388df132d51fe868ecf86f1c073faffa1d9172ec0f3", + }, + { + id: "kills_family_king_midas", + name: "King Midas", + head: "62bca085750043503f5df9f7def824a2e3acfc27842bcd09d2b6695881e832f5", + }, + { + id: "kills_family_super_archer", + name: "Super Archer", + head: "dcae6db0b59a64305076d966d8e7b9a97be46dae3a807714fa86d37848f6", + }, + { + id: "kills_family_crypt_witherskeleton", + name: "Withermancer", + head: "7953b6c68448e7e6b6bf8fb273d7203acd8e1be19e81481ead51f45de59a8", + }, + { + id: "kills_family_zombie_commander", + name: "Zombie Commander", + skyblockId: "ZOMBIE_SKULL", + itemId: 397, + damage: 2, + }, + ], + }, +}; + +export const BEASTIARY_KILLS = { + regular: [ + 10, 25, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 200000, 300000, 400000, 500000, 600000, + 700000, 800000, 900000, 1000000, 1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 1900000, + 2000000, 2100000, 2200000, 2300000, 2400000, 2500000, 2600000, 2700000, 2800000, 2900000, 3000000, + ], + boss: [ + 2, 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, + 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, + ], +}; diff --git a/src/constants/misc.js b/src/constants/misc.js index 74926f1747..75e2d39252 100644 --- a/src/constants/misc.js +++ b/src/constants/misc.js @@ -71,7 +71,6 @@ export const BASE_STATS = { damage_increase: 0, }; - export const STAT_TEMPLATE = { health: 0, defense: 0, @@ -428,4 +427,28 @@ export const ESSENCE = { export const STAT_MAPPINGS = { walk_speed: "speed", -}; \ No newline at end of file +}; + +export const HARP_QUEST = { + song_hymn_joy_best_completion: 1, + song_frere_jacques_best_completion: 1, + song_amazing_grace_best_completion: 1, + song_brahms_best_completion: 2, + song_happy_birthday_best_completion: 2, + song_greensleeves_best_completion: 2, + song_jeopardy_best_completion: 3, + song_minuet_best_completion: 3, + song_joy_world_best_completion: 3, + song_pure_imagination_best_completion: 4, + song_vie_en_rose_best_completion: 4, + song_fire_and_flames_best_completion: 1, + song_pachelbel_best_completion: 1, +}; + +export const FORBIDDEN_STATS = { + speed: 1, + intelligence: 2, + health: 2, + defense: 1, + strength: 1, +}; diff --git a/src/constants/potions.js b/src/constants/potions.js new file mode 100644 index 0000000000..677d5b1fab --- /dev/null +++ b/src/constants/potions.js @@ -0,0 +1,337 @@ +import { STATS_DATA } from "../../common/constants/stats.js"; +const symbols = STATS_DATA; + +export const POTION_EFFECTS = { + true_defense: { + 4: { + name: "True Resistance 4 Potion", + description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 20, + }, + }, + }, + strength: { + 8: { + name: "Strength 8 Potion", + Description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 75, + }, + }, + }, + regeneration: { + 9: { + name: "Regeneration 9 Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 63, + }, + }, + }, + enchanting_xp_boost: { + 3: { + name: "Enchanting XP Boost III Potion", + description: `Grants +20 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, + bonus: { + enchanting_wisdom: 20, + }, + }, + }, + stun: { + 4: { + name: "Stun 4 Potion", + description: + "When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", + bonus: {}, + }, + }, + experience: { + 4: { + name: "Experience 4 Potion", + description: "Gain 40% more experience orbs.", + bonus: { + combat_wisdom: 10, + }, + }, + }, + rabbit: { + 6: { + name: "Rabbit 6 Potion", + description: `Grants Jump Boost III and +60 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 60, + }, + }, + }, + magic_find: { + 4: { + name: "Magic Find 4 Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 75, + }, + }, + }, + night_vision: { + 1: { + name: "Night Vision Potion", + description: `Grants greater visiblity at night.`, + bonus: {}, + }, + }, + absorption: { + 8: { + name: "Absorption 8 Potion", + description: `Grants a boost to absorption health.`, + bonus: { + //absorption: 375, + }, + }, + }, + water_breathing: { + 6: { + name: "Water Breathing 6 Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + }, + combat_xp_boost: { + 3: { + name: "Combat XP Boost III Potion", + description: `Grants +20 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, + bonus: { + combat_wisdom: 20, + }, + }, + }, + fire_resistance: { + 1: { + name: "Fire Resistance Potion", + description: `Receive a 10% reduced damage from fire and lava.`, + bonus: {}, + }, + }, + jump_boost: { + 4: { + name: "Jump Boost 4 Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + }, + resistance: { + 8: { + name: "Resistance 8 Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 66, + }, + }, + }, + fishing_xp_boost: { + 3: { + name: "Fishing XP Boost III Potion", + description: `Grants +20 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, + bonus: { + fishing_wisdom: 20, + }, + }, + }, + agility: { + 4: { + name: "Agility 4 Potion", + description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 40, + }, + }, + }, + archery: { + 4: { + name: "Archery 4 Potion", + description: `Increases bow damage by 75%.`, + bonus: {}, + }, + }, + critical: { + 4: { + name: "Critical 4 Potion", + description: `Increases ${symbols.crit_chance.symbol} Crit Change by 25% and ${symbols.crit_damage.symbol} Crit Damage by 40%.`, + bonus: { + crit_chance: 25, + crit_damage: 40, + magic_find: 10, + }, + }, + }, + speed: { + 8: { + name: "Speed 8 Potion", + description: `Grants +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 48, + }, + }, + }, + farming_xp_boost: { + 3: { + name: "Farming XP Boost III Potion", + description: `Grants +20 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, + bonus: { + farming_wisdom: 20, + }, + }, + }, + adrenaline: { + 8: { + name: "Adrenaline 8 Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + //absorption: 300, + speed: 40, + }, + }, + }, + spelunker: { + 5: { + name: "Spelunker 5 Potion", + description: `Increases 25 ${symbols.mining_fortune.symbol} Mining Fortune.`, + bonus: { + mining_fortune: 25, + }, + }, + }, + dodge: { + 4: { + name: "Dodge 4 Potion", + description: `Mobs attacks have a 40% chance to miss.`, + bonus: {}, + }, + }, + spirit: { + 4: { + name: "Spirit 4 Potion", + description: `Grants +40 ${symbols.speed.symbol} Speed and +40 ${symbols.crit_damage.symbol} Crit Damage.`, + bonus: { + speed: 40, + crit_damage: 40, + }, + }, + }, + pet_luck: { + 4: { + name: "Pet Luck 4 Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 20, + }, + }, + }, + mining_xp_boost: { + 3: { + name: "Mining XP Boost III Potion", + description: `Grants +20 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, + bonus: { + mining_wisdom: 20, + }, + }, + }, + haste: { + 4: { + name: "Haste 4 Potion", + description: `Increases your mining speed by 80%.`, + bonus: {}, + }, + }, + burning: { + 4: { + name: "Burning 4 Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 20%.`, + bonus: {}, + }, + }, + mana: { + 8: { + name: "Mana 8 Potion", + description: `Grants 8 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + }, + foraging_xp_boost: { + 3: { + name: "Foraging XP Boost III Potion", + description: `Grants +20 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, + bonus: { + foraging_wisdom: 20, + }, + }, + }, + alchemy_xp_boost: { + 3: { + name: "Alchemy XP Boost III Potion", + description: `Grants +20 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, + bonus: { + alchemy_wisdom: 20, + }, + }, + }, + invisibility: { + 1: { + name: "Invisibility Potion", + description: `Grants invisibility from players and mobs.`, + bonus: {}, + }, + }, + jerry_candy: { + 1: { + name: "Jerry Candy", + description: `Grants +100 ${symbols.health.symbol} Health, +20 ${symbols.strength.symbol} Strength, +2 ${symbols.ferocity.symbol} Ferocity, +100 ${symbols.intelligence.symbol} Inteligence, +3 ${symbols.magic_find.symbol} Magic Find`, + bonus: { + health: 100, + strength: 20, + ferocity: 2, + intelligence: 100, + magic_find: 3, + }, + }, + }, + GABAGOEY: { + 1: { + name: "Gabagoey Mixin", + description: `Increases your ${symbols.true_defense.symbol} True Defense by 5.`, + bonus: { + true_defense: 5, + }, + }, + }, + END_PORTAL_FUMES: { + 1: { + name: "End Portal Fumes", + description: `${symbols.soulflow.symbol} Soulflow conversions provide +30% more ${symbols.overflow_mana.symbol} Overflow.`, + bonus: {}, + }, + }, + SPIDER_EGG: { + 1: { + name: "Spider Egg Mixin", + description: `Gain 5% dodge chance!`, + bonus: {}, + }, + }, + ZOMBIE_BRAIN: { + 1: { + name: "Zombie Brain Mixin", + description: `Gain +10 ${symbols.ferocity.symbol} Ferocity!`, + description: { + ferocity: 10, + }, + }, + }, + WOLF_FUR: { + 1: { + name: "Wolf Fur Mixin", + Description: `Gain +7 ${symbols.magic_find.symbol} Magic Find when slaying monsters in one hit!`, + bonus: {}, + }, + }, +}; diff --git a/src/constants/reforges.js b/src/constants/reforges.js new file mode 100644 index 0000000000..20bf0a001c --- /dev/null +++ b/src/constants/reforges.js @@ -0,0 +1,333 @@ +export const REFORGES = { + // ! FREE + lucky: { + prefix: "Lucky", + name: null, + reforge: { + crit_chance: 42 / 250, + crit_damage: 46 / 250, + health: 32 / 250, + defense: 12 / 250, + strength: 46 / 250, + }, + }, + warrior: { + prefix: "Warrior", + name: null, + reforge: { + crit_chance: 23 / 250, + crit_damage: 58 / 250, + health: 32 / 250, + defense: 12 / 250, + strength: 81 / 250, + }, + }, + pretty: { + prefix: "Pretty", + name: null, + reforge: { + crit_chance: 44 / 250, + speed: 6 / 250, + crit_damage: 46 / 250, + health: 16 / 250, + defense: 12 / 250, + strength: 46 / 250, + intelligence: 104 / 250, + }, + }, + protected: { + prefix: "Protected", + name: null, + reforge: { + crit_chance: 5 / 250, + crit_damage: 12 / 250, + health: 113 / 250, + defense: 104 / 250, + strength: 23 / 250, + }, + }, + simple: { + prefix: "Simple", + name: null, + reforge: { + crit_chance: 14 / 250, + speed: 12 / 250, + crit_damage: 35 / 250, + health: 49 / 250, + defense: 35 / 250, + strength: 32 / 250, + intelligence: 52 / 250, + }, + }, + disciplined: { + prefix: "Disciplined", + name: null, + reforge: { + crit_chance: 14 / 250, + crit_damage: 69 / 250, + health: 49 / 250, + defense: 23 / 250, + strength: 69 / 250, + }, + }, + commando: { + prefix: "Commando", + name: null, + reforge: { + crit_chance: 5 / 250, + crit_damage: 81 / 250, + health: 49 / 250, + defense: 23 / 250, + strength: 81 / 250, + }, + }, + inspired: { + prefix: "Inspired", + name: null, + reforge: { + crit_chance: 9 / 250, + crit_damage: 35 / 250, + health: 16 / 250, + defense: 12 / 250, + strength: 46 / 250, + intelligence: 156 / 250, + }, + }, + prepared: { + prefix: "Prepared", + name: null, + reforge: { + crit_chance: 4 / 250, + crit_damage: 9 / 250, + health: 120 / 250, + defense: 109 / 250, + strength: 19 / 250, + }, + }, + ominous: { + prefix: "Ominous", + name: null, + reforge: { + crit_chance: 14 / 250, + speed: 9 / 250, + bonus_attack_speed: 14, + crit_damage: 35 / 250, + health: 49 / 250, + strength: 35 / 250, + intelligence: 42 / 250, + }, + }, + + // ! PAID + silky: { + prefix: "Silky", + name: "Luxurious Spool", + power_bonus: { + bonus_attack_speed: 5, + }, + reforge: { + speed: 6 / 250, + crit_damage: 220 / 250, + }, + }, + sweet: { + prefix: "Sweet", + name: "Rock Candy", + power_bonus: { + speed: 5, + }, + reforge: { + speed: 0.048, + health: 0.584, + defense: 0.416, + }, + }, + bloody: { + prefix: "Bloody", + name: "Beating Heart", + power_bonus: { + bonus_attack_speed: 10, + }, + reforge: { + strength: 0.416, + crit_damage: 0.416, + intelligence: 0.14, + }, + }, + itchy: { + prefix: "Itchy", + name: "Furball", + power_bonus: { + strength: 15, + crit_damage: 15, + }, + reforge: { + speed: 6 / 250, + bonus_attack_speed: 21 / 250, + crit_damage: 81 / 250, + strength: 69 / 250, + }, + }, + sighted: { + prefix: "Sighted", + name: "Ender Monocle", + power_bonus: { + ability_damage: 3, + }, + reforge: { + intelligence: 1.388, + }, + }, + adept: { + prefix: "Adept", + name: "End Stone Shulker", + power_bonus: { + health: 100, + defense: 50, + }, + reforge: { + health: 0.648, + defense: 0.372, + intelligence: 0.14, + }, + }, + mythical: { + prefix: "Mythical", + name: "Obsidian Tablet", + power_bonus: { + health: 150, + strength: 40, + }, + reforge: { + crit_chance: 0.064, + speed: 0.036, + crit_damage: 0.156, + health: 0.22, + defense: 0.156, + strength: 0.156, + intelligence: 0.236, + }, + }, + forceful: { + prefix: "Forceful", + name: "Acacia Birdhouse", + power_bonus: { + ferocity: 4, + }, + reforge: { + crit_damage: 0.184, + health: 0.064, + strength: 0.696, + }, + }, + shaded: { + prefix: "Shaded", + name: "Dark Orb", + power_bonus: { + bonus_attack_speed: 3, + ferocity: 3, + }, + reforge: { + speed: 0.024, + crit_damage: 0.696, + strength: 0.184, + }, + }, + strong: { + prefix: "Strong", + name: "Mandraa", + power_bonus: { + strength: 25, + crit_damage: 25, + }, + reforge: { + crit_damage: 0.464, + strength: 0.464, + }, + }, + demonic: { + prefix: "Demonic", + name: "Horns of Torment", + power_bonus: { + crit_damage: 50, + }, + reforge: { + strenght: 0.212, + intelligence: 1.068, + }, + }, + pleasent: { + prefix: "Pleasant", + name: "Precious Pearl", + power_bonus: { + health_regen: 10, + //vitality: 10, + }, + reforge: { + health: 0.52, + defense: 0.556, + }, + }, + hurtful: { + prefix: "Hurtful", + name: "Magma Urchin", + power_bonus: { + bonus_attack_speed: 15, + }, + reforge: { + crit_damage: 0.74, + strength: 0.184, + }, + }, + bizarre: { + prefix: "Bizarre", + name: "Eccentric Painting", + power_bonus: { + ability_damage: 5, + }, + reforge: { + crit_damage: -0.092, + strength: -0.092, + intelligence: 1.668, + }, + }, + healthy: { + prefix: "Healthy", + name: "Vitamin Death", + power_bonus: { + health: 200, + }, + reforge: { + health: 1.296, + }, + }, + slender: { + prefix: "Slender", + name: "Hazmat Enderman", + power_bonus: { + defense: 100, + strenght: 50, + }, + reforge: { + speed: 6 / 250, + bonus_attack_speed: 10 / 250, + crit_damage: 58 / 250, + health: 81 / 250, + defense: 58 / 250, + strenght: 58 / 250, + intelligence: 87 / 250, + }, + }, + scorching: { + prefix: "Scorching", + name: "Scorched Books", + power_bonus: { + ferocity: 7, + }, + reforge: { + bonus_attack_speed: 0.068, + crit_damage: 0.372, + strength: 0.324, + }, + }, +}; diff --git a/src/hotm.js b/src/hotm.js index 55b2a8c663..087ebfaa81 100644 --- a/src/hotm.js +++ b/src/hotm.js @@ -1434,4 +1434,4 @@ export const PRECURSOR_PARTS = { SUPERLITE_MOTOR: "Superlite Motor", CONTROL_SWITCH: "Control Switch", SYNTHETIC_HEART: "Synthetic Heart", -}; \ No newline at end of file +}; From a825f5232e929ccdd32a8f785bbfb17bf73cafdc Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 14:57:43 +0200 Subject: [PATCH 08/42] feat: add statsMultiplier --- public/resources/ts/calculate-player-stats.ts | 53 +++++++++++++++---- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 45a627246b..64873c2145 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -46,6 +46,11 @@ export function getPlayerStats() { }; const allowedStats = Object.keys(stats); const temp = {}; + let statsMultiplier = 0, + healthMultiplier = 0, + defenseMultiplier = 0, + strengthMultiplier = 0, + bonusAttackSpeedMultiplier = 0; try { // Bestiary Level @@ -228,20 +233,17 @@ export function getPlayerStats() { calculated.pets.find((a) => a.active), calculated ); + Object.assign(stats, petStats.stats); - // Potion Effects - for (const effect of calculated.active_effects) { - if (!effect.effect || !POTION_EFFECTS[effect.effect][effect.level]?.bonus) continue; - for (const [stat, value] of Object.entries(POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { - stats[stat].potion ??= 0; - stats[stat].potion += value; - } - } + statsMultiplier += petStats.statsMultiplier || 0; + bonusAttackSpeedMultiplier += petStats.bonusAttackSpeedMultiplier || 0; + defenseMultiplier += petStats.defenseMultiplier || 0; + healthMultiplier += petStats.healthMultiplier || 0; + strengthMultiplier += petStats.strengthMultiplier || 0; + statsMultiplier += petStats.statsMultiplier || 0; // Reforge - // REFORGES - const rarities = items.accessory_rarities; const player_magical_power = {}; @@ -417,6 +419,37 @@ export function getPlayerStats() { stats.health.reaper_peppers = calculated.reaper_peppers_eaten; } + stats.health ??= 0; + stats.defense ??= 0; + stats.strength ??= 0; + stats.bonus_attack_speed ??= 0, + stats.health = healthMultiplier > 0 ? stats.health + stats.health * healthMultiplier : stats.health; + stats.defense = defenseMultiplier > 0 ? stats.defense + stats.defense * defenseMultiplier : stats.defense; + stats.strength = strengthMultiplier > 0 ? stats.strength + stats.strength * strengthMultiplier : stats.strength; + stats.bonus_attack_speed = bonusAttackSpeedMultiplier > 0 ? stats.bonus_attack_speed + stats.bonus_attack_speed * bonusAttackSpeedMultiplier : stats.bonus_attack_speed; + + if (statsMultiplier > 0) { + for (const stat of Object.keys(stats)) { + if (stat.includes('fortune' || stat == 'pristine' || stat == 'effective_health')) continue; + stats.stat += stats.stat * statsMultiplier; + } + } + + // Speed Cap + stats.speed = stats.speed > stats.speed_cap ? (stats.speed = stats.speed_cap) :stats.speed; + + // Health Cap + stats.health = stats.health > stats.health_cap ? (stats.health = stats.health_cap) : stats.health; + + // Potion Effects + for (const effect of calculated.active_effects) { + if (!effect.effect || !POTION_EFFECTS[effect.effect][effect.level]?.bonus) continue; + for (const [stat, value] of Object.entries(POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { + stats[stat].potion ??= 0; + stats[stat].potion += value; + } + } + return stats; } From c1662ed47b16dffdf10cbc237cf25f0808e32615 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 15:06:40 +0200 Subject: [PATCH 09/42] fix: ferocityMultiplier --- public/resources/ts/calculate-player-stats.ts | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 64873c2145..19bf6b6db6 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -47,10 +47,11 @@ export function getPlayerStats() { const allowedStats = Object.keys(stats); const temp = {}; let statsMultiplier = 0, - healthMultiplier = 0, - defenseMultiplier = 0, - strengthMultiplier = 0, - bonusAttackSpeedMultiplier = 0; + healthMultiplier = 0, + defenseMultiplier = 0, + strengthMultiplier = 0, + bonusAttackSpeedMultiplier = 0, + ferocityMultiplier = 0; try { // Bestiary Level @@ -238,6 +239,7 @@ export function getPlayerStats() { statsMultiplier += petStats.statsMultiplier || 0; bonusAttackSpeedMultiplier += petStats.bonusAttackSpeedMultiplier || 0; + ferocityMultiplier += petStats.ferocityMultiplier || 0; defenseMultiplier += petStats.defenseMultiplier || 0; healthMultiplier += petStats.healthMultiplier || 0; strengthMultiplier += petStats.strengthMultiplier || 0; @@ -420,23 +422,28 @@ export function getPlayerStats() { } stats.health ??= 0; + stats.ferocity ??= 0; stats.defense ??= 0; stats.strength ??= 0; - stats.bonus_attack_speed ??= 0, + stats.bonus_attack_speed ??= 0; stats.health = healthMultiplier > 0 ? stats.health + stats.health * healthMultiplier : stats.health; + stats.ferocity = ferocityMultiplier > 0 ? stats.ferocity + stats.ferocity * ferocityMultiplier : stats.ferocity; stats.defense = defenseMultiplier > 0 ? stats.defense + stats.defense * defenseMultiplier : stats.defense; stats.strength = strengthMultiplier > 0 ? stats.strength + stats.strength * strengthMultiplier : stats.strength; - stats.bonus_attack_speed = bonusAttackSpeedMultiplier > 0 ? stats.bonus_attack_speed + stats.bonus_attack_speed * bonusAttackSpeedMultiplier : stats.bonus_attack_speed; + stats.bonus_attack_speed = + bonusAttackSpeedMultiplier > 0 + ? stats.bonus_attack_speed + stats.bonus_attack_speed * bonusAttackSpeedMultiplier + : stats.bonus_attack_speed; if (statsMultiplier > 0) { for (const stat of Object.keys(stats)) { - if (stat.includes('fortune' || stat == 'pristine' || stat == 'effective_health')) continue; - stats.stat += stats.stat * statsMultiplier; + if (stat.includes("fortune" || stat == "pristine" || stat == "effective_health")) continue; + stats.stat += stats.stat * statsMultiplier; } } - // Speed Cap - stats.speed = stats.speed > stats.speed_cap ? (stats.speed = stats.speed_cap) :stats.speed; + // Speed Cap + stats.speed = stats.speed > stats.speed_cap ? (stats.speed = stats.speed_cap) : stats.speed; // Health Cap stats.health = stats.health > stats.health_cap ? (stats.health = stats.health_cap) : stats.health; @@ -511,16 +518,18 @@ function getPetData(stats, pet, calculated) { healthMultiplier = 0, defenseMultiplier = 0, strengthMultiplier = 0, - bonusAttackSpeedMultiplier = 0; + bonusAttackSpeedMultiplier = 0, + ferocityMultiplier: 0; if (!pet) { return { stats: stats, - statsMultiplier: statsMultiplier, - healthMultiplier: healthMultiplier, - defenseMultiplier: defenseMultiplier, - strengthMultiplier: strengthMultiplier, - bonusAttackSpeedMultiplier: bonusAttackSpeedMultiplier, + statsMultiplier: 0, + healthMultiplier: 0, + defenseMultiplier: 0, + strengthMultiplier: 0, + bonusAttackSpeedMultiplier: 0, + ferocityMultiplier: 0, }; } @@ -719,7 +728,7 @@ function getPetData(stats, pet, calculated) { if (pet.type == "AMMONITE") { if (pet.tier == "LEGENDARY") { stats.sea_creature_chance.pet ??= 0; - stats.sea_creature_chance.pet += mining.hotM_tree.level ?? 0; + stats.sea_creature_chance.pet += calculated.hotm[0].display_name.split(" ")[1]; } } From cd679a44aa067c4559453dc9b346dcd76703385b Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 15:09:52 +0200 Subject: [PATCH 10/42] test --- public/resources/ts/calculate-player-stats.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 19bf6b6db6..1d90d1d574 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -520,7 +520,7 @@ function getPetData(stats, pet, calculated) { strengthMultiplier = 0, bonusAttackSpeedMultiplier = 0, ferocityMultiplier: 0; - + if (!pet) { return { stats: stats, From 479f50da77a276733ce5c659cdee96b2a54b80be Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 15:10:49 +0200 Subject: [PATCH 11/42] fix: me being bad --- public/resources/ts/calculate-player-stats.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 1d90d1d574..bceaeb0303 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -519,8 +519,8 @@ function getPetData(stats, pet, calculated) { defenseMultiplier = 0, strengthMultiplier = 0, bonusAttackSpeedMultiplier = 0, - ferocityMultiplier: 0; - + ferocityMultiplier = 0; + if (!pet) { return { stats: stats, From d06b4746b333430cea07d8d6fe05472f86c607e7 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 15:16:00 +0200 Subject: [PATCH 12/42] fix: me being dumb once again --- public/resources/ts/calculate-player-stats.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index bceaeb0303..6deb96c069 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -770,5 +770,6 @@ function getPetData(stats, pet, calculated) { defenseMultiplier: defenseMultiplier, strengthMultiplier: strengthMultiplier, bonusAttackSpeedMultiplier: bonusAttackSpeedMultiplier, + ferocityMultiplier: ferocityMultiplier, }; } From aa279c598a6d0717824b34f7044846515a3cd9b2 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 1 Oct 2022 06:54:37 -0700 Subject: [PATCH 13/42] fix: forgot to enable `custom-resources.js` --- src/custom-resources.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/custom-resources.js b/src/custom-resources.js index affdcf9aaf..adc52c0343 100644 --- a/src/custom-resources.js +++ b/src/custom-resources.js @@ -58,7 +58,7 @@ async function init() { console.log(`Custom Resources loading started on ${getClusterId(true)}.`); console.time(`custom_resources_${getClusterId()}`); - /*for (const packOrFile of await fs.readdir(RESOURCE_PACK_FOLDER, { withFileTypes: true })) { + for (const packOrFile of await fs.readdir(RESOURCE_PACK_FOLDER, { withFileTypes: true })) { if (!packOrFile.isDirectory()) { continue; } @@ -406,7 +406,7 @@ async function init() { pack.textures.push(texture); } - }*/ + } console.log(`Custom Resources loading done. (${getClusterId(true)})`); console.timeEnd(`custom_resources_${getClusterId()}`); From 693d262b4b00c2ce2acf53d5280bdb87b54e5abf Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Mon, 3 Oct 2022 18:22:37 +0200 Subject: [PATCH 14/42] feat: More potions tiers, fix GDrag lore --- src/constants/pet-stats.js | 2 +- src/constants/potions.js | 809 +++++++++++++++++++++++++++++++++++-- src/constants/reforges.js | 80 ++-- 3 files changed, 816 insertions(+), 75 deletions(-) diff --git a/src/constants/pet-stats.js b/src/constants/pet-stats.js index d33166ab17..8dd87e5b19 100644 --- a/src/constants/pet-stats.js +++ b/src/constants/pet-stats.js @@ -1043,7 +1043,7 @@ class GoldenDragon extends Pet { const value = this.level * 0.00125; return { name: "§6Legendary Treasure", - desc: [`Gain §c${round(value, 4)}% damage §7for every million coins in your bank.`], + desc: [`§7Gain §c${round(value, 4)}% damage §7for every million coins in your bank.`], }; } } diff --git a/src/constants/potions.js b/src/constants/potions.js index 677d5b1fab..26af94672d 100644 --- a/src/constants/potions.js +++ b/src/constants/potions.js @@ -3,8 +3,29 @@ const symbols = STATS_DATA; export const POTION_EFFECTS = { true_defense: { + 1: { + name: "True Resistance I Potion", + description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 5, + }, + }, + 2: { + name: "True Resistance II Potion", + description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 10, + }, + }, + 3: { + name: "True Resistance III Potion", + description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 15, + }, + }, 4: { - name: "True Resistance 4 Potion", + name: "True Resistance IV Potion", description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, bonus: { true_defense: 20, @@ -12,17 +33,122 @@ export const POTION_EFFECTS = { }, }, strength: { + 1: { + name: "Strength I Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 5, + }, + }, + 2: { + name: "Strength II Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 12.5, + }, + }, + 3: { + name: "Strength III Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 20, + }, + }, + 4: { + name: "Strength IV Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 30, + }, + }, + 5: { + name: "Strength V Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 40, + }, + }, + 6: { + name: "Strength VI Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 50, + }, + }, + 7: { + name: "Strength VII Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, + bonus: { + strength: 60, + }, + }, 8: { - name: "Strength 8 Potion", - Description: `Increases ${symbols.strength.symbol} Strength.`, + name: "Strength VIII Potion", + description: `Increases ${symbols.strength.symbol} Strength.`, bonus: { strength: 75, }, }, }, regeneration: { + 1: { + name: "Regeneration I Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 5, + }, + }, + 2: { + name: "Regeneration II Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 10, + }, + }, + 3: { + name: "Regeneration III Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 15, + }, + }, + 4: { + name: "Regeneration IV Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 20, + }, + }, + 5: { + name: "Regeneration V Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 25, + }, + }, + 6: { + name: "Regeneration VI Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 30, + }, + }, + 7: { + name: "Regeneration VII Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 40, + }, + }, + 8: { + name: "Regeneration VIII Potion", + description: `Grants ${symbols.health_regen} Health Regen.`, + bonus: { + health_regen: 50, + }, + }, 9: { - name: "Regeneration 9 Potion", + name: "Regeneration IX Potion", description: `Grants ${symbols.health_regen} Health Regen.`, bonus: { health_regen: 63, @@ -30,6 +156,20 @@ export const POTION_EFFECTS = { }, }, enchanting_xp_boost: { + 1: { + name: "Enchanting XP Boost I Potion", + description: `Grants +5 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, + bonus: { + enchanting_wisdom: 5, + }, + }, + 2: { + name: "Enchanting XP Boost II Potion", + description: `Grants +10 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, + bonus: { + enchanting_wisdom: 10, + }, + }, 3: { name: "Enchanting XP Boost III Potion", description: `Grants +20 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, @@ -39,16 +179,45 @@ export const POTION_EFFECTS = { }, }, stun: { + 1: { + name: "Stun I Potion", + description:"When applied to yourself, your hits have a 10% chance to stun enemies for 1s. When splashed, enemies are stunned for 1s.", + bonus: {}, + }, + 2: { + name: "Stun II Potion", + description:"When applied to yourself, your hits have a 20% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.25s.", + bonus: {}, + }, + 3: { + name: "Stun III Potion", + description:"When applied to yourself, your hits have a 30% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.5s.", + bonus: {}, + }, 4: { - name: "Stun 4 Potion", - description: - "When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", + name: "Stun IV Potion", + description:"When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", bonus: {}, }, }, experience: { + 1: { + name: "Experience I Potion", + description: "Gain 10% more experience orbs.", + bonus: {}, + }, + 2: { + name: "Experience II Potion", + description: "Gain 20% more experience orbs.", + bonus: {}, + }, + 3: { + name: "Experience III Potion", + description: "Gain 30% more experience orbs.", + bonus: {}, + }, 4: { - name: "Experience 4 Potion", + name: "Experience IV Potion", description: "Gain 40% more experience orbs.", bonus: { combat_wisdom: 10, @@ -56,8 +225,43 @@ export const POTION_EFFECTS = { }, }, rabbit: { + 1: { + name: "Rabbit I Potion", + description: `Grants Jump Boost I and +10 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 10, + }, + }, + 2: { + name: "Rabbit II Potion", + description: `Grants Jump Boost I and +20 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 20, + }, + }, + 3: { + name: "Rabbit III Potion", + description: `Grants Jump Boost II and +30 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 30, + }, + }, + 4: { + name: "Rabbit IV Potion", + description: `Grants Jump Boost II and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 40, + }, + }, + 5: { + name: "Rabbit V Potion", + description: `Grants Jump Boost III and +50 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 50, + }, + }, 6: { - name: "Rabbit 6 Potion", + name: "Rabbit VI Potion", description: `Grants Jump Boost III and +60 ${symbols.speed.symbol} Speed.`, bonus: { speed: 60, @@ -65,8 +269,29 @@ export const POTION_EFFECTS = { }, }, magic_find: { + 1: { + name: "Magic Find I Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 10, + }, + }, + 2: { + name: "Magic Find II Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 25, + }, + }, + 3: { + name: "Magic Find III Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 50, + }, + }, 4: { - name: "Magic Find 4 Potion", + name: "Magic Find IV Potion", description: `Increases the chanfe of finding rare items.`, bonus: { magic_find: 75, @@ -81,22 +306,95 @@ export const POTION_EFFECTS = { }, }, absorption: { + 1: { + name: "Absorption I Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 2: { + name: "Absorption II Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 3: { + name: "Absorption III Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 4: { + name: "Absorption IV Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 5: { + name: "Absorption V Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 6: { + name: "Absorption VI Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 7: { + name: "Absorption VII Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, 8: { - name: "Absorption 8 Potion", + name: "Absorption VIII Potion", description: `Grants a boost to absorption health.`, - bonus: { - //absorption: 375, - }, + bonus: {}, }, }, water_breathing: { + 1: { + name: "Water Breathing I Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 2: { + name: "Water Breathing II Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 3: { + name: "Water Breathing III Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 4: { + name: "Water Breathing IV Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 5: { + name: "Water Breathing V Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, 6: { - name: "Water Breathing 6 Potion", + name: "Water Breathing VI Potion", description: `Grants a chance of not taking drowning damage.`, bonus: {}, }, + }, combat_xp_boost: { + 1: { + name: "Combat XP Boost I Potion", + description: `Grants +5 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, + bonus: { + combat_wisdom: 5, + }, + }, + 2: { + name: "Combat XP Boost II Potion", + description: `Grants +10 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, + bonus: { + combat_wisdom: 10, + }, + }, 3: { name: "Combat XP Boost III Potion", description: `Grants +20 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, @@ -113,15 +411,79 @@ export const POTION_EFFECTS = { }, }, jump_boost: { + 1: { + name: "Jump Boost I Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + 2: { + name: "Jump Boost II Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + 3: { + name: "Jump Boost III Potion", + description: `Increases your jump height.`, + bonus: {}, + }, 4: { - name: "Jump Boost 4 Potion", + name: "Jump Boost IV Potion", description: `Increases your jump height.`, bonus: {}, }, }, resistance: { + 1: { + name: "Resistance I Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 5, + }, + }, + 2: { + name: "Resistance II Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 10, + }, + }, + 3: { + name: "Resistance III Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 15, + }, + }, + 4: { + name: "Resistance IV Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 20, + }, + }, + 5: { + name: "Resistance V Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 30, + }, + }, + 6: { + name: "Resistance VI Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 40, + }, + }, + 7: { + name: "Resistance VII Potion", + description: `Increases ${symbols.defense.symbol} Defense.`, + bonus: { + defense: 50, + }, + }, 8: { - name: "Resistance 8 Potion", + name: "Resistance VIII Potion", description: `Increases ${symbols.defense.symbol} Defense.`, bonus: { defense: 66, @@ -129,6 +491,20 @@ export const POTION_EFFECTS = { }, }, fishing_xp_boost: { + 1: { + name: "Fishing XP Boost I Potion", + description: `Grants +5 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, + bonus: { + fishing_wisdom: 5, + }, + }, + 2: { + name: "Fishing XP Boost II Potion", + description: `Grants +10 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, + bonus: { + fishing_wisdom: 10, + }, + }, 3: { name: "Fishing XP Boost III Potion", description: `Grants +20 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, @@ -138,8 +514,29 @@ export const POTION_EFFECTS = { }, }, agility: { + 1: { + name: "Agility I Potion", + description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 10, + }, + }, + 2: { + name: "Agility II Potion", + description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 20, + }, + }, + 3: { + name: "Agility III Potion", + description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 30, + }, + }, 4: { - name: "Agility 4 Potion", + name: "Agility IV Potion", description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, bonus: { speed: 40, @@ -147,16 +544,55 @@ export const POTION_EFFECTS = { }, }, archery: { + 1: { + name: "Archery I Potion", + description: `Increases bow damage by 12.5%.`, + bonus: {}, + }, + 2: { + name: "Archery II Potion", + description: `Increases bow damage by 25%.`, + bonus: {}, + }, + 3: { + name: "Archery III Potion", + description: `Increases bow damage by 50%.`, + bonus: {}, + }, 4: { - name: "Archery 4 Potion", + name: "Archery IV Potion", description: `Increases bow damage by 75%.`, bonus: {}, }, }, critical: { + 1: { + name: "Critical I Potion", + description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 10% and ${symbols.crit_damage.symbol} Crit Damage by 10%.`, + bonus: { + crit_chance: 10, + crit_damage: 10, + }, + }, + 2: { + name: "Critical II Potion", + description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 15% and ${symbols.crit_damage.symbol} Crit Damage by 20%.`, + bonus: { + crit_chance: 15, + crit_damage: 20, + }, + }, + 3: { + name: "Critical III Potion", + description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 20% and ${symbols.crit_damage.symbol} Crit Damage by 30%.`, + bonus: { + crit_chance: 20, + crit_damage: 30, + }, + }, 4: { - name: "Critical 4 Potion", - description: `Increases ${symbols.crit_chance.symbol} Crit Change by 25% and ${symbols.crit_damage.symbol} Crit Damage by 40%.`, + name: "Critical IV Potion", + description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 25% and ${symbols.crit_damage.symbol} Crit Damage by 40%.`, bonus: { crit_chance: 25, crit_damage: 40, @@ -165,15 +601,78 @@ export const POTION_EFFECTS = { }, }, speed: { + 1: { + name: "Speed I Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 5, + }, + }, + 2: { + name: "Speed II Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 10, + }, + }, + 3: { + name: "Speed III Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 15, + }, + }, + 4: { + name: "Speed IV Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 20, + }, + }, + 5: { + name: "Speed V Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 25, + }, + }, + 6: { + name: "Speed VI Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 30, + }, + }, + 7: { + name: "Speed VII Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 35, + }, + }, 8: { - name: "Speed 8 Potion", - description: `Grants +40 ${symbols.speed.symbol} Speed.`, + name: "Speed VIII Potion", + description: `Grants + ${symbols.speed.symbol} Speed.`, bonus: { speed: 48, }, }, }, farming_xp_boost: { + 1: { + name: "Farming XP Boost I Potion", + description: `Grants +5 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, + bonus: { + farming_wisdom: 5, + }, + }, + 2: { + name: "Farming XP Boost II Potion", + description: `Grants +10 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, + bonus: { + farming_wisdom: 10, + }, + }, 3: { name: "Farming XP Boost III Potion", description: `Grants +20 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, @@ -183,18 +682,95 @@ export const POTION_EFFECTS = { }, }, adrenaline: { + 1: { + name: "Adrenaline I Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 5, + }, + }, + 2: { + name: "Adrenaline II Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 10, + }, + }, + 3: { + name: "Adrenaline III Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 15, + }, + }, + 4: { + name: "Adrenaline IV Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 20, + }, + }, + 5: { + name: "Adrenaline V Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 25, + }, + }, + 6: { + name: "Adrenaline VI Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 30, + }, + }, + 7: { + name: "Adrenaline VII Potion", + description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, + bonus: { + speed: 35, + }, + }, 8: { - name: "Adrenaline 8 Potion", + name: "Adrenaline VIII Potion", description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, bonus: { - //absorption: 300, speed: 40, }, }, + }, spelunker: { + 1: { + name: "Spelunker I Potion", + description: `Increases 5 ${symbols.mining_fortune.symbol} Mining Fortune.`, + bonus: { + mining_fortune: 5, + }, + }, + 2: { + name: "Spelunker II Potion", + description: `Increases 10 ${symbols.mining_fortune.symbol} Mining Fortune.`, + bonus: { + mining_fortune: 10, + }, + }, + 3: { + name: "Spelunker III Potion", + description: `Increases 15 ${symbols.mining_fortune.symbol} Mining Fortune.`, + bonus: { + mining_fortune: 15, + }, + }, + 4: { + name: "Spelunker IV Potion", + description: `Increases 20 ${symbols.mining_fortune.symbol} Mining Fortune.`, + bonus: { + mining_fortune: 20, + }, + }, 5: { - name: "Spelunker 5 Potion", + name: "Spelunker V Potion", description: `Increases 25 ${symbols.mining_fortune.symbol} Mining Fortune.`, bonus: { mining_fortune: 25, @@ -202,15 +778,54 @@ export const POTION_EFFECTS = { }, }, dodge: { + 1: { + name: "Dodge I Potion", + description: `Mobs attacks have a 10% chance to miss.`, + bonus: {}, + }, + 2: { + name: "Dodge II Potion", + description: `Mobs attacks have a 20% chance to miss.`, + bonus: {}, + }, + 3: { + name: "Dodge III Potion", + description: `Mobs attacks have a 30% chance to miss.`, + bonus: {}, + }, 4: { - name: "Dodge 4 Potion", + name: "Dodge IV Potion", description: `Mobs attacks have a 40% chance to miss.`, bonus: {}, }, }, spirit: { + 1: { + name: "Spirit I Potion", + description: `Grants +10 ${symbols.speed.symbol} Speed and +10 ${symbols.crit_damage.symbol} Crit Damage.`, + bonus: { + speed: 10, + crit_damage: 10, + }, + }, + 2: { + name: "Spirit II Potion", + description: `Grants +20 ${symbols.speed.symbol} Speed and +20 ${symbols.crit_damage.symbol} Crit Damage.`, + bonus: { + speed: 20, + crit_damage: 20, + }, + }, + 3: { + name: "Spirit III Potion", + description: `Grants +30 ${symbols.speed.symbol} Speed and +30 ${symbols.crit_damage.symbol} Crit Damage.`, + bonus: { + speed: 30, + crit_damage: 30, + }, + }, 4: { - name: "Spirit 4 Potion", + name: "Spirit IV Potion", description: `Grants +40 ${symbols.speed.symbol} Speed and +40 ${symbols.crit_damage.symbol} Crit Damage.`, bonus: { speed: 40, @@ -219,8 +834,29 @@ export const POTION_EFFECTS = { }, }, pet_luck: { + 1: { + name: "Pet Luck I Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 5, + }, + }, + 2: { + name: "Pet Luck II Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 10, + }, + }, + 3: { + name: "Pet Luck III Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 15, + }, + }, 4: { - name: "Pet Luck 4 Potion", + name: "Pet Luck IV Potion", description: `Increases how many pets you can find and gives you better luck in crafting pets.`, bonus: { pet_luck: 20, @@ -228,6 +864,20 @@ export const POTION_EFFECTS = { }, }, mining_xp_boost: { + 1: { + name: "Mining XP Boost I Potion", + description: `Grants +5 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, + bonus: { + mining_wisdom: 5, + }, + }, + 2: { + name: "Mining XP Boost II Potion", + description: `Grants +10 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, + bonus: { + mining_wisdom: 10, + }, + }, 3: { name: "Mining XP Boost III Potion", description: `Grants +20 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, @@ -237,27 +887,106 @@ export const POTION_EFFECTS = { }, }, haste: { + 1: { + name: "Haste I Potion", + description: `Increases your mining speed by 20%.`, + bonus: {}, + }, + 2: { + name: "Haste II Potion", + description: `Increases your mining speed by 40%.`, + bonus: {}, + }, + 3: { + name: "Haste III Potion", + description: `Increases your mining speed by 60%.`, + bonus: {}, + }, 4: { - name: "Haste 4 Potion", + name: "Haste IV Potion", description: `Increases your mining speed by 80%.`, bonus: {}, }, }, burning: { + 1: { + name: "Burning I Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 5%.`, + bonus: {}, + }, + 2: { + name: "Burning II Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 10%.`, + bonus: {}, + }, + 3: { + name: "Burning III Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 15%.`, + bonus: {}, + }, 4: { - name: "Burning 4 Potion", + name: "Burning IV Potion", description: `Increases the duration of fire damage that you inflict on enemies by 20%.`, bonus: {}, }, }, mana: { + 1: { + name: "Mana I Potion", + description: `Grants 1 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + 2: { + name: "Mana II Potion", + description: `Grants 2 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + 3: { + name: "Mana III Potion", + description: `Grants 3 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + 4: { + name: "Mana IV Potion", + description: `Grants 4 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + 5: { + name: "Mana V Potion", + description: `Grants 5 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + 6: { + name: "Mana VI Potion", + description: `Grants 6 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, + 7: { + name: "Mana VI Potion", + description: `Grants 7 ${symbols.intelligence.symbol} Mana per second.`, + bonus: {}, + }, 8: { - name: "Mana 8 Potion", + name: "Mana VII Potion", description: `Grants 8 ${symbols.intelligence.symbol} Mana per second.`, bonus: {}, }, }, foraging_xp_boost: { + 1: { + name: "Foraging XP Boost III Potion", + description: `Grants +5 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, + bonus: { + foraging_wisdom: 5, + }, + }, + 2: { + name: "Foraging XP Boost III Potion", + description: `Grants +10 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, + bonus: { + foraging_wisdom: 10, + }, + }, 3: { name: "Foraging XP Boost III Potion", description: `Grants +20 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, @@ -267,6 +996,20 @@ export const POTION_EFFECTS = { }, }, alchemy_xp_boost: { + 1: { + name: "Alchemy XP Boost I Potion", + description: `Grants +5 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, + bonus: { + alchemy_wisdom: 5, + }, + }, + 2: { + name: "Alchemy XP Boost II Potion", + description: `Grants +10 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, + bonus: { + alchemy_wisdom: 10, + }, + }, 3: { name: "Alchemy XP Boost III Potion", description: `Grants +20 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, @@ -322,7 +1065,7 @@ export const POTION_EFFECTS = { 1: { name: "Zombie Brain Mixin", description: `Gain +10 ${symbols.ferocity.symbol} Ferocity!`, - description: { + bonus: { ferocity: 10, }, }, diff --git a/src/constants/reforges.js b/src/constants/reforges.js index 20bf0a001c..a7a28ec28f 100644 --- a/src/constants/reforges.js +++ b/src/constants/reforges.js @@ -1,5 +1,4 @@ export const REFORGES = { - // ! FREE lucky: { prefix: "Lucky", name: null, @@ -118,7 +117,6 @@ export const REFORGES = { }, }, - // ! PAID silky: { prefix: "Silky", name: "Luxurious Spool", @@ -137,9 +135,9 @@ export const REFORGES = { speed: 5, }, reforge: { - speed: 0.048, - health: 0.584, - defense: 0.416, + speed: 12 / 250, + health: 146 / 250, + defense: 104 / 250, }, }, bloody: { @@ -149,9 +147,9 @@ export const REFORGES = { bonus_attack_speed: 10, }, reforge: { - strength: 0.416, - crit_damage: 0.416, - intelligence: 0.14, + strength: 104 / 250, + crit_damage: 104 / 250, + intelligence: 35 / 250, }, }, itchy: { @@ -175,7 +173,7 @@ export const REFORGES = { ability_damage: 3, }, reforge: { - intelligence: 1.388, + intelligence: 347 / 250, }, }, adept: { @@ -186,9 +184,9 @@ export const REFORGES = { defense: 50, }, reforge: { - health: 0.648, - defense: 0.372, - intelligence: 0.14, + health: 162 / 250, + defense: 93 / 250, + intelligence: 35 / 250, }, }, mythical: { @@ -199,13 +197,13 @@ export const REFORGES = { strength: 40, }, reforge: { - crit_chance: 0.064, - speed: 0.036, - crit_damage: 0.156, - health: 0.22, - defense: 0.156, - strength: 0.156, - intelligence: 0.236, + crit_chance: 16 / 250, + speed: 9 / 250, + crit_damage: 39 / 250, + health: 55 / 250, + defense: 39 / 250, + strength: 39 / 250, + intelligence: 59 / 250, }, }, forceful: { @@ -215,9 +213,9 @@ export const REFORGES = { ferocity: 4, }, reforge: { - crit_damage: 0.184, - health: 0.064, - strength: 0.696, + crit_damage: 46 / 250, + health: 16 / 250, + strength: 174 / 250, }, }, shaded: { @@ -228,9 +226,9 @@ export const REFORGES = { ferocity: 3, }, reforge: { - speed: 0.024, - crit_damage: 0.696, - strength: 0.184, + speed: 6 / 250, + crit_damage: 174 / 250, + strength: 46 / 250, }, }, strong: { @@ -241,8 +239,8 @@ export const REFORGES = { crit_damage: 25, }, reforge: { - crit_damage: 0.464, - strength: 0.464, + crit_damage: 116 / 250, + strength: 116 / 250, }, }, demonic: { @@ -252,8 +250,8 @@ export const REFORGES = { crit_damage: 50, }, reforge: { - strenght: 0.212, - intelligence: 1.068, + strenght: 53 / 250, + intelligence: 267 / 250, }, }, pleasent: { @@ -261,11 +259,11 @@ export const REFORGES = { name: "Precious Pearl", power_bonus: { health_regen: 10, - //vitality: 10, + vitality: 10, }, reforge: { - health: 0.52, - defense: 0.556, + health: 130 / 250, + defense: 139 / 250, }, }, hurtful: { @@ -275,8 +273,8 @@ export const REFORGES = { bonus_attack_speed: 15, }, reforge: { - crit_damage: 0.74, - strength: 0.184, + crit_damage: 185 / 250, + strength: 46 / 250, }, }, bizarre: { @@ -286,9 +284,9 @@ export const REFORGES = { ability_damage: 5, }, reforge: { - crit_damage: -0.092, - strength: -0.092, - intelligence: 1.668, + crit_damage: -(23 / 250), + strength: -(23 / 250), + intelligence: 417 / 250, }, }, healthy: { @@ -298,7 +296,7 @@ export const REFORGES = { health: 200, }, reforge: { - health: 1.296, + health: 324 / 250, }, }, slender: { @@ -325,9 +323,9 @@ export const REFORGES = { ferocity: 7, }, reforge: { - bonus_attack_speed: 0.068, - crit_damage: 0.372, - strength: 0.324, + bonus_attack_speed: 17 / 250, + crit_damage: 93 / 250, + strength: 81 / 250, }, }, }; From f37a07d664980be11656d3160c0a820c477d6aa4 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 14 Sep 2022 13:44:05 -0700 Subject: [PATCH 15/42] Update stats.ejs --- common/constants/bonuses.js | 6 +++--- src/constants/potions.js | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/common/constants/bonuses.js b/common/constants/bonuses.js index f9b2764ccc..405b935583 100644 --- a/common/constants/bonuses.js +++ b/common/constants/bonuses.js @@ -1,5 +1,5 @@ export const STATS_BONUS = { - // ? Skills + // Skills skill_farming: { 1: { health: 2, farming_fortune: 4 }, 15: { health: 3, farming_fortune: 4 }, @@ -44,10 +44,10 @@ export const STATS_BONUS = { skill_carpentry: { 1: { health: 1 }, // ! Hypixel Admins made a mistake here, Carpentry 50 for some reason doesn't give health either - 50: { health: 49 }, + 50: { health: 0 }, }, skill_runecrafting: {}, - // ? Slayers + // Slayer slayer_zombie: { 1: { health: 2 }, 2: { health: 2 }, diff --git a/src/constants/potions.js b/src/constants/potions.js index 26af94672d..6d72cab9a7 100644 --- a/src/constants/potions.js +++ b/src/constants/potions.js @@ -181,22 +181,26 @@ export const POTION_EFFECTS = { stun: { 1: { name: "Stun I Potion", - description:"When applied to yourself, your hits have a 10% chance to stun enemies for 1s. When splashed, enemies are stunned for 1s.", + description: + "When applied to yourself, your hits have a 10% chance to stun enemies for 1s. When splashed, enemies are stunned for 1s.", bonus: {}, }, 2: { name: "Stun II Potion", - description:"When applied to yourself, your hits have a 20% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.25s.", + description: + "When applied to yourself, your hits have a 20% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.25s.", bonus: {}, }, 3: { name: "Stun III Potion", - description:"When applied to yourself, your hits have a 30% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.5s.", + description: + "When applied to yourself, your hits have a 30% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.5s.", bonus: {}, }, 4: { name: "Stun IV Potion", - description:"When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", + description: + "When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", bonus: {}, }, }, @@ -378,7 +382,6 @@ export const POTION_EFFECTS = { description: `Grants a chance of not taking drowning damage.`, bonus: {}, }, - }, combat_xp_boost: { 1: { @@ -738,7 +741,6 @@ export const POTION_EFFECTS = { speed: 40, }, }, - }, spelunker: { 1: { From 584be26e46314a7aeaf88e2eaa1e69acb781e187 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Tue, 4 Oct 2022 05:40:00 -0700 Subject: [PATCH 16/42] fix: carpentry skill bonus --- common/constants/bonuses.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/constants/bonuses.js b/common/constants/bonuses.js index f9b2764ccc..405b935583 100644 --- a/common/constants/bonuses.js +++ b/common/constants/bonuses.js @@ -1,5 +1,5 @@ export const STATS_BONUS = { - // ? Skills + // Skills skill_farming: { 1: { health: 2, farming_fortune: 4 }, 15: { health: 3, farming_fortune: 4 }, @@ -44,10 +44,10 @@ export const STATS_BONUS = { skill_carpentry: { 1: { health: 1 }, // ! Hypixel Admins made a mistake here, Carpentry 50 for some reason doesn't give health either - 50: { health: 49 }, + 50: { health: 0 }, }, skill_runecrafting: {}, - // ? Slayers + // Slayer slayer_zombie: { 1: { health: 2 }, 2: { health: 2 }, From 5433d12716670e36a3d39ed7ba501a17c7a73582 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Tue, 4 Oct 2022 05:41:27 -0700 Subject: [PATCH 17/42] Delete hotm.js --- src/hotm.js | 1437 --------------------------------------------------- 1 file changed, 1437 deletions(-) delete mode 100644 src/hotm.js diff --git a/src/hotm.js b/src/hotm.js deleted file mode 100644 index 087ebfaa81..0000000000 --- a/src/hotm.js +++ /dev/null @@ -1,1437 +0,0 @@ -import { SYMBOLS } from "../../common/constants.js"; -import { round, floor, ceil, convertHMS, titleCase } from "../helper.js"; - -const UPGRADE_TYPES = { - mithril_powder: { - name: "Mithril Powder", - color: "2", - }, - gemstone_powder: { - name: "Gemstone Powder", - color: "d", - }, - token_of_the_mountain: { - name: "Token of the Mountain", - color: "5", - }, - free: { - name: "FREE", - color: "a", - }, -}; - -const rewards = { - hotm: { - 1: { - token_of_the_mountain: 1, - }, - 2: { - token_of_the_mountain: 2, - access_to_forge: 0, - new_forgeable_items: 0, - }, - 3: { - token_of_the_mountain: 2, - forge_slot: 1, - new_forgeable_items: 0, - access_crystal_hollows: 0, - emissary_braum_crystal_hollows: 0, - }, - 4: { - token_of_the_mountain: 2, - forge_slot: 1, - new_forgeable_items: 0, - }, - 5: { - token_of_the_mountain: 2, - new_forgeable_items: 0, - }, - 6: { - token_of_the_mountain: 2, - new_forgeable_items: 0, - }, - 7: { - token_of_the_mountain: 2, - new_forgeable_items: 0, - }, - }, - potm: { - 1: { - pickaxe_ability_level: 1, - token_of_the_mountain: 1, - }, - 2: { - forge_slot: 1, - }, - 3: { - commission_slot: 1, - }, - 4: { - mithril_powder_when_mining_mithril: 1, - }, - 5: { - token_of_the_mountain: 1, - }, - 6: { - token_of_the_mountain: 1, - }, - 7: {}, - }, - rewards: { - token_of_the_mountain: { - formatted: "§5Token of the Mountain", - qtyColor: "5", - }, - access_to_forge: { - formatted: "§eAccess to the Forge", - qtyColor: "e", - }, - new_forgeable_items: { - formatted: "§eNew Forgeable Items", - qtyColor: "e", - }, - forge_slot: { - formatted: "§aForge Slot", - qtyColor: "a", - }, - access_crystal_hollows: { - formatted: "§dAccess to the §5Crystal Hollows", - qtyColor: "d", - }, - emissary_braum_crystal_hollows: { - formatted: "§eEmissary Braum §f- §bCrystal Hollows", - qtyColor: "e", - }, - pickaxe_ability_level: { - formatted: "§cPickaxe Ability Level", - qtyColor: "c", - }, - commission_slot: { - formatted: "§aCommission Slot", - qtyColor: "a", - }, - mithril_powder_when_mining_mithril: { - formatted: "§2Mithril Powder §7when mining §fMithril", - qtyColor: "2", - }, - }, -}; - -const nodeNames = { - mining_speed_2: "Mining Speed II", - powder_buff: "Powder Buff", - mining_fortune_2: "Mining Fortune II", - vein_seeker: "Vein Seeker", - lonesome_miner: "Lonesome Miner", - professional: "Professional", - mole: "Mole", - fortunate: "Fortunate", - great_explorer: "Great Explorer", - maniac_miner: "Maniac Miner", - goblin_killer: "Goblin Killer", - special_0: "Peak of the Mountain", - star_powder: "Star Powder", - daily_effect: "Sky Mall", - mining_madness: "Mining Madness", - mining_experience: "Seasoned Mineman", - efficient_miner: "Efficient Miner", - experience_orbs: "Orbiter", - front_loaded: "Front Loaded", - precision_mining: "Precision Mining", - random_event: "Luck of the Cave", - daily_powder: "Daily Powder", - fallen_star_bonus: "Crystallized", - mining_speed_boost: "Mining Speed Boost", - titanium_insanium: "Titanium Insanium", - mining_fortune: "Mining Fortune", - forge_time: "Quick Forge", - pickaxe_toss: "Pickobulus", - mining_speed: "Mining Speed", -}; - -/* -.##.....##..#######..########.##.....## -.##.....##.##.....##....##....###...### -.##.....##.##.....##....##....####.#### -.#########.##.....##....##....##.###.## -.##.....##.##.....##....##....##.....## -.##.....##.##.....##....##....##.....## -.##.....##..#######.....##....##.....## -*/ - -class HotM { - constructor(tier, level) { - this.tier = tier; - this.level = level.level; - this.progress = level.progress; - this.levelWithProgress = level.levelWithProgress; - this.xp = level.xp; - this.xpCurrent = level.xpCurrent; - this.xpForNext = level.xpForNext; - } - - get lore() { - const output = []; - - // name - output.push(this.displayName, ""); - - // main - if (this.status === "unlocked") { - output.push( - "§7You have unlocked this tier. All perks and abilities on this tier are available for unlocking with §5Token of the Mountain§7.", - "" - ); - } else { - output.push( - "§7Progress through your Heart of the Mountain by gaining §5HotM Exp§7, which is earned through completing §aCommissions§7.", - "", - "§7Commissions are tasks given by the §e§lKing§r§7 in the §bRoyal Palace§7. Complete them to earn bountiful rewards!", - "" - ); - } - - // progress - if (this.status === "next") { - const progress = round(this.progress * 100); - const greenBars = ceil(progress / 5); - const whiteBars = 20 - greenBars; - output.push( - `§7Progress: §e${progress}%`, - `${"§2-".repeat(greenBars)}${"§f-".repeat( - whiteBars - )} §e${this.xpCurrent.toLocaleString()} §6/ §e${this.xpForNext.toLocaleString()}`, - "" - ); - } - - // rewards - output.push("§7Rewards"); - for (const [reward, qty] of Object.entries(rewards.hotm[this.tier])) { - const quantity = qty > 0 ? `§${rewards.rewards[reward].qtyColor}${qty} ` : ""; - const name = rewards.rewards[reward].formatted; - output.push(`§8+ ${quantity}${name}`); - } - output.push(""); - - // status - output.push(this.status === "unlocked" ? "§aUNLOCKED" : "§cLOCKED"); - - return output; - } - - get displayName() { - const color = this.status === "unlocked" ? "a" : this.status === "next" ? "e" : "c"; - return `§${color}Tier ${this.tier}`; - } - - get status() { - if (this.tier <= this.level) { - return "unlocked"; - } - - if (this.tier === ceil(this.levelWithProgress)) { - return "next"; - } - - return "locked"; - } - - get itemData() { - const data = { - locked: "160:14", - next: "160:4", - unlocked: "160:5", - }; - - return { - id: parseInt(data[this.status].split(":")[0], 10), - Damage: parseInt(data[this.status].split(":")[1], 10), - glowing: false, - }; - } - - get position7x9() { - return 9 * (HOTM.tiers - this.tier) + 1; - } -} - -/* -.##....##..#######..########..########..######. -.###...##.##.....##.##.....##.##.......##....## -.####..##.##.....##.##.....##.##.......##...... -.##.##.##.##.....##.##.....##.######....######. -.##..####.##.....##.##.....##.##.............## -.##...###.##.....##.##.....##.##.......##....## -.##....##..#######..########..########..######. -*/ - -class Node { - constructor(data) { - this.nodeType = "normal"; - this.level = data.level; - this.enabled = data.enabled; - this.nodes = data.nodes; - this.hotmTier = data.hotmLevelData.level; - this.potmLevel = data.nodes.special_0; - this.selectedPickaxeAbility = data.selectedPickaxeAbility; - } - - get position7x9() { - return this.position + 1 + (ceil(this.position / HOTM.tiers) - 1) * 2; - } - - get itemData() { - const data = { - normal: { - locked: "263:0", - unlocked: "388:0", - maxed: "264:0", - }, - pickaxe_ability: { - locked: "173:0", - unlocked: "133:0", - maxed: "133:0", - }, - special: { - locked: "7:0", - unlocked: "152:0", - maxed: "152:0", - }, - }; - - return { - id: parseInt(data[this.nodeType][this.status].split(":")[0], 10), - Damage: parseInt(data[this.nodeType][this.status].split(":")[1], 10), - glowing: this.selectedPickaxeAbility === this.id, - }; - } - - get lore() { - const output = []; - - // Name - output.push(this.displayName); - - // Level - if (this.max_level > 1) { - if (this.maxed) { - output.push(`§7Level ${Math.max(1, this.level)}`); - } else { - output.push(`§7Level ${Math.max(1, this.level)}§8/${this.max_level}`); - } - } - output.push(""); - - // Perk - output.push(...this.perk(Math.max(1, this.level))); - - // Upgradeable - if (this.level > 0 && this.level < this.max_level) { - // header - output.push("", "§a=====[ §a§lUPGRADE §a] ====="); - - // upgrade perk - output.push(`§7Level ${this.level + 1}§8/${this.max_level}`, "", ...this.perk(this.level + 1)); - - // upgrade cost - output.push( - "", - "§7Cost", - `§${UPGRADE_TYPES[this.upgrade_type].color}${this.upgradeCost.toLocaleString()} ${ - UPGRADE_TYPES[this.upgrade_type].name - }` - ); - } - - // Maxed perk - if (this.maxed && this.nodeType !== "pickaxe_ability") { - output.push("", "§aUNLOCKED"); - } - - // Unlock cost - if (this.level === 0) { - output.push("", "§7Cost"); - for (const [upgradeId, upgradeQty] of Object.entries(this.unlockCost)) { - output.push( - `§${UPGRADE_TYPES[upgradeId].color}${upgradeQty > 0 ? `${upgradeQty} ` : ""}${UPGRADE_TYPES[upgradeId].name}` - ); - } - } - - // Requirements - if (this.level === 0) { - if (this.requires.length > 0 && !this.requires.some((x) => Object.keys(this.nodes).includes(x))) { - const reqs = this.requires.map((x) => nodeNames[x]); - const reqsFriendly = reqs.length > 1 ? reqs.slice(0, -1).join(", ") + " or " + reqs.slice(-1) : reqs[0]; - output.push("", `§cRequires ${reqsFriendly}.`); - } - - if (this.requiredHotmTier > this.hotmTier) { - output.push("", `§cRequires HotM Tier ${this.requiredHotmTier}.`); - } - } - - // Status - if (this.level > 0 && this.nodeType === "normal") { - output.push("", this.enabled ? "§aENABLED" : "§cDISABLED"); - } - - // Selected Pickaxe Ability - if (this.level > 0 && this.nodeType === "pickaxe_ability") { - if (this.selectedPickaxeAbility === this.id) { - output.push("", "§aSELECTED"); - } else { - output.push("", "§eClick to select!"); - } - } - - return output.map((x) => "§r" + x); - } - - get pickaxeAbilityLevel() { - // Blue Omelette gives +1 level, impossible to account for in here - let level = 1; - - if (this.potmLevel >= 1) { - level += 1; - } - - return level; - } - - get requiredHotmTier() { - return Math.abs(ceil(this.position / 7) - 7) + 1; - } - - get unlockCost() { - return { - token_of_the_mountain: 1, - }; - } - - get displayName() { - const nameColor = this.status === "maxed" ? "a" : this.status === "unlocked" ? "e" : "c"; - return `§${nameColor}§l${this.name}`; - } - - get status() { - if (this.level === this.max_level) { - return "maxed"; - } - - if (this.level === 0) { - return "locked"; - } - - return "unlocked"; - } - - get maxed() { - return this.level === this.max_level; - } - - get upgradeCost() { - return -1; - } - - perk(level) { - return ["Missing perk description."]; - } - - get totalUpgradeCost() { - let total = 0; - const originalLevel = this.level; - - for (let level = 1; level < this.max_level; level++) { - this.level = level; - total += this.upgradeCost; - } - - this.level = originalLevel; - - return total; - } -} - -class MiningSpeed2 extends Node { - constructor(data) { - super(data); - this.id = "mining_speed_2"; - this.name = nodeNames[this.id]; - this.position = 2; - this.max_level = 50; - this.upgrade_type = "gemstone_powder"; - this.requires = ["lonesome_miner"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.2)); - } - - perk(level) { - const val = level * 40; - return [`§7Grants §a+${val} §6${SYMBOLS.mining_speed} Mining Speed§7.`]; - } -} - -class PowderBuff extends Node { - constructor(data) { - super(data); - this.id = "powder_buff"; - this.name = nodeNames[this.id]; - this.position = 4; - this.max_level = 50; - this.upgrade_type = "gemstone_powder"; - this.requires = ["mole"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.2)); - } - - perk(level) { - const val = level * 1; - return [`§7Gain §a${val}% §7more Mithril Powder and Gemstone Powder.`]; - } -} - -class MiningFortune2 extends Node { - constructor(data) { - super(data); - this.id = "mining_fortune_2"; - this.name = nodeNames[this.id]; - this.position = 6; - this.max_level = 50; - this.upgrade_type = "gemstone_powder"; - this.requires = ["great_explorer"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.2)); - } - - perk(level) { - const val = level * 5; - return [`§7Grants §a+${val} §6${SYMBOLS.mining_fortune} Mining Fortune§7.`]; - } -} - -class VeinSeeker extends Node { - constructor(data) { - super(data); - this.id = "vein_seeker"; - this.name = nodeNames[this.id]; - this.position = 8; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["lonesome_miner"]; - this.nodeType = "pickaxe_ability"; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - const spread = [2, 3, 4][this.pickaxeAbilityLevel - 1]; - const duration = [12, 14, 16][this.pickaxeAbilityLevel - 1]; - const cooldown = [60, 60, 60][this.pickaxeAbilityLevel - 1]; - return [ - "§6Pickaxe Ability: Vein Seeker", - `§7Points in the direction of the nearest vein and grants §a+${spread} §6Mining Spread §7for §a${duration}s§7.`, - `§8Cooldown: §a${cooldown}s`, - "", - "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", - "", - "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", - ]; - } -} - -class LonesomeMiner extends Node { - constructor(data) { - super(data); - this.id = "lonesome_miner"; - this.name = nodeNames[this.id]; - this.position = 9; - this.max_level = 45; - this.upgrade_type = "gemstone_powder"; - this.requires = ["goblin_killer", "professional"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.07)); - } - - perk(level) { - const val = round(5 + (level - 1) * 0.5); - return [ - `§7Increases §c${SYMBOLS.strength} Strength, §9${SYMBOLS.crit_chance} Crit Chance, §9${SYMBOLS.crit_damage} Crit Damage, §a${SYMBOLS.defense} Defense, and §c${SYMBOLS.health} Health §7statistics gain by §a${val}% §7while in the Crystal Hollows.`, - ]; - } -} - -class Professional extends Node { - constructor(data) { - super(data); - this.id = "professional"; - this.name = nodeNames[this.id]; - this.position = 10; - this.max_level = 140; - this.upgrade_type = "gemstone_powder"; - this.requires = ["mole", "lonesome_miner"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 2.3)); - } - - perk(level) { - const val = 50 + level * 5; - return [`§7Gain §a+${val}§7 §6${SYMBOLS.mining_speed} Mining Speed§7 when mining Gemstones.`]; - } -} - -class Mole extends Node { - constructor(data) { - super(data); - this.id = "mole"; - this.name = nodeNames[this.id]; - this.position = 11; - this.max_level = 190; - this.upgrade_type = "gemstone_powder"; - this.requires = ["efficient_miner", "professional", "fortunate"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 2.2)); - } - - perk(level) { - const chance = 50 + (level - 1) * 5; - let blocks = 1 + floor(chance / 100); - let percent = chance - floor(chance / 100) * 100; - if (percent === 0) { - blocks -= 1; - percent = 100; - } - - switch (blocks) { - case 1: - blocks = "1"; - break; - case 2: - blocks = "a 2nd"; - break; - case 3: - blocks = "a 3rd"; - break; - default: - blocks = `a ${blocks}th`; - break; - } - - return [ - `§7When mining hard stone, you have a §a${percent}%§7 chance to mine §a${blocks}§7 adjacent hard stone block.`, - ]; - } -} - -class Fortunate extends Node { - constructor(data) { - super(data); - this.id = "fortunate"; - this.name = nodeNames[this.id]; - this.position = 12; - this.max_level = 20; - this.upgrade_type = "mithril_powder"; - this.requires = ["mole", "great_explorer"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.05)); - } - - perk(level) { - const val = 20 + level * 4; - return [`§7Grants §a+${val}§7 §6${SYMBOLS.mining_fortune} Mining Fortune§7 when mining Gemstone.`]; - } -} - -class GreatExplorer extends Node { - constructor(data) { - super(data); - this.id = "great_explorer"; - this.name = nodeNames[this.id]; - this.position = 13; - this.max_level = 20; - this.upgrade_type = "gemstone_powder"; - this.requires = ["star_powder", "fortunate"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 4)); - } - - perk(level) { - const val = 20 + (level - 1) * 4; - return [`§7Grants §a+${val}%§7 §7chance to find treasure.`]; - } -} - -class ManiacMiner extends Node { - constructor(data) { - super(data); - this.id = "maniac_miner"; - this.name = nodeNames[this.id]; - this.position = 14; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["great_explorer"]; - this.nodeType = "pickaxe_ability"; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - const speed = [1, 1, 1][this.pickaxeAbilityLevel - 1]; - const duration = [10, 15, 20][this.pickaxeAbilityLevel - 1]; - const cooldown = [60, 59, 59][this.pickaxeAbilityLevel - 1]; - return [ - "§6Pickaxe Ability: Maniac Miner", - `§7Spends all your Mana and grants §a+${speed} §6${SYMBOLS.mining_speed} Mining Speed §7for every 10 Mana spent, for §a${duration}s§7.`, - `§8Cooldown: §a${cooldown}s`, - "", - "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", - "", - "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", - ]; - } -} - -class GoblinKiller extends Node { - constructor(data) { - super(data); - this.id = "goblin_killer"; - this.name = nodeNames[this.id]; - this.position = 16; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["mining_madness", "lonesome_miner"]; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - return [ - `§7Killing a §6Golden Goblin §7gives §2200 §7extra §2Mithril Powder§7, while killing other Goblins gives some based on their wits.`, - ]; - } -} - -class PeakOfTheMountain extends Node { - constructor(data) { - super(data); - this.id = "special_0"; - this.name = nodeNames[this.id]; - this.position = 18; - this.max_level = 5; - this.upgrade_type = "mithril_powder"; - this.requires = ["efficient_miner"]; - this.nodeType = "special"; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(25000 * nextLevel); - } - - perk(level) { - const output = []; - - for (let tier = 1; tier <= level; tier++) { - for (const [reward, qty] of Object.entries(rewards.potm[tier])) { - const qtyColor = rewards.rewards[reward].qtyColor; - const formatted = rewards.rewards[reward].formatted; - output.push(`§8+ §${qtyColor}${qty} ${formatted}`); - } - } - - return output; - } - - get unlockCost() { - return { - free: 0, - }; - } -} - -class StarPowder extends Node { - constructor(data) { - super(data); - this.id = "star_powder"; - this.name = nodeNames[this.id]; - this.position = 20; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["front_loaded", "great_explorer"]; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - return [`§7Mining Mithril Ore near §5Fallen Crystals §7gives §a+3 §7extra Mithril Powder.`]; - } -} - -class SkyMall extends Node { - constructor(data) { - super(data); - this.id = "daily_effect"; - this.name = nodeNames[this.id]; - this.position = 22; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["mining_madness"]; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - return [ - "§7Every SkyBlock day, you receive a random buff in the §2Dwarven Mines§7.", - "", - "§7Possible Buffs", - `§8 ■ §7Gain §a+100 §6${SYMBOLS.mining_speed} Mining Speed.`, - `§8 ■ §7Gain §a+50 §6${SYMBOLS.mining_fortune} Mining Fortune.`, - "§8 ■ §7Gain §a+15% §7chance to gain extra Powder while mining.", - "§8 ■ §7Reduce Pickaxe Ability cooldown by §a20%", - "§8 ■ §7§a10x §7chance to find Goblins while mining.", - "§8 ■ §7Gain §a5x §9Titanium §7drops.", - ]; - } -} - -class MiningMadness extends Node { - constructor(data) { - super(data); - this.id = "mining_madness"; - this.name = nodeNames[this.id]; - this.position = 23; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["random_event", "mining_experience", "goblin_killer"]; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - return [ - `§7Grants §a+50 §6${SYMBOLS.mining_speed} Mining Speed §7and §6${SYMBOLS.mining_fortune} Mining Fortune§7.`, - ]; - } -} - -class SeasonedMineman extends Node { - constructor(data) { - super(data); - this.id = "mining_experience"; - this.name = nodeNames[this.id]; - this.position = 24; - this.max_level = 100; - this.upgrade_type = "mithril_powder"; - this.requires = ["efficient_miner", "mining_madness"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 2.3)); - } - - perk(level) { - const val = round(5 + level * 0.1, 1); - return [`§7Increases your Mining experience gain by §a${val}%§7.`]; - } -} - -class EfficientMiner extends Node { - constructor(data) { - super(data); - this.id = "efficient_miner"; - this.name = nodeNames[this.id]; - this.position = 25; - this.max_level = 100; - this.upgrade_type = "mithril_powder"; - this.requires = ["daily_powder", "mining_experience", "experience_orbs"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 2.6)); - } - - perk(level) { - const val1 = round(10 + level * 0.4, 1); - const val2 = ceil((level + 1) / 20); - return [`§7When mining ores, you have a §a${val1}%§7 chance to mine §a${val2} §7adjacent ores.`]; - } -} - -class Orbiter extends Node { - constructor(data) { - super(data); - this.id = "experience_orbs"; - this.name = nodeNames[this.id]; - this.position = 26; - this.max_level = 80; - this.upgrade_type = "mithril_powder"; - this.requires = ["efficient_miner", "front_loaded"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(70 * nextLevel); - } - - perk(level) { - const val = round(0.2 + level * 0.01, 2); - return [`§7When mining ores, you have a §a${val}%§7 chance to get a random amount of experience orbs.`]; - } -} - -class FrontLoaded extends Node { - constructor(data) { - super(data); - this.id = "front_loaded"; - this.name = nodeNames[this.id]; - this.position = 27; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["fallen_star_bonus", "experience_orbs", "star_powder"]; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - return [ - `§7Grants §a+100 §6${SYMBOLS.mining_speed} Mining Speed §7and §6${SYMBOLS.mining_fortune} Mining Fortune §7for the first §e2,500 §7ores you mine in a day.`, - ]; - } -} - -class PrecisionMining extends Node { - constructor(data) { - super(data); - this.id = "precision_mining"; - this.name = nodeNames[this.id]; - this.position = 28; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["front_loaded"]; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - return [ - `§7When mining ore, a particle target appears on the block that increases your §6${SYMBOLS.mining_speed} Mining Speed §7by §a30% §7when aiming at it.`, - ]; - } -} - -class LuckOfTheCave extends Node { - constructor(data) { - super(data); - this.id = "random_event"; - this.name = nodeNames[this.id]; - this.position = 30; - this.max_level = 45; - this.upgrade_type = "mithril_powder"; - this.requires = ["mining_speed_boost", "mining_madness"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.07)); - } - - perk(level) { - const val = 5 + level * 1; - return [`§7Increases the chance for you to trigger rare occurrences in §2Dwarven Mines §7by §a${val}%§7.`]; - } -} - -class DailyPowder extends Node { - constructor(data) { - super(data); - this.id = "daily_powder"; - this.name = nodeNames[this.id]; - this.position = 32; - this.max_level = 100; - this.upgrade_type = "mithril_powder"; - this.requires = ["mining_fortune"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(182 + 18 * nextLevel); - } - - perk(level) { - const val = 400 + (level - 1) * 36; - return [`§7Gain §a${val} Powder §7from the first ore you mine every day. Works for all Powder types.`]; - } -} - -class Crystallized extends Node { - constructor(data) { - super(data); - this.id = "fallen_star_bonus"; - this.name = nodeNames[this.id]; - this.position = 34; - this.max_level = 30; - this.upgrade_type = "mithril_powder"; - this.requires = ["pickaxe_toss", "front_loaded"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.4)); - } - - perk(level) { - const val = 20 + (level - 1) * 6; - return [ - `§7Grants §a+${val} §6${SYMBOLS.mining_speed} Mining Speed §7and a §a${val}% §7chance to deal §a+1 §7extra damage near §5Fallen Stars§7.`, - ]; - } -} - -class MiningSpeedBoost extends Node { - constructor(data) { - super(data); - this.id = "mining_speed_boost"; - this.name = nodeNames[this.id]; - this.position = 37; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["titanium_insanium", "random_event"]; - this.nodeType = "pickaxe_ability"; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - const effect = [200, 300, 400][this.pickaxeAbilityLevel - 1]; - const duration = [15, 20, 25][this.pickaxeAbilityLevel - 1]; - const cooldown = [120, 120, 120][this.pickaxeAbilityLevel - 1]; - return [ - "§6Pickaxe Ability: Mining Speed Boost", - `§7Grants §a+${effect}% §6${SYMBOLS.mining_speed} Mining Speed §7for §a${duration}s§7.`, - `§8Cooldown: §a${cooldown}s`, - "", - "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", - "", - "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", - ]; - } -} - -class TitaniumInsanium extends Node { - constructor(data) { - super(data); - this.id = "titanium_insanium"; - this.name = nodeNames[this.id]; - this.position = 38; - this.max_level = 50; - this.upgrade_type = "mithril_powder"; - this.requires = ["mining_fortune", "mining_speed_boost"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.1)); - } - - perk(level) { - const val = round(2 + level * 0.1, 1); - return [`§7When mining Mithril Ore, you have a §a${val}%§7 chance to convert the block into Titanium Ore.`]; - } -} - -class MiningFortune extends Node { - constructor(data) { - super(data); - this.id = "mining_fortune"; - this.name = nodeNames[this.id]; - this.position = 39; - this.max_level = 50; - this.upgrade_type = "mithril_powder"; - this.requires = ["mining_speed"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3.05)); - } - - perk(level) { - const val = level * 5; - return [`§7Grants §a+${val} §6${SYMBOLS.mining_fortune} Mining Fortune§7.`]; - } -} - -class QuickForge extends Node { - constructor(data) { - super(data); - this.id = "forge_time"; - this.name = nodeNames[this.id]; - this.position = 40; - this.max_level = 20; - this.upgrade_type = "mithril_powder"; - this.requires = ["mining_fortune", "pickaxe_toss"]; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 4)); - } - - perk(level) { - let val = round(10 + 0.5 * level, 1); - if (level === this.max_level) { - val = 30; - } - return [`§7Decreases the time it takes to forge by §a${val}%§7.`]; - } -} - -class Pickobulus extends Node { - constructor(data) { - super(data); - this.id = "pickaxe_toss"; - this.name = nodeNames[this.id]; - this.position = 41; - this.max_level = 1; - this.upgrade_type = null; - this.requires = ["forge_time", "fallen_star_bonus"]; - this.nodeType = "pickaxe_ability"; - } - - get upgradeCost() { - return 0; - } - - perk(level) { - const radius = [2, 2, 3][this.pickaxeAbilityLevel - 1]; - const cooldown = [120, 110, 110][this.pickaxeAbilityLevel - 1]; - return [ - "§6Pickaxe Ability: Pickobulus", - `§7Throw your pickaxe to create an explosion on impact, mining all ores within a §a${radius}§7 block radius.`, - `§8Cooldown: §a${cooldown}s`, - "", - "§8Pickaxe Abilities apply to all of your pickaxes. You can select a Pickaxe Ability from your Heart of the Mountain.", - "", - "§8Upgrade your Pickaxe Abilities by unlocking §cPeak of the Mountain §8in this menu!", - ]; - } -} - -class MiningSpeed extends Node { - constructor(data) { - super(data); - this.id = "mining_speed"; - this.name = nodeNames[this.id]; - this.position = 46; - this.max_level = 50; - this.upgrade_type = "mithril_powder"; - this.requires = []; - } - - get upgradeCost() { - const nextLevel = this.level + 1; - return floor(Math.pow(nextLevel + 1, 3)); - } - - perk(level) { - const val = level * 20; - return [`§7Grants §a+${val} §6${SYMBOLS.mining_speed} Mining Speed§7.`]; - } -} - -/* -.####.########.########.##.....##..######. -..##.....##....##.......###...###.##....## -..##.....##....##.......####.####.##...... -..##.....##....######...##.###.##..######. -..##.....##....##.......##.....##.......## -..##.....##....##.......##.....##.##....## -.####....##....########.##.....##..######. -*/ - -class HotmItem { - get position7x9() { - return 9 * (HOTM.tiers - this.position) + 9; - } -} - -class HotmStats extends HotmItem { - constructor(data) { - super(); - this.displayName = "§5Heart of the Mountain"; - this.position = 1; - this.itemData = { - id: 397, - Damage: 3, - glowing: false, - texture_path: "/head/86f06eaa3004aeed09b3d5b45d976de584e691c0e9cade133635de93d23b9edb", - }; - this.resources = { - token_of_the_mountain: data.resources.token_of_the_mountain.available || 0, - mithril_powder: data.resources.mithril_powder.available || 0, - gemstone_powder: data.resources.gemstone_powder.available || 0, - }; - } - - get lore() { - return [ - `§7Token of the Mountain: §5${this.resources.token_of_the_mountain.toLocaleString()}`, - "", - "§7§8Use §5Token of the Mountain §8to unlock perks and abilities above!", - "", - `§9${SYMBOLS.powder} Powder`, - "§9Powders §8are dropped from mining ores in the §2Dwarven Mines §8and are used to upgrade the perks you've unlocked!", - "", - `§7Mithril Powder: §2${this.resources.mithril_powder.toLocaleString()}`, - `§7Gemstone Powder: §d${this.resources.gemstone_powder.toLocaleString()}`, - "", - "§8Increase your chance to gain extra Powder by unlocking perks, equipping the §2Mithril Golem Pet§8, and more!", - ]; - } -} - -class CrystalHollowsCrystals extends HotmItem { - constructor(data) { - super(); - this.displayName = "§5Crystal Hollows Crystals"; - this.position = 2; - this.itemData = { - id: 397, - Damage: 3, - glowing: false, - texture_path: "/head/ef7835fc9e6daf632160e9b7ff378788a408064cc75ebf9f5158e615bdd59603", - }; - this.crystals = data.crystals; - } - - get lore() { - return [ - "§8Crystals are used to forge Gems into §dPerfect §8Gems. They can be found hidden within the §5Crystal Hollows§8.", - "", - "§8Find and place the full set of §55 §8Crystals in the §5Crystal Nucleus §8to unlock §6rare loot chests§8!", - "", - "§dYour §5Crystal Nucleus", - `§8- §aJade ${this.formatCrystal("jade", this.crystals.jade_crystal?.state)}`, - `§8- §6Amber ${this.formatCrystal("amber", this.crystals.amber_crystal?.state)}`, - `§8- §5Amethyst ${this.formatCrystal("amethyst", this.crystals.amethyst_crystal?.state)}`, - `§8- §bSapphire ${this.formatCrystal("sapphire", this.crystals.sapphire_crystal?.state)}`, - `§8- §eTopaz ${this.formatCrystal("topaz", this.crystals.topaz_crystal?.state)}`, - "", - "§dYour Other Crystals", - `§8- §dJasper ${this.formatCrystal("jasper", this.crystals.jasper_crystal?.state)}`, - `§8- §cRuby ${this.formatCrystal("ruby", this.crystals.ruby_crystal?.state)}`, - ]; - } - - formatCrystal(crystal, state) { - if (!state) { - state = "NOT_FOUND"; - } - let formatted = state.split("_").join(" ").trim(); - formatted = titleCase(formatted); - - let color = "r"; - let symbol = ""; - switch (state) { - case "NOT_FOUND": - color = "c"; - symbol = "✖"; - break; - case "FOUND": - color = "e"; - symbol = "✖"; - break; - case "PLACED": - color = "a"; - symbol = "✔"; - break; - } - - // Jasper and Ruby do not have a PLACED state - if (["jasper", "ruby"].includes(crystal) && state === "FOUND") { - color = "a"; - symbol = "✔"; - } - - return `§${color}${symbol} ${formatted}`; - } -} - -class HotmReset extends HotmItem { - constructor(data) { - super(); - this.displayName = "§cReset Heart of the Mountain"; - this.position = 3; - this.itemData = { - id: 397, - Damage: 3, - glowing: false, - texture_path: "/head/6448e275313532f54c4ba21894809a23dce52af01ddd1e89fc7689481fab737e", - }; - this.last_reset = data.last_reset; - this.resources = { - token_of_the_mountain: data.resources.token_of_the_mountain.spent || 0, - mithril_powder: data.resources.mithril_powder.spent || 0, - gemstone_powder: data.resources.gemstone_powder.spent || 0, - }; - } - - get lore() { - const output = [ - "§7Resets the Perks and Abilities of your §5Heart of the Mountain§7, locking them and resetting their levels.", - "", - "§7You will be reimbursed with:", - `§8- §5${this.resources.token_of_the_mountain.toLocaleString()} Token of the Mountain`, - `§8- §2${this.resources.mithril_powder.toLocaleString()} Mithril Powder`, - `§8- §d${this.resources.gemstone_powder.toLocaleString()} Gemstone Powder`, - "", - "§7You will §akeep §7any Tiers and §cPeak of the Mountain §7that you have unlocked.", - ]; - - // cost - output.push("", "§7Cost"); - if (this.last_reset === 0) { - output.push("§aFREE §7for your first reset."); - } else { - output.push("§6100,000 Coins"); - } - - // cooldown or warning - if (Date.now() - this.last_reset > 24 * 60 * 60 * 1000) { - output.push( - "", - "§7§c§lWARNING: This is permanent.", - "§c§lYou can not go back after resetting your Heart of the Mountain!" - ); - } else { - const timeLeft = Math.abs(Date.now() - (this.last_reset + 24 * 60 * 60 * 1000)); // ms - output.push("", `§c§lYou can reset again in ${convertHMS(timeLeft / 1000, "friendlyhhmm")}`); - } - - return output; - } -} - -/* -.########.##.....##.########...#######..########..########..######. -.##........##...##..##.....##.##.....##.##.....##....##....##....## -.##.........##.##...##.....##.##.....##.##.....##....##....##...... -.######......###....########..##.....##.########.....##.....######. -.##.........##.##...##........##.....##.##...##......##..........## -.##........##...##..##........##.....##.##....##.....##....##....## -.########.##.....##.##.........#######..##.....##....##.....######. -*/ - -const nodeClasses = { - mining_speed_2: MiningSpeed2, - powder_buff: PowderBuff, - mining_fortune_2: MiningFortune2, - vein_seeker: VeinSeeker, - lonesome_miner: LonesomeMiner, - professional: Professional, - mole: Mole, - fortunate: Fortunate, - great_explorer: GreatExplorer, - maniac_miner: ManiacMiner, - goblin_killer: GoblinKiller, - special_0: PeakOfTheMountain, - star_powder: StarPowder, - daily_effect: SkyMall, - mining_madness: MiningMadness, - mining_experience: SeasonedMineman, - efficient_miner: EfficientMiner, - experience_orbs: Orbiter, - front_loaded: FrontLoaded, - precision_mining: PrecisionMining, - random_event: LuckOfTheCave, - daily_powder: DailyPowder, - fallen_star_bonus: Crystallized, - mining_speed_boost: MiningSpeedBoost, - titanium_insanium: TitaniumInsanium, - mining_fortune: MiningFortune, - forge_time: QuickForge, - pickaxe_toss: Pickobulus, - mining_speed: MiningSpeed, -}; - -const powderForMaxNodes = {}; -for (const nodeClass of Object.values(nodeClasses)) { - const node = new nodeClass({ - level: 0, - enabled: true, - nodes: [], - hotmLevelData: { - level: Object.keys(rewards.hotm).length, - }, - }); - - if (node.nodeType === "normal" && node.upgrade_type !== null) { - powderForMaxNodes[node.upgrade_type] ??= 0; - powderForMaxNodes[node.upgrade_type] += node.totalUpgradeCost; - } -} - -export const HOTM = { - tiers: Object.keys(rewards.hotm).length, - rewards: rewards, - names: nodeNames, - hotm: HotM, - nodes: nodeClasses, - items: [HotmStats, CrystalHollowsCrystals, HotmReset], - powder_for_max_nodes: powderForMaxNodes, -}; - -export const PRECURSOR_PARTS = { - ELECTRON_TRANSMITTER: "Electron Transmitter", - FTX_3070: "FTX 3070", - ROBOTRON_REFLECTOR: "Robotron Reflector", - SUPERLITE_MOTOR: "Superlite Motor", - CONTROL_SWITCH: "Control Switch", - SYNTHETIC_HEART: "Synthetic Heart", -}; From 43bd6d3b95871155d08b5708ffbbca38ddbbc0e6 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 14 Sep 2022 14:11:03 -0700 Subject: [PATCH 18/42] Update stats.ejs From 4f3e77da48f1af4d38f2770686591a29befbe840 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 14 Sep 2022 14:21:44 -0700 Subject: [PATCH 19/42] Update stats.ejs From 318ad4578a402cbca1b78b33a6952065cca42a2e Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 5 Oct 2022 12:42:31 +0200 Subject: [PATCH 20/42] refactor: delete extra files --- public/resources/featured-profiles.json | 46 ------------------------- public/resources/file-name-map.json | 19 ---------- 2 files changed, 65 deletions(-) delete mode 100644 public/resources/featured-profiles.json delete mode 100644 public/resources/file-name-map.json diff --git a/public/resources/featured-profiles.json b/public/resources/featured-profiles.json deleted file mode 100644 index 9a3a54ded4..0000000000 --- a/public/resources/featured-profiles.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "uuid": "b44d2d5272dc49c28185b2d6a158d80a", - "type": "MAINTAINER", - "message": "a dev or something idk", - "username": "LesbianCatgirl" - }, - { - "uuid": "f5667ad6b4b3434ba58f2ed2396f62f2", - "type": "MAINTAINER", - "message": "\"lazy dev\"   (ノ´・ω・)ノ ミ ┸━┸", - "username": "MartinNemi03" - }, - { "uuid": "20d6334b7f9541ebbf7f860205ebf846", "type": "MAINTAINER", "message": "bob", "username": "jjww2" }, - { - "uuid": "aad581b2f90048a785a7573d31d7b862", - "type": "MAINTAINER", - "message": "ember armor no longer on top :((", - "username": "FantasmicGalaxy" - }, - { - "uuid": "d705483c5157460dad39712e4d74dfe1", - "type": "HOST", - "message": "Last online: January 1st, 1970", - "username": "Shiiyu" - }, - { "uuid": "1915444928b64d8b8973df8044f8cdb7", "type": "CONTRIBUTOR", "message": "lea plant", "username": "LeaPhant" }, - { - "uuid": "8a3fa60d87aa4240bcdc624b90632529", - "type": "CONTRIBUTOR", - "message": "Nate: CSS Wizard", - "username": "Cookie_Wookie_7" - }, - { - "uuid": "5435b597612f4554a3c651fd1c3ee96a", - "type": "CONTRIBUTOR", - "message": "/visit dukioooo", - "username": "dukioooo" - }, - { - "uuid": "b876ec32e396476ba1158438d83c67d4", - "type": "TECHNOBLADE", - "message": "Long live the Potato King!", - "username": "Technoblade" - } -] diff --git a/public/resources/file-name-map.json b/public/resources/file-name-map.json deleted file mode 100644 index ed1419ae34..0000000000 --- a/public/resources/file-name-map.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "browser-compat-check": "browser-compat-check.5a722e1f.js", - "common": "common.c93a96c4.js", - "stats-defer": "stats-defer.0e4d269c.js", - "development-defer": "development-defer.b168e5cd.js", - "themes": "themes.c08c5ad7.js", - "local-time": "local-time.0913d9a3.js", - "rich-item": "rich-item.d16316a4.js", - "skill-component": "skill-component.186c15c4.js", - "player-stat": "player-stat.edc7475f.js", - "bonus-stats": "bonus-stats.0e5ef448.js", - "common-defer": "common-defer.3712ab8e.js", - "helper": "helper.32cc478c.js", - "query-assigned-elements": "query-assigned-elements.79237350.js", - "if-defined": "if-defined.4ae23b87.js", - "directive": "directive.272a8723.js", - "theme-list": "theme-list.4989ba47.js", - "inventory-view": "inventory-view.05395207.js" -} From e975419bf9cfe93e26186644c03b63d5283f5dee Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 5 Oct 2022 13:09:42 +0200 Subject: [PATCH 21/42] feat: update Pet Score reward --- common/constants/rewards.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/constants/rewards.js b/common/constants/rewards.js index 57c86faef0..73af3614b1 100644 --- a/common/constants/rewards.js +++ b/common/constants/rewards.js @@ -7,4 +7,7 @@ export const PET_REWARDS = { 100: { magic_find: 5 }, 130: { magic_find: 6 }, 175: { magic_find: 7 }, + 225: { magic_find: 8 }, + 275: { magic_find: 9 }, + 325: { magic_find: 10 }, }; From eacd00df030f1ac61cf59f958e7d1d795ee0dc48 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 5 Oct 2022 16:27:47 +0200 Subject: [PATCH 22/42] feat: remove Fairy Souls --- public/resources/ts/calculate-player-stats.ts | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 978228e5f1..b7fe69ed15 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -392,20 +392,6 @@ export function getPlayerStats() { } } - // Fairy souls - if (calculated.fairy_exchanges) { - const bonusStats: ItemStats = getFairyBonus(calculated.fairy_exchanges); - - for (const [name, value] of Object.entries(bonusStats)) { - if (!allowedStats.includes(name)) { - continue; - } - - stats[name].fairy_souls ??= 0; - stats[name].fairy_souls += value; - } - } - // New year cake bag { const cakeBag = items.accessory_bag.find((x) => (x as Item).tag?.ExtraAttributes?.id === "NEW_YEAR_CAKE_BAG"); @@ -510,23 +496,6 @@ function getBonusStat(level: number, key: BonusType, max: number) { return bonus; } -function getFairyBonus(fairyExchanges: number) { - const bonus: ItemStats = {}; - - bonus.speed = Math.floor(fairyExchanges / 10); - bonus.health = 0; - bonus.defense = 0; - bonus.strength = 0; - - for (let i = 0; i < fairyExchanges; i++) { - bonus.health += 3 + Math.floor(i / 2); - bonus.defense += (i + 1) % 5 == 0 ? 2 : 1; - bonus.strength += (i + 1) % 5 == 0 ? 2 : 1; - } - - return bonus; -} - function getPetData(stats, pet, calculated) { let statsMultiplier = 0, healthMultiplier = 0, From 6275ab3a3f4ca3c6ae0ebd51ef7755ab16eb6d69 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 9 Oct 2022 07:17:08 -0700 Subject: [PATCH 23/42] fix: farming hp bonus --- common/constants/bonuses.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/constants/bonuses.js b/common/constants/bonuses.js index 405b935583..075d3e9b30 100644 --- a/common/constants/bonuses.js +++ b/common/constants/bonuses.js @@ -4,9 +4,6 @@ export const STATS_BONUS = { 1: { health: 2, farming_fortune: 4 }, 15: { health: 3, farming_fortune: 4 }, 20: { health: 4, farming_fortune: 4 }, - // ! Hypixel Admins made a mistake, Farming 25 for some reason doesn't give any stats - 25: { health: 0, farming_fortune: 0 }, - 26: { health: 5, farming_fortune: 4 }, }, skill_mining: { 1: { defense: 1, mining_fortune: 4 }, From 81f052218ac8c4d8e63952216043daf70d69308b Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Mon, 10 Oct 2022 22:56:06 +0200 Subject: [PATCH 24/42] refactor: dukio's request & fixed some TS errors --- public/resources/ts/calculate-player-stats.ts | 77 +++++++++---------- public/resources/ts/globals.d.ts | 27 +++++++ 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index b7fe69ed15..5a60ba3ae0 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -1,10 +1,6 @@ import * as helper from "../../../common/helper.js"; import { STATS_BONUS } from "../../../common/constants.js"; -import { REFORGES } from "../../../src/constants/reforges.js"; -import { HARP_QUEST, FORBIDDEN_STATS } from "../../../src/constants/misc.js"; -import { MAGICAL_POWER } from "../../../src/constants/accessories.js"; -import { CUSTOM_ARMOR_ABILTIES } from "../../../src/constants/armor.js"; -import { POTION_EFFECTS } from "../../../src/constants/potions.js"; +import * as CONSTANTS from "../../../src/constants.js"; export function getPlayerStats() { const stats: PlayerStats = { @@ -55,15 +51,15 @@ export function getPlayerStats() { try { // Bestiary Level - if (calculated.bestiary?.bonus) { + if (calculated?.bestiary.bonus > 0) { stats.health.bestiary ??= 0; stats.health.bestiary += calculated.bestiary.bonus; } // Unique Pets - if (calculated.pet_score_bonus.magic_find > 0) { + if (calculated.pet_score_bonus.magic_find || 0 > 0) { stats.magic_find.pet_score ??= 0; - stats.magic_find.pet_score += calculated.pet_score_bonus.magic_find; + stats.magic_find.pet_score += calculated.pet_score_bonus.magic_find || 0; } // Jacob's Farming Shop @@ -92,38 +88,38 @@ export function getPlayerStats() { } // Heart Of The Mountain - for (const a of calculated?.hotm || []) { + for (const a of calculated.hotm) { if ( - a?.display_name == "Mining Speed I" || - a?.display_name == "Mining Speed II" || - a?.display_name == "Mining Fortune I" || - a?.display_name == "Mining Fortune II" || - a?.display_name == "Mining Madness" || - a?.display_name == "Seasoned Mineman" + a.display_name == "Mining Speed I" || + a.display_name == "Mining Speed II" || + a.display_name == "Mining Fortune I" || + a.display_name == "Mining Fortune II" || + a.display_name == "Mining Madness" || + a.display_name == "Seasoned Mineman" ) { a.level = a.tag.display.Lore[1].split(" ")[1] || 0; a.disabled = a.tag.display.Lore[a.tag.display?.Lore.length - 1].includes("ENABLED") ? false : true || false; - if (a?.display_name == "Mining Speed I" && a.disabled == false) { + if (a.display_name == "Mining Speed I" && a.disabled == false) { stats.mining_speed.heart_of_the_mountain ??= 0; stats.mining_speed.heart_of_the_mountain += a.level * 20; } - if (a?.display_name == "Mining Speed II" && a.disabled == false) { + if (a.display_name == "Mining Speed II" && a.disabled == false) { stats.mining_speed.heart_of_the_mountain ??= 0; stats.mining_speed.heart_of_the_mountain += a.level * 40; } - if (a?.display_name == "Mining Fortune I" && a.disabled == false) { + if (a.display_name == "Mining Fortune I" && a.disabled == false) { stats.mining_fortune.heart_of_the_mountain ??= 0; stats.mining_fortune.heart_of_the_mountain += a.level * 5; } - if (a?.display_name == "Mining Fortune II" && a.disabled == false) { + if (a.display_name == "Mining Fortune II" && a.disabled == false) { stats.mining_fortune.heart_of_the_mountain ??= 0; stats.mining_fortune.heart_of_the_mountain += a.level * 5; } - if (a?.display_name == "Seasoned Mineman" && a.disabled == false) { + if (a.display_name == "Seasoned Mineman" && a.disabled == false) { stats.mining_wisdom.heart_of_the_mountain ??= 0; stats.mining_wisdom.heart_of_the_mountain += 5 + a.level.split("/")[1] * 0.1 || 0; } - if (a?.display_name == "Mining Madness" && a.disabled == false) { + if (a.display_name == "Mining Madness" && a.disabled == false) { stats.mining_speed.heart_of_the_mountain ??= 0; stats.mining_speed.heart_of_the_mountain += 50; stats.mining_fortune.heart_of_the_mountain ??= 0; @@ -136,7 +132,7 @@ export function getPlayerStats() { for (const harp in calculated.harp_quest || []) { if (harp?.endsWith("_best_completion")) { stats.intelligence.harp ??= 0; - stats.intelligence.harp += HARP_QUEST[harp]; + stats.intelligence.harp += CONSTANTS.HARP_QUEST[harp]; } } @@ -144,9 +140,9 @@ export function getPlayerStats() { if (Object.keys(calculated.perks).length > 0) { for (let [name, perkData] of Object.entries(calculated.perks)) { name = name.replaceAll("permanent_", ""); - if (Object.keys(FORBIDDEN_STATS).includes(name)) { + if (Object.keys(CONSTANTS.FORBIDDEN_STATS).includes(name)) { stats[name].essence_shop ??= 0; - stats[name].essence_shop += perkData * FORBIDDEN_STATS[name]; + stats[name].essence_shop += perkData * CONSTANTS.FORBIDDEN_STATS[name]; } } } @@ -160,14 +156,14 @@ export function getPlayerStats() { if (piece.categories.includes("helmet")) helmet = piece; } - for (const armorSet of Object.keys(CUSTOM_ARMOR_ABILTIES)) { + for (const armorSet of Object.keys(CONSTANTS.CUSTOM_ARMOR_ABILTIES)) { if ( - helmet?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].helmet && - chestplate?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && - leggings?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].leggings && - boots?.tag.ExtraAttributes.id == CUSTOM_ARMOR_ABILTIES[armorSet].boots + helmet?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].helmet && + chestplate?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && + leggings?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].leggings && + boots?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].boots ) { - for (const [stat, value] of Object.entries(CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { + for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { console.log(armorSet, stat, value); stats[stat].armor ??= 0; stat.includes("_cap") ? (stats[stat].armor = value) : (stats[armor] += value); @@ -249,28 +245,29 @@ export function getPlayerStats() { const rarities = items.accessory_rarities; const player_magical_power = {}; - for (const rarity in MAGICAL_POWER) { + for (const rarity in CONSTANTS.MAGICAL_POWER) { player_magical_power[rarity] = 0; - player_magical_power[rarity] += rarities[rarity] * MAGICAL_POWER[rarity]; + player_magical_power[rarity] += rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity]; } - const mp_hegemony = rarities.hegemony ? MAGICAL_POWER[rarities.hegemony.rarity] : 0; + const mp_hegemony = rarities.hegemony ? CONSTANTS.MAGICAL_POWER[rarities.hegemony.rarity] : 0; const mp_total = Object.values(player_magical_power).reduce((a, b) => a + b) + mp_hegemony; // ? Accessory reforge - if (calculated.selected_reforge && REFORGES[calculated.selected_reforge]?.reforge) { - for (const [stat, value] of Object.entries(REFORGES[calculated.selected_reforge].reforge)) { + if (calculated.selected_reforge && CONSTANTS.REFORGES[calculated.selected_reforge]?.reforge) { + for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].reforge)) { stats[stat].reforge ??= 0; stats[stat].reforge += value * mp_total || 0; } // ? Power Bonus from Reforge - for (const [stat, value] of Object.entries(REFORGES[calculated.selected_reforge].power_bonus)) { + for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].power_bonus)) { stats[stat].reforge ??= 0; - stats[stat].reforge += value || 0; + stats[stat].reforge += value; } } } catch (error) { + console.log(error); console.error(error); } @@ -319,7 +316,7 @@ export function getPlayerStats() { } // Active accessories stats - let accessoryDuplicates = []; + const accessoryDuplicates = []; for (const item of items.accessories.filter((item) => !(item as Item).isInactive)) { if (accessoryDuplicates.includes(item.tag?.ExtraAttributes?.id)) continue; accessoryDuplicates.push(item.tag?.ExtraAttributes?.id); @@ -450,8 +447,8 @@ export function getPlayerStats() { // Potion Effects for (const effect of calculated.active_effects) { - if (!effect.effect || !POTION_EFFECTS[effect.effect][effect.level]?.bonus) continue; - for (const [stat, value] of Object.entries(POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { + if (!effect.effect || !CONSTANTS.POTION_EFFECTS[effect.effect][effect.level]?.bonus) continue; + for (const [stat, value] of Object.entries(CONSTANTS.POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { stats[stat].potion ??= 0; stats[stat].potion += value; } diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 56e682e852..16bc81548a 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -569,6 +569,25 @@ declare const calculated: SkyCryptPlayer & { amount: number; }[]; reaper_peppers_eaten: number; + bestiary: { + bonus: number; + }; + harp_quest: { + [key: string]: number; + }; + perks: { + [key: string]: number; + }; + selected_reforge: { + [key: string]: number; + }; + hotm: { + [key in HOTMNames]: { + display_name: string; + level: number; + disabled: boolean; + }; + }; }; interface SkyCryptRelativeTime { @@ -692,3 +711,11 @@ interface StatBonusType { [key in StatName]?: number; }; } + +type HOTMNames = + | "Mining Speed I" + | "Mining Speed II" + | "Mining Fortune I" + | "Mining Fortune II" + | "Mining Madness" + | "Seasoned Mineman"; From 8f0a99c4245bd1891d1f5e91907bcf3fcaa1ac66 Mon Sep 17 00:00:00 2001 From: dukio Date: Mon, 10 Oct 2022 23:47:49 +0200 Subject: [PATCH 25/42] fix constants --- common/constants.js | 5 + common/constants/accessories.js | 10 + common/constants/armor.js | 73 ++ {src => common}/constants/bestiary.js | 0 common/constants/misc.js | 23 + common/constants/potions.js | 1082 +++++++++++++++++ {src => common}/constants/reforges.js | 0 common/constants/stats.js | 1 + public/resources/ts/calculate-player-stats.ts | 5 +- src/constants.js | 3 +- src/constants/accessories.js | 11 - src/constants/armor.js | 74 -- src/constants/misc.js | 24 - src/constants/potions.js | 1082 ----------------- 14 files changed, 1197 insertions(+), 1196 deletions(-) create mode 100644 common/constants/accessories.js create mode 100644 common/constants/armor.js rename {src => common}/constants/bestiary.js (100%) create mode 100644 common/constants/misc.js rename {src => common}/constants/reforges.js (100%) delete mode 100644 src/constants/potions.js diff --git a/common/constants.js b/common/constants.js index 8d7c199836..000513dc6f 100644 --- a/common/constants.js +++ b/common/constants.js @@ -1,6 +1,11 @@ +export * from "./constants/accessories.js"; +export * from "./constants/armor.js"; +export * from "./constants/bestiary.js"; export * from "./constants/bonuses.js"; export * from "./constants/enchantments.js"; export * from "./constants/items.js"; +export * from "./constants/misc.js"; export * from "./constants/potions.js"; +export * from "./constants/reforges.js"; export * from "./constants/rewards.js"; export * from "./constants/stats.js"; diff --git a/common/constants/accessories.js b/common/constants/accessories.js new file mode 100644 index 0000000000..e612b6484d --- /dev/null +++ b/common/constants/accessories.js @@ -0,0 +1,10 @@ +export const MAGICAL_POWER = { + common: 3, + uncommon: 5, + rare: 8, + epic: 12, + legendary: 16, + mythic: 22, + special: 3, + very_special: 5, +}; diff --git a/common/constants/armor.js b/common/constants/armor.js new file mode 100644 index 0000000000..a25220621c --- /dev/null +++ b/common/constants/armor.js @@ -0,0 +1,73 @@ +export const CUSTOM_ARMOR_ABILTIES = { + SUPERIOR_DRAGON_ARMOR: { + name: "Superior Dragon Armor", + helmet: "SUPERIOR_DRAGON_HELMET", + chestplate: "SUPERIOR_DRAGON_CHESTPLATE", + leggings: "SUPERIOR_DRAGON_LEGGINGS", + boots: "SUPERIOR_DRAGON_BOOTS", + bonus: { + statsMultiplier: 0.05, + }, + }, + YOUNG_DRAGON_ARMOR: { + name: "Young Dragon Armor", + helmet: "YOUNG_DRAGON_HELMET", + chestplate: "YOUNG_DRAGON_CHESTPLATE", + leggings: "YOUNG_DRAGON_LEGGINGS", + boots: "YOUNG_DRAGON_BOOTS", + bonus: { + speed: 75, + speed_cap: 500, + }, + }, + HOLY_DRAGON_ARMOR: { + name: "Holy Dragon Armor", + helmet: "HOLY_DRAGON_HELMET", + chestplate: "HOLY_DRAGON_CHESTPLATE", + leggings: "HOLY_DRAGON_LEGGINGS", + boots: "HOLY_DRAGON_BOOTS", + bonus: { + health_regen: 200, + }, + }, + LAPIS_ARMOR: { + name: "Lapis Armor", + helmet: "LAPIS_ARMOR_HELMET", + chestplate: "LAPIS_ARMOR_CHESTPLATE", + leggings: "LAPIS_ARMOR_LEGGINGS", + boots: "LAPIS_ARMOR_BOOTS", + bonus: { + health: 60, + }, + }, + CHEAP_TUXEDO_ARMOR: { + name: "Cheap Tuxedo Armor", + helmet: "CHEAP_TUXEDO_HELMET", + chestplate: "CHEAP_TUXEDO_CHESTPLATE", + leggings: "CHEAP_TUXEDO_LEGGINGS", + boots: "CHEAP_TUXEDO_BOOTS", + bonus: { + health_cap: 75, + }, + }, + FANCY_TUXEDO_ARMOR: { + name: "Fancy Tuxedo Armor", + helmet: "FANCY_TUXEDO_HELMET", + chestplate: "FANCY_TUXEDO_CHESTPLATE", + leggings: "FANCY_TUXEDO_LEGGINGS", + boots: "FANCY_TUXEDO_BOOTS", + bonus: { + health_cap: 150, + }, + }, + ELEGANT_TUXEDO_ARMOR: { + name: "Elegant Tuxedo Armor", + helmet: "ELEGANT_TUXEDO_HELMET", + chestplate: "ELEGANT_TUXEDO_CHESTPLATE", + leggings: "ELEGANT_TUXEDO_LEGGINGS", + boots: "ELEGANT_TUXEDO_BOOTS", + bonus: { + health_cap: 250, + }, + }, +}; diff --git a/src/constants/bestiary.js b/common/constants/bestiary.js similarity index 100% rename from src/constants/bestiary.js rename to common/constants/bestiary.js diff --git a/common/constants/misc.js b/common/constants/misc.js new file mode 100644 index 0000000000..4f648e8b39 --- /dev/null +++ b/common/constants/misc.js @@ -0,0 +1,23 @@ +export const HARP_QUEST = { + song_hymn_joy_best_completion: 1, + song_frere_jacques_best_completion: 1, + song_amazing_grace_best_completion: 1, + song_brahms_best_completion: 2, + song_happy_birthday_best_completion: 2, + song_greensleeves_best_completion: 2, + song_jeopardy_best_completion: 3, + song_minuet_best_completion: 3, + song_joy_world_best_completion: 3, + song_pure_imagination_best_completion: 4, + song_vie_en_rose_best_completion: 4, + song_fire_and_flames_best_completion: 1, + song_pachelbel_best_completion: 1, +}; + +export const FORBIDDEN_STATS = { + speed: 1, + intelligence: 2, + health: 2, + defense: 1, + strength: 1, +}; diff --git a/common/constants/potions.js b/common/constants/potions.js index c183067a8c..dcaddc834f 100644 --- a/common/constants/potions.js +++ b/common/constants/potions.js @@ -1,3 +1,5 @@ +import { SYMBOLS } from "./stats.js"; + export const POTION_COLORS = { 0: "375cc4", // None 1: "cb5ba9", // Regeneration @@ -16,3 +18,1083 @@ export const POTION_COLORS = { 14: "818595", // Invisibility 15: "f500f5", // Uncraftable }; + +export const POTION_EFFECTS = { + true_defense: { + 1: { + name: "True Resistance I Potion", + description: `Increases ${SYMBOLS.true_defense} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 5, + }, + }, + 2: { + name: "True Resistance II Potion", + description: `Increases ${SYMBOLS.true_defense} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 10, + }, + }, + 3: { + name: "True Resistance III Potion", + description: `Increases ${SYMBOLS.true_defense} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 15, + }, + }, + 4: { + name: "True Resistance IV Potion", + description: `Increases ${SYMBOLS.true_defense} True Defense, which reduces true damage you receive.`, + bonus: { + true_defense: 20, + }, + }, + }, + strength: { + 1: { + name: "Strength I Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 5, + }, + }, + 2: { + name: "Strength II Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 12.5, + }, + }, + 3: { + name: "Strength III Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 20, + }, + }, + 4: { + name: "Strength IV Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 30, + }, + }, + 5: { + name: "Strength V Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 40, + }, + }, + 6: { + name: "Strength VI Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 50, + }, + }, + 7: { + name: "Strength VII Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 60, + }, + }, + 8: { + name: "Strength VIII Potion", + description: `Increases ${SYMBOLS.strength} Strength.`, + bonus: { + strength: 75, + }, + }, + }, + regeneration: { + 1: { + name: "Regeneration I Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 5, + }, + }, + 2: { + name: "Regeneration II Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 10, + }, + }, + 3: { + name: "Regeneration III Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 15, + }, + }, + 4: { + name: "Regeneration IV Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 20, + }, + }, + 5: { + name: "Regeneration V Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 25, + }, + }, + 6: { + name: "Regeneration VI Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 30, + }, + }, + 7: { + name: "Regeneration VII Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 40, + }, + }, + 8: { + name: "Regeneration VIII Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 50, + }, + }, + 9: { + name: "Regeneration IX Potion", + description: `Grants ${SYMBOLS.health_regen} Health Regen.`, + bonus: { + health_regen: 63, + }, + }, + }, + enchanting_xp_boost: { + 1: { + name: "Enchanting XP Boost I Potion", + description: `Grants +5 ${SYMBOLS.enchanting_wisdom} Enchanting Wisdom.`, + bonus: { + enchanting_wisdom: 5, + }, + }, + 2: { + name: "Enchanting XP Boost II Potion", + description: `Grants +10 ${SYMBOLS.enchanting_wisdom} Enchanting Wisdom.`, + bonus: { + enchanting_wisdom: 10, + }, + }, + 3: { + name: "Enchanting XP Boost III Potion", + description: `Grants +20 ${SYMBOLS.enchanting_wisdom} Enchanting Wisdom.`, + bonus: { + enchanting_wisdom: 20, + }, + }, + }, + stun: { + 1: { + name: "Stun I Potion", + description: + "When applied to yourself, your hits have a 10% chance to stun enemies for 1s. When splashed, enemies are stunned for 1s.", + bonus: {}, + }, + 2: { + name: "Stun II Potion", + description: + "When applied to yourself, your hits have a 20% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.25s.", + bonus: {}, + }, + 3: { + name: "Stun III Potion", + description: + "When applied to yourself, your hits have a 30% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.5s.", + bonus: {}, + }, + 4: { + name: "Stun IV Potion", + description: + "When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", + bonus: {}, + }, + }, + experience: { + 1: { + name: "Experience I Potion", + description: "Gain 10% more experience orbs.", + bonus: {}, + }, + 2: { + name: "Experience II Potion", + description: "Gain 20% more experience orbs.", + bonus: {}, + }, + 3: { + name: "Experience III Potion", + description: "Gain 30% more experience orbs.", + bonus: {}, + }, + 4: { + name: "Experience IV Potion", + description: "Gain 40% more experience orbs.", + bonus: { + combat_wisdom: 10, + }, + }, + }, + rabbit: { + 1: { + name: "Rabbit I Potion", + description: `Grants Jump Boost I and +10 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 10, + }, + }, + 2: { + name: "Rabbit II Potion", + description: `Grants Jump Boost I and +20 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 20, + }, + }, + 3: { + name: "Rabbit III Potion", + description: `Grants Jump Boost II and +30 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 30, + }, + }, + 4: { + name: "Rabbit IV Potion", + description: `Grants Jump Boost II and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 40, + }, + }, + 5: { + name: "Rabbit V Potion", + description: `Grants Jump Boost III and +50 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 50, + }, + }, + 6: { + name: "Rabbit VI Potion", + description: `Grants Jump Boost III and +60 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 60, + }, + }, + }, + magic_find: { + 1: { + name: "Magic Find I Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 10, + }, + }, + 2: { + name: "Magic Find II Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 25, + }, + }, + 3: { + name: "Magic Find III Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 50, + }, + }, + 4: { + name: "Magic Find IV Potion", + description: `Increases the chanfe of finding rare items.`, + bonus: { + magic_find: 75, + }, + }, + }, + night_vision: { + 1: { + name: "Night Vision Potion", + description: `Grants greater visiblity at night.`, + bonus: {}, + }, + }, + absorption: { + 1: { + name: "Absorption I Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 2: { + name: "Absorption II Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 3: { + name: "Absorption III Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 4: { + name: "Absorption IV Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 5: { + name: "Absorption V Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 6: { + name: "Absorption VI Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 7: { + name: "Absorption VII Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + 8: { + name: "Absorption VIII Potion", + description: `Grants a boost to absorption health.`, + bonus: {}, + }, + }, + water_breathing: { + 1: { + name: "Water Breathing I Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 2: { + name: "Water Breathing II Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 3: { + name: "Water Breathing III Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 4: { + name: "Water Breathing IV Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 5: { + name: "Water Breathing V Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + 6: { + name: "Water Breathing VI Potion", + description: `Grants a chance of not taking drowning damage.`, + bonus: {}, + }, + }, + combat_xp_boost: { + 1: { + name: "Combat XP Boost I Potion", + description: `Grants +5 ${SYMBOLS.combat_wisdom} Combat Wisdom.`, + bonus: { + combat_wisdom: 5, + }, + }, + 2: { + name: "Combat XP Boost II Potion", + description: `Grants +10 ${SYMBOLS.combat_wisdom} Combat Wisdom.`, + bonus: { + combat_wisdom: 10, + }, + }, + 3: { + name: "Combat XP Boost III Potion", + description: `Grants +20 ${SYMBOLS.combat_wisdom} Combat Wisdom.`, + bonus: { + combat_wisdom: 20, + }, + }, + }, + fire_resistance: { + 1: { + name: "Fire Resistance Potion", + description: `Receive a 10% reduced damage from fire and lava.`, + bonus: {}, + }, + }, + jump_boost: { + 1: { + name: "Jump Boost I Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + 2: { + name: "Jump Boost II Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + 3: { + name: "Jump Boost III Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + 4: { + name: "Jump Boost IV Potion", + description: `Increases your jump height.`, + bonus: {}, + }, + }, + resistance: { + 1: { + name: "Resistance I Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 5, + }, + }, + 2: { + name: "Resistance II Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 10, + }, + }, + 3: { + name: "Resistance III Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 15, + }, + }, + 4: { + name: "Resistance IV Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 20, + }, + }, + 5: { + name: "Resistance V Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 30, + }, + }, + 6: { + name: "Resistance VI Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 40, + }, + }, + 7: { + name: "Resistance VII Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 50, + }, + }, + 8: { + name: "Resistance VIII Potion", + description: `Increases ${SYMBOLS.defense} Defense.`, + bonus: { + defense: 66, + }, + }, + }, + fishing_xp_boost: { + 1: { + name: "Fishing XP Boost I Potion", + description: `Grants +5 ${SYMBOLS.fishing_wisdom} Fishing Wisdom.`, + bonus: { + fishing_wisdom: 5, + }, + }, + 2: { + name: "Fishing XP Boost II Potion", + description: `Grants +10 ${SYMBOLS.fishing_wisdom} Fishing Wisdom.`, + bonus: { + fishing_wisdom: 10, + }, + }, + 3: { + name: "Fishing XP Boost III Potion", + description: `Grants +20 ${SYMBOLS.fishing_wisdom} Fishing Wisdom.`, + bonus: { + fishing_wisdom: 20, + }, + }, + }, + agility: { + 1: { + name: "Agility I Potion", + description: `Grants a ${SYMBOLS.speed} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 10, + }, + }, + 2: { + name: "Agility II Potion", + description: `Grants a ${SYMBOLS.speed} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 20, + }, + }, + 3: { + name: "Agility III Potion", + description: `Grants a ${SYMBOLS.speed} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 30, + }, + }, + 4: { + name: "Agility IV Potion", + description: `Grants a ${SYMBOLS.speed} Speed boost and increases the chance for mob attacks to miss.`, + bonus: { + speed: 40, + }, + }, + }, + archery: { + 1: { + name: "Archery I Potion", + description: `Increases bow damage by 12.5%.`, + bonus: {}, + }, + 2: { + name: "Archery II Potion", + description: `Increases bow damage by 25%.`, + bonus: {}, + }, + 3: { + name: "Archery III Potion", + description: `Increases bow damage by 50%.`, + bonus: {}, + }, + 4: { + name: "Archery IV Potion", + description: `Increases bow damage by 75%.`, + bonus: {}, + }, + }, + critical: { + 1: { + name: "Critical I Potion", + description: `Increases ${SYMBOLS.crit_chance} Crit Chance by 10% and ${SYMBOLS.crit_damage} Crit Damage by 10%.`, + bonus: { + crit_chance: 10, + crit_damage: 10, + }, + }, + 2: { + name: "Critical II Potion", + description: `Increases ${SYMBOLS.crit_chance} Crit Chance by 15% and ${SYMBOLS.crit_damage} Crit Damage by 20%.`, + bonus: { + crit_chance: 15, + crit_damage: 20, + }, + }, + 3: { + name: "Critical III Potion", + description: `Increases ${SYMBOLS.crit_chance} Crit Chance by 20% and ${SYMBOLS.crit_damage} Crit Damage by 30%.`, + bonus: { + crit_chance: 20, + crit_damage: 30, + }, + }, + 4: { + name: "Critical IV Potion", + description: `Increases ${SYMBOLS.crit_chance} Crit Chance by 25% and ${SYMBOLS.crit_damage} Crit Damage by 40%.`, + bonus: { + crit_chance: 25, + crit_damage: 40, + magic_find: 10, + }, + }, + }, + speed: { + 1: { + name: "Speed I Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 5, + }, + }, + 2: { + name: "Speed II Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 10, + }, + }, + 3: { + name: "Speed III Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 15, + }, + }, + 4: { + name: "Speed IV Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 20, + }, + }, + 5: { + name: "Speed V Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 25, + }, + }, + 6: { + name: "Speed VI Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 30, + }, + }, + 7: { + name: "Speed VII Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 35, + }, + }, + 8: { + name: "Speed VIII Potion", + description: `Grants + ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 48, + }, + }, + }, + farming_xp_boost: { + 1: { + name: "Farming XP Boost I Potion", + description: `Grants +5 ${SYMBOLS.farming_wisdom} Farming Wisdom.`, + bonus: { + farming_wisdom: 5, + }, + }, + 2: { + name: "Farming XP Boost II Potion", + description: `Grants +10 ${SYMBOLS.farming_wisdom} Farming Wisdom.`, + bonus: { + farming_wisdom: 10, + }, + }, + 3: { + name: "Farming XP Boost III Potion", + description: `Grants +20 ${SYMBOLS.farming_wisdom} Farming Wisdom.`, + bonus: { + farming_wisdom: 20, + }, + }, + }, + adrenaline: { + 1: { + name: "Adrenaline I Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 5, + }, + }, + 2: { + name: "Adrenaline II Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 10, + }, + }, + 3: { + name: "Adrenaline III Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 15, + }, + }, + 4: { + name: "Adrenaline IV Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 20, + }, + }, + 5: { + name: "Adrenaline V Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 25, + }, + }, + 6: { + name: "Adrenaline VI Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 30, + }, + }, + 7: { + name: "Adrenaline VII Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 35, + }, + }, + 8: { + name: "Adrenaline VIII Potion", + description: `Grants 300 absorption and +40 ${SYMBOLS.speed} Speed.`, + bonus: { + speed: 40, + }, + }, + }, + spelunker: { + 1: { + name: "Spelunker I Potion", + description: `Increases 5 ${SYMBOLS.mining_fortune} Mining Fortune.`, + bonus: { + mining_fortune: 5, + }, + }, + 2: { + name: "Spelunker II Potion", + description: `Increases 10 ${SYMBOLS.mining_fortune} Mining Fortune.`, + bonus: { + mining_fortune: 10, + }, + }, + 3: { + name: "Spelunker III Potion", + description: `Increases 15 ${SYMBOLS.mining_fortune} Mining Fortune.`, + bonus: { + mining_fortune: 15, + }, + }, + 4: { + name: "Spelunker IV Potion", + description: `Increases 20 ${SYMBOLS.mining_fortune} Mining Fortune.`, + bonus: { + mining_fortune: 20, + }, + }, + 5: { + name: "Spelunker V Potion", + description: `Increases 25 ${SYMBOLS.mining_fortune} Mining Fortune.`, + bonus: { + mining_fortune: 25, + }, + }, + }, + dodge: { + 1: { + name: "Dodge I Potion", + description: `Mobs attacks have a 10% chance to miss.`, + bonus: {}, + }, + 2: { + name: "Dodge II Potion", + description: `Mobs attacks have a 20% chance to miss.`, + bonus: {}, + }, + 3: { + name: "Dodge III Potion", + description: `Mobs attacks have a 30% chance to miss.`, + bonus: {}, + }, + 4: { + name: "Dodge IV Potion", + description: `Mobs attacks have a 40% chance to miss.`, + bonus: {}, + }, + }, + spirit: { + 1: { + name: "Spirit I Potion", + description: `Grants +10 ${SYMBOLS.speed} Speed and +10 ${SYMBOLS.crit_damage} Crit Damage.`, + bonus: { + speed: 10, + crit_damage: 10, + }, + }, + 2: { + name: "Spirit II Potion", + description: `Grants +20 ${SYMBOLS.speed} Speed and +20 ${SYMBOLS.crit_damage} Crit Damage.`, + bonus: { + speed: 20, + crit_damage: 20, + }, + }, + 3: { + name: "Spirit III Potion", + description: `Grants +30 ${SYMBOLS.speed} Speed and +30 ${SYMBOLS.crit_damage} Crit Damage.`, + bonus: { + speed: 30, + crit_damage: 30, + }, + }, + 4: { + name: "Spirit IV Potion", + description: `Grants +40 ${SYMBOLS.speed} Speed and +40 ${SYMBOLS.crit_damage} Crit Damage.`, + bonus: { + speed: 40, + crit_damage: 40, + }, + }, + }, + pet_luck: { + 1: { + name: "Pet Luck I Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 5, + }, + }, + 2: { + name: "Pet Luck II Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 10, + }, + }, + 3: { + name: "Pet Luck III Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 15, + }, + }, + 4: { + name: "Pet Luck IV Potion", + description: `Increases how many pets you can find and gives you better luck in crafting pets.`, + bonus: { + pet_luck: 20, + }, + }, + }, + mining_xp_boost: { + 1: { + name: "Mining XP Boost I Potion", + description: `Grants +5 ${SYMBOLS.mining_wisdom} Mining Wisdom.`, + bonus: { + mining_wisdom: 5, + }, + }, + 2: { + name: "Mining XP Boost II Potion", + description: `Grants +10 ${SYMBOLS.mining_wisdom} Mining Wisdom.`, + bonus: { + mining_wisdom: 10, + }, + }, + 3: { + name: "Mining XP Boost III Potion", + description: `Grants +20 ${SYMBOLS.mining_wisdom} Mining Wisdom.`, + bonus: { + mining_wisdom: 20, + }, + }, + }, + haste: { + 1: { + name: "Haste I Potion", + description: `Increases your mining speed by 20%.`, + bonus: {}, + }, + 2: { + name: "Haste II Potion", + description: `Increases your mining speed by 40%.`, + bonus: {}, + }, + 3: { + name: "Haste III Potion", + description: `Increases your mining speed by 60%.`, + bonus: {}, + }, + 4: { + name: "Haste IV Potion", + description: `Increases your mining speed by 80%.`, + bonus: {}, + }, + }, + burning: { + 1: { + name: "Burning I Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 5%.`, + bonus: {}, + }, + 2: { + name: "Burning II Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 10%.`, + bonus: {}, + }, + 3: { + name: "Burning III Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 15%.`, + bonus: {}, + }, + 4: { + name: "Burning IV Potion", + description: `Increases the duration of fire damage that you inflict on enemies by 20%.`, + bonus: {}, + }, + }, + mana: { + 1: { + name: "Mana I Potion", + description: `Grants 1 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + 2: { + name: "Mana II Potion", + description: `Grants 2 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + 3: { + name: "Mana III Potion", + description: `Grants 3 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + 4: { + name: "Mana IV Potion", + description: `Grants 4 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + 5: { + name: "Mana V Potion", + description: `Grants 5 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + 6: { + name: "Mana VI Potion", + description: `Grants 6 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + 7: { + name: "Mana VI Potion", + description: `Grants 7 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + 8: { + name: "Mana VII Potion", + description: `Grants 8 ${SYMBOLS.intelligence} Mana per second.`, + bonus: {}, + }, + }, + foraging_xp_boost: { + 1: { + name: "Foraging XP Boost III Potion", + description: `Grants +5 ${SYMBOLS.foraging_wisdom} Foraging Wisdom.`, + bonus: { + foraging_wisdom: 5, + }, + }, + 2: { + name: "Foraging XP Boost III Potion", + description: `Grants +10 ${SYMBOLS.foraging_wisdom} Foraging Wisdom.`, + bonus: { + foraging_wisdom: 10, + }, + }, + 3: { + name: "Foraging XP Boost III Potion", + description: `Grants +20 ${SYMBOLS.foraging_wisdom} Foraging Wisdom.`, + bonus: { + foraging_wisdom: 20, + }, + }, + }, + alchemy_xp_boost: { + 1: { + name: "Alchemy XP Boost I Potion", + description: `Grants +5 ${SYMBOLS.alchemy_wisdom} Alchemy Wisdom.`, + bonus: { + alchemy_wisdom: 5, + }, + }, + 2: { + name: "Alchemy XP Boost II Potion", + description: `Grants +10 ${SYMBOLS.alchemy_wisdom} Alchemy Wisdom.`, + bonus: { + alchemy_wisdom: 10, + }, + }, + 3: { + name: "Alchemy XP Boost III Potion", + description: `Grants +20 ${SYMBOLS.alchemy_wisdom} Alchemy Wisdom.`, + bonus: { + alchemy_wisdom: 20, + }, + }, + }, + invisibility: { + 1: { + name: "Invisibility Potion", + description: `Grants invisibility from players and mobs.`, + bonus: {}, + }, + }, + jerry_candy: { + 1: { + name: "Jerry Candy", + description: `Grants +100 ${SYMBOLS.health} Health, +20 ${SYMBOLS.strength} Strength, +2 ${SYMBOLS.ferocity} Ferocity, +100 ${SYMBOLS.intelligence} Inteligence, +3 ${SYMBOLS.magic_find} Magic Find`, + bonus: { + health: 100, + strength: 20, + ferocity: 2, + intelligence: 100, + magic_find: 3, + }, + }, + }, + GABAGOEY: { + 1: { + name: "Gabagoey Mixin", + description: `Increases your ${SYMBOLS.true_defense} True Defense by 5.`, + bonus: { + true_defense: 5, + }, + }, + }, + END_PORTAL_FUMES: { + 1: { + name: "End Portal Fumes", + description: `${SYMBOLS.soulflow} Soulflow conversions provide +30% more ${SYMBOLS.overflow_mana} Overflow.`, + bonus: {}, + }, + }, + SPIDER_EGG: { + 1: { + name: "Spider Egg Mixin", + description: `Gain 5% dodge chance!`, + bonus: {}, + }, + }, + ZOMBIE_BRAIN: { + 1: { + name: "Zombie Brain Mixin", + description: `Gain +10 ${SYMBOLS.ferocity} Ferocity!`, + bonus: { + ferocity: 10, + }, + }, + }, + WOLF_FUR: { + 1: { + name: "Wolf Fur Mixin", + Description: `Gain +7 ${SYMBOLS.magic_find} Magic Find when slaying monsters in one hit!`, + bonus: {}, + }, + }, +}; diff --git a/src/constants/reforges.js b/common/constants/reforges.js similarity index 100% rename from src/constants/reforges.js rename to common/constants/reforges.js diff --git a/common/constants/stats.js b/common/constants/stats.js index d78a828bf6..5c6436c725 100644 --- a/common/constants/stats.js +++ b/common/constants/stats.js @@ -379,6 +379,7 @@ const symbols = { dungeon_upgrade: "⚚", dye: "✿", }; + for (const stat in STATS_DATA) { symbols[stat] = STATS_DATA[stat].symbol; } diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 5a60ba3ae0..84ab0208aa 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -1,6 +1,5 @@ import * as helper from "../../../common/helper.js"; -import { STATS_BONUS } from "../../../common/constants.js"; -import * as CONSTANTS from "../../../src/constants.js"; +import * as CONSTANTS from "../../../common/constants.js"; export function getPlayerStats() { const stats: PlayerStats = { @@ -459,7 +458,7 @@ export function getPlayerStats() { function getBonusStat(level: number, key: BonusType, max: number) { const bonus: ItemStats = {}; - const objOfLevelBonuses: StatBonusType = STATS_BONUS[key]; + const objOfLevelBonuses: StatBonusType = CONSTANTS.STATS_BONUS[key]; if (!objOfLevelBonuses) { return bonus; diff --git a/src/constants.js b/src/constants.js index 33f20d9dcf..8b4d789dc3 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,7 +1,7 @@ export * from "../common/constants.js"; +export * from "./constants/accessories.js"; export * from "./constants/armor.js"; -export * from "./constants/bestiary.js"; export * from "./constants/collections.js"; export * from "./constants/dungeons.js"; export * from "./constants/forge.js"; @@ -18,4 +18,3 @@ export * from "./constants/random-emoji.js"; export * from "./constants/skills.js"; export * from "./constants/skins-animations.js"; export * from "./constants/tags.js"; -export * from "./constants/accessories.js"; diff --git a/src/constants/accessories.js b/src/constants/accessories.js index eee9681e03..6b15df969c 100644 --- a/src/constants/accessories.js +++ b/src/constants/accessories.js @@ -769,14 +769,3 @@ for (const upgrade in ACCESSORY_UPGRADES) { } export const UNIQUE_ACCESSORIES_COUNT = Object.keys(uniqueAccessories).length; - -export const MAGICAL_POWER = { - common: 3, - uncommon: 5, - rare: 8, - epic: 12, - legendary: 16, - mythic: 22, - special: 3, - very_special: 5, -}; diff --git a/src/constants/armor.js b/src/constants/armor.js index c07a2f6cf6..8343112918 100644 --- a/src/constants/armor.js +++ b/src/constants/armor.js @@ -32,77 +32,3 @@ export const SPECIAL_SETS = [ name: "Adaptive Armor", }, ]; - -export const CUSTOM_ARMOR_ABILTIES = { - SUPERIOR_DRAGON_ARMOR: { - name: "Superior Dragon Armor", - helmet: "SUPERIOR_DRAGON_HELMET", - chestplate: "SUPERIOR_DRAGON_CHESTPLATE", - leggings: "SUPERIOR_DRAGON_LEGGINGS", - boots: "SUPERIOR_DRAGON_BOOTS", - bonus: { - statsMultiplier: 0.05, - }, - }, - YOUNG_DRAGON_ARMOR: { - name: "Young Dragon Armor", - helmet: "YOUNG_DRAGON_HELMET", - chestplate: "YOUNG_DRAGON_CHESTPLATE", - leggings: "YOUNG_DRAGON_LEGGINGS", - boots: "YOUNG_DRAGON_BOOTS", - bonus: { - speed: 75, - speed_cap: 500, - }, - }, - HOLY_DRAGON_ARMOR: { - name: "Holy Dragon Armor", - helmet: "HOLY_DRAGON_HELMET", - chestplate: "HOLY_DRAGON_CHESTPLATE", - leggings: "HOLY_DRAGON_LEGGINGS", - boots: "HOLY_DRAGON_BOOTS", - bonus: { - health_regen: 200, - }, - }, - LAPIS_ARMOR: { - name: "Lapis Armor", - helmet: "LAPIS_ARMOR_HELMET", - chestplate: "LAPIS_ARMOR_CHESTPLATE", - leggings: "LAPIS_ARMOR_LEGGINGS", - boots: "LAPIS_ARMOR_BOOTS", - bonus: { - health: 60, - }, - }, - CHEAP_TUXEDO_ARMOR: { - name: "Cheap Tuxedo Armor", - helmet: "CHEAP_TUXEDO_HELMET", - chestplate: "CHEAP_TUXEDO_CHESTPLATE", - leggings: "CHEAP_TUXEDO_LEGGINGS", - boots: "CHEAP_TUXEDO_BOOTS", - bonus: { - health_cap: 75, - }, - }, - FANCY_TUXEDO_ARMOR: { - name: "Fancy Tuxedo Armor", - helmet: "FANCY_TUXEDO_HELMET", - chestplate: "FANCY_TUXEDO_CHESTPLATE", - leggings: "FANCY_TUXEDO_LEGGINGS", - boots: "FANCY_TUXEDO_BOOTS", - bonus: { - health_cap: 150, - }, - }, - ELEGANT_TUXEDO_ARMOR: { - name: "Elegant Tuxedo Armor", - helmet: "ELEGANT_TUXEDO_HELMET", - chestplate: "ELEGANT_TUXEDO_CHESTPLATE", - leggings: "ELEGANT_TUXEDO_LEGGINGS", - boots: "ELEGANT_TUXEDO_BOOTS", - bonus: { - health_cap: 250, - }, - }, -}; diff --git a/src/constants/misc.js b/src/constants/misc.js index 75e2d39252..0ed6a1673d 100644 --- a/src/constants/misc.js +++ b/src/constants/misc.js @@ -428,27 +428,3 @@ export const ESSENCE = { export const STAT_MAPPINGS = { walk_speed: "speed", }; - -export const HARP_QUEST = { - song_hymn_joy_best_completion: 1, - song_frere_jacques_best_completion: 1, - song_amazing_grace_best_completion: 1, - song_brahms_best_completion: 2, - song_happy_birthday_best_completion: 2, - song_greensleeves_best_completion: 2, - song_jeopardy_best_completion: 3, - song_minuet_best_completion: 3, - song_joy_world_best_completion: 3, - song_pure_imagination_best_completion: 4, - song_vie_en_rose_best_completion: 4, - song_fire_and_flames_best_completion: 1, - song_pachelbel_best_completion: 1, -}; - -export const FORBIDDEN_STATS = { - speed: 1, - intelligence: 2, - health: 2, - defense: 1, - strength: 1, -}; diff --git a/src/constants/potions.js b/src/constants/potions.js deleted file mode 100644 index 6d72cab9a7..0000000000 --- a/src/constants/potions.js +++ /dev/null @@ -1,1082 +0,0 @@ -import { STATS_DATA } from "../../common/constants/stats.js"; -const symbols = STATS_DATA; - -export const POTION_EFFECTS = { - true_defense: { - 1: { - name: "True Resistance I Potion", - description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, - bonus: { - true_defense: 5, - }, - }, - 2: { - name: "True Resistance II Potion", - description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, - bonus: { - true_defense: 10, - }, - }, - 3: { - name: "True Resistance III Potion", - description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, - bonus: { - true_defense: 15, - }, - }, - 4: { - name: "True Resistance IV Potion", - description: `Increases ${symbols.true_defense.symbol} True Defense, which reduces true damage you receive.`, - bonus: { - true_defense: 20, - }, - }, - }, - strength: { - 1: { - name: "Strength I Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 5, - }, - }, - 2: { - name: "Strength II Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 12.5, - }, - }, - 3: { - name: "Strength III Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 20, - }, - }, - 4: { - name: "Strength IV Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 30, - }, - }, - 5: { - name: "Strength V Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 40, - }, - }, - 6: { - name: "Strength VI Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 50, - }, - }, - 7: { - name: "Strength VII Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 60, - }, - }, - 8: { - name: "Strength VIII Potion", - description: `Increases ${symbols.strength.symbol} Strength.`, - bonus: { - strength: 75, - }, - }, - }, - regeneration: { - 1: { - name: "Regeneration I Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 5, - }, - }, - 2: { - name: "Regeneration II Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 10, - }, - }, - 3: { - name: "Regeneration III Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 15, - }, - }, - 4: { - name: "Regeneration IV Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 20, - }, - }, - 5: { - name: "Regeneration V Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 25, - }, - }, - 6: { - name: "Regeneration VI Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 30, - }, - }, - 7: { - name: "Regeneration VII Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 40, - }, - }, - 8: { - name: "Regeneration VIII Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 50, - }, - }, - 9: { - name: "Regeneration IX Potion", - description: `Grants ${symbols.health_regen} Health Regen.`, - bonus: { - health_regen: 63, - }, - }, - }, - enchanting_xp_boost: { - 1: { - name: "Enchanting XP Boost I Potion", - description: `Grants +5 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, - bonus: { - enchanting_wisdom: 5, - }, - }, - 2: { - name: "Enchanting XP Boost II Potion", - description: `Grants +10 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, - bonus: { - enchanting_wisdom: 10, - }, - }, - 3: { - name: "Enchanting XP Boost III Potion", - description: `Grants +20 ${symbols.enchanting_wisdom.symbol} Enchanting Wisdom.`, - bonus: { - enchanting_wisdom: 20, - }, - }, - }, - stun: { - 1: { - name: "Stun I Potion", - description: - "When applied to yourself, your hits have a 10% chance to stun enemies for 1s. When splashed, enemies are stunned for 1s.", - bonus: {}, - }, - 2: { - name: "Stun II Potion", - description: - "When applied to yourself, your hits have a 20% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.25s.", - bonus: {}, - }, - 3: { - name: "Stun III Potion", - description: - "When applied to yourself, your hits have a 30% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.5s.", - bonus: {}, - }, - 4: { - name: "Stun IV Potion", - description: - "When applied to yourself, your hits have a 40% chance to stun enemies for 1s. When splashed, enemies are stunned for 1.75s.", - bonus: {}, - }, - }, - experience: { - 1: { - name: "Experience I Potion", - description: "Gain 10% more experience orbs.", - bonus: {}, - }, - 2: { - name: "Experience II Potion", - description: "Gain 20% more experience orbs.", - bonus: {}, - }, - 3: { - name: "Experience III Potion", - description: "Gain 30% more experience orbs.", - bonus: {}, - }, - 4: { - name: "Experience IV Potion", - description: "Gain 40% more experience orbs.", - bonus: { - combat_wisdom: 10, - }, - }, - }, - rabbit: { - 1: { - name: "Rabbit I Potion", - description: `Grants Jump Boost I and +10 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 10, - }, - }, - 2: { - name: "Rabbit II Potion", - description: `Grants Jump Boost I and +20 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 20, - }, - }, - 3: { - name: "Rabbit III Potion", - description: `Grants Jump Boost II and +30 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 30, - }, - }, - 4: { - name: "Rabbit IV Potion", - description: `Grants Jump Boost II and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 40, - }, - }, - 5: { - name: "Rabbit V Potion", - description: `Grants Jump Boost III and +50 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 50, - }, - }, - 6: { - name: "Rabbit VI Potion", - description: `Grants Jump Boost III and +60 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 60, - }, - }, - }, - magic_find: { - 1: { - name: "Magic Find I Potion", - description: `Increases the chanfe of finding rare items.`, - bonus: { - magic_find: 10, - }, - }, - 2: { - name: "Magic Find II Potion", - description: `Increases the chanfe of finding rare items.`, - bonus: { - magic_find: 25, - }, - }, - 3: { - name: "Magic Find III Potion", - description: `Increases the chanfe of finding rare items.`, - bonus: { - magic_find: 50, - }, - }, - 4: { - name: "Magic Find IV Potion", - description: `Increases the chanfe of finding rare items.`, - bonus: { - magic_find: 75, - }, - }, - }, - night_vision: { - 1: { - name: "Night Vision Potion", - description: `Grants greater visiblity at night.`, - bonus: {}, - }, - }, - absorption: { - 1: { - name: "Absorption I Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - 2: { - name: "Absorption II Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - 3: { - name: "Absorption III Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - 4: { - name: "Absorption IV Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - 5: { - name: "Absorption V Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - 6: { - name: "Absorption VI Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - 7: { - name: "Absorption VII Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - 8: { - name: "Absorption VIII Potion", - description: `Grants a boost to absorption health.`, - bonus: {}, - }, - }, - water_breathing: { - 1: { - name: "Water Breathing I Potion", - description: `Grants a chance of not taking drowning damage.`, - bonus: {}, - }, - 2: { - name: "Water Breathing II Potion", - description: `Grants a chance of not taking drowning damage.`, - bonus: {}, - }, - 3: { - name: "Water Breathing III Potion", - description: `Grants a chance of not taking drowning damage.`, - bonus: {}, - }, - 4: { - name: "Water Breathing IV Potion", - description: `Grants a chance of not taking drowning damage.`, - bonus: {}, - }, - 5: { - name: "Water Breathing V Potion", - description: `Grants a chance of not taking drowning damage.`, - bonus: {}, - }, - 6: { - name: "Water Breathing VI Potion", - description: `Grants a chance of not taking drowning damage.`, - bonus: {}, - }, - }, - combat_xp_boost: { - 1: { - name: "Combat XP Boost I Potion", - description: `Grants +5 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, - bonus: { - combat_wisdom: 5, - }, - }, - 2: { - name: "Combat XP Boost II Potion", - description: `Grants +10 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, - bonus: { - combat_wisdom: 10, - }, - }, - 3: { - name: "Combat XP Boost III Potion", - description: `Grants +20 ${symbols.combat_wisdom.symbol} Combat Wisdom.`, - bonus: { - combat_wisdom: 20, - }, - }, - }, - fire_resistance: { - 1: { - name: "Fire Resistance Potion", - description: `Receive a 10% reduced damage from fire and lava.`, - bonus: {}, - }, - }, - jump_boost: { - 1: { - name: "Jump Boost I Potion", - description: `Increases your jump height.`, - bonus: {}, - }, - 2: { - name: "Jump Boost II Potion", - description: `Increases your jump height.`, - bonus: {}, - }, - 3: { - name: "Jump Boost III Potion", - description: `Increases your jump height.`, - bonus: {}, - }, - 4: { - name: "Jump Boost IV Potion", - description: `Increases your jump height.`, - bonus: {}, - }, - }, - resistance: { - 1: { - name: "Resistance I Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 5, - }, - }, - 2: { - name: "Resistance II Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 10, - }, - }, - 3: { - name: "Resistance III Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 15, - }, - }, - 4: { - name: "Resistance IV Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 20, - }, - }, - 5: { - name: "Resistance V Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 30, - }, - }, - 6: { - name: "Resistance VI Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 40, - }, - }, - 7: { - name: "Resistance VII Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 50, - }, - }, - 8: { - name: "Resistance VIII Potion", - description: `Increases ${symbols.defense.symbol} Defense.`, - bonus: { - defense: 66, - }, - }, - }, - fishing_xp_boost: { - 1: { - name: "Fishing XP Boost I Potion", - description: `Grants +5 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, - bonus: { - fishing_wisdom: 5, - }, - }, - 2: { - name: "Fishing XP Boost II Potion", - description: `Grants +10 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, - bonus: { - fishing_wisdom: 10, - }, - }, - 3: { - name: "Fishing XP Boost III Potion", - description: `Grants +20 ${symbols.fishing_wisdom.symbol} Fishing Wisdom.`, - bonus: { - fishing_wisdom: 20, - }, - }, - }, - agility: { - 1: { - name: "Agility I Potion", - description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, - bonus: { - speed: 10, - }, - }, - 2: { - name: "Agility II Potion", - description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, - bonus: { - speed: 20, - }, - }, - 3: { - name: "Agility III Potion", - description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, - bonus: { - speed: 30, - }, - }, - 4: { - name: "Agility IV Potion", - description: `Grants a ${symbols.speed.symbol} Speed boost and increases the chance for mob attacks to miss.`, - bonus: { - speed: 40, - }, - }, - }, - archery: { - 1: { - name: "Archery I Potion", - description: `Increases bow damage by 12.5%.`, - bonus: {}, - }, - 2: { - name: "Archery II Potion", - description: `Increases bow damage by 25%.`, - bonus: {}, - }, - 3: { - name: "Archery III Potion", - description: `Increases bow damage by 50%.`, - bonus: {}, - }, - 4: { - name: "Archery IV Potion", - description: `Increases bow damage by 75%.`, - bonus: {}, - }, - }, - critical: { - 1: { - name: "Critical I Potion", - description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 10% and ${symbols.crit_damage.symbol} Crit Damage by 10%.`, - bonus: { - crit_chance: 10, - crit_damage: 10, - }, - }, - 2: { - name: "Critical II Potion", - description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 15% and ${symbols.crit_damage.symbol} Crit Damage by 20%.`, - bonus: { - crit_chance: 15, - crit_damage: 20, - }, - }, - 3: { - name: "Critical III Potion", - description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 20% and ${symbols.crit_damage.symbol} Crit Damage by 30%.`, - bonus: { - crit_chance: 20, - crit_damage: 30, - }, - }, - 4: { - name: "Critical IV Potion", - description: `Increases ${symbols.crit_chance.symbol} Crit Chance by 25% and ${symbols.crit_damage.symbol} Crit Damage by 40%.`, - bonus: { - crit_chance: 25, - crit_damage: 40, - magic_find: 10, - }, - }, - }, - speed: { - 1: { - name: "Speed I Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 5, - }, - }, - 2: { - name: "Speed II Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 10, - }, - }, - 3: { - name: "Speed III Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 15, - }, - }, - 4: { - name: "Speed IV Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 20, - }, - }, - 5: { - name: "Speed V Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 25, - }, - }, - 6: { - name: "Speed VI Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 30, - }, - }, - 7: { - name: "Speed VII Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 35, - }, - }, - 8: { - name: "Speed VIII Potion", - description: `Grants + ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 48, - }, - }, - }, - farming_xp_boost: { - 1: { - name: "Farming XP Boost I Potion", - description: `Grants +5 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, - bonus: { - farming_wisdom: 5, - }, - }, - 2: { - name: "Farming XP Boost II Potion", - description: `Grants +10 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, - bonus: { - farming_wisdom: 10, - }, - }, - 3: { - name: "Farming XP Boost III Potion", - description: `Grants +20 ${symbols.farming_wisdom.symbol} Farming Wisdom.`, - bonus: { - farming_wisdom: 20, - }, - }, - }, - adrenaline: { - 1: { - name: "Adrenaline I Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 5, - }, - }, - 2: { - name: "Adrenaline II Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 10, - }, - }, - 3: { - name: "Adrenaline III Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 15, - }, - }, - 4: { - name: "Adrenaline IV Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 20, - }, - }, - 5: { - name: "Adrenaline V Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 25, - }, - }, - 6: { - name: "Adrenaline VI Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 30, - }, - }, - 7: { - name: "Adrenaline VII Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 35, - }, - }, - 8: { - name: "Adrenaline VIII Potion", - description: `Grants 300 absorption and +40 ${symbols.speed.symbol} Speed.`, - bonus: { - speed: 40, - }, - }, - }, - spelunker: { - 1: { - name: "Spelunker I Potion", - description: `Increases 5 ${symbols.mining_fortune.symbol} Mining Fortune.`, - bonus: { - mining_fortune: 5, - }, - }, - 2: { - name: "Spelunker II Potion", - description: `Increases 10 ${symbols.mining_fortune.symbol} Mining Fortune.`, - bonus: { - mining_fortune: 10, - }, - }, - 3: { - name: "Spelunker III Potion", - description: `Increases 15 ${symbols.mining_fortune.symbol} Mining Fortune.`, - bonus: { - mining_fortune: 15, - }, - }, - 4: { - name: "Spelunker IV Potion", - description: `Increases 20 ${symbols.mining_fortune.symbol} Mining Fortune.`, - bonus: { - mining_fortune: 20, - }, - }, - 5: { - name: "Spelunker V Potion", - description: `Increases 25 ${symbols.mining_fortune.symbol} Mining Fortune.`, - bonus: { - mining_fortune: 25, - }, - }, - }, - dodge: { - 1: { - name: "Dodge I Potion", - description: `Mobs attacks have a 10% chance to miss.`, - bonus: {}, - }, - 2: { - name: "Dodge II Potion", - description: `Mobs attacks have a 20% chance to miss.`, - bonus: {}, - }, - 3: { - name: "Dodge III Potion", - description: `Mobs attacks have a 30% chance to miss.`, - bonus: {}, - }, - 4: { - name: "Dodge IV Potion", - description: `Mobs attacks have a 40% chance to miss.`, - bonus: {}, - }, - }, - spirit: { - 1: { - name: "Spirit I Potion", - description: `Grants +10 ${symbols.speed.symbol} Speed and +10 ${symbols.crit_damage.symbol} Crit Damage.`, - bonus: { - speed: 10, - crit_damage: 10, - }, - }, - 2: { - name: "Spirit II Potion", - description: `Grants +20 ${symbols.speed.symbol} Speed and +20 ${symbols.crit_damage.symbol} Crit Damage.`, - bonus: { - speed: 20, - crit_damage: 20, - }, - }, - 3: { - name: "Spirit III Potion", - description: `Grants +30 ${symbols.speed.symbol} Speed and +30 ${symbols.crit_damage.symbol} Crit Damage.`, - bonus: { - speed: 30, - crit_damage: 30, - }, - }, - 4: { - name: "Spirit IV Potion", - description: `Grants +40 ${symbols.speed.symbol} Speed and +40 ${symbols.crit_damage.symbol} Crit Damage.`, - bonus: { - speed: 40, - crit_damage: 40, - }, - }, - }, - pet_luck: { - 1: { - name: "Pet Luck I Potion", - description: `Increases how many pets you can find and gives you better luck in crafting pets.`, - bonus: { - pet_luck: 5, - }, - }, - 2: { - name: "Pet Luck II Potion", - description: `Increases how many pets you can find and gives you better luck in crafting pets.`, - bonus: { - pet_luck: 10, - }, - }, - 3: { - name: "Pet Luck III Potion", - description: `Increases how many pets you can find and gives you better luck in crafting pets.`, - bonus: { - pet_luck: 15, - }, - }, - 4: { - name: "Pet Luck IV Potion", - description: `Increases how many pets you can find and gives you better luck in crafting pets.`, - bonus: { - pet_luck: 20, - }, - }, - }, - mining_xp_boost: { - 1: { - name: "Mining XP Boost I Potion", - description: `Grants +5 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, - bonus: { - mining_wisdom: 5, - }, - }, - 2: { - name: "Mining XP Boost II Potion", - description: `Grants +10 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, - bonus: { - mining_wisdom: 10, - }, - }, - 3: { - name: "Mining XP Boost III Potion", - description: `Grants +20 ${symbols.mining_wisdom.symbol} Mining Wisdom.`, - bonus: { - mining_wisdom: 20, - }, - }, - }, - haste: { - 1: { - name: "Haste I Potion", - description: `Increases your mining speed by 20%.`, - bonus: {}, - }, - 2: { - name: "Haste II Potion", - description: `Increases your mining speed by 40%.`, - bonus: {}, - }, - 3: { - name: "Haste III Potion", - description: `Increases your mining speed by 60%.`, - bonus: {}, - }, - 4: { - name: "Haste IV Potion", - description: `Increases your mining speed by 80%.`, - bonus: {}, - }, - }, - burning: { - 1: { - name: "Burning I Potion", - description: `Increases the duration of fire damage that you inflict on enemies by 5%.`, - bonus: {}, - }, - 2: { - name: "Burning II Potion", - description: `Increases the duration of fire damage that you inflict on enemies by 10%.`, - bonus: {}, - }, - 3: { - name: "Burning III Potion", - description: `Increases the duration of fire damage that you inflict on enemies by 15%.`, - bonus: {}, - }, - 4: { - name: "Burning IV Potion", - description: `Increases the duration of fire damage that you inflict on enemies by 20%.`, - bonus: {}, - }, - }, - mana: { - 1: { - name: "Mana I Potion", - description: `Grants 1 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - 2: { - name: "Mana II Potion", - description: `Grants 2 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - 3: { - name: "Mana III Potion", - description: `Grants 3 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - 4: { - name: "Mana IV Potion", - description: `Grants 4 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - 5: { - name: "Mana V Potion", - description: `Grants 5 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - 6: { - name: "Mana VI Potion", - description: `Grants 6 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - 7: { - name: "Mana VI Potion", - description: `Grants 7 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - 8: { - name: "Mana VII Potion", - description: `Grants 8 ${symbols.intelligence.symbol} Mana per second.`, - bonus: {}, - }, - }, - foraging_xp_boost: { - 1: { - name: "Foraging XP Boost III Potion", - description: `Grants +5 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, - bonus: { - foraging_wisdom: 5, - }, - }, - 2: { - name: "Foraging XP Boost III Potion", - description: `Grants +10 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, - bonus: { - foraging_wisdom: 10, - }, - }, - 3: { - name: "Foraging XP Boost III Potion", - description: `Grants +20 ${symbols.foraging_wisdom.symbol} Foraging Wisdom.`, - bonus: { - foraging_wisdom: 20, - }, - }, - }, - alchemy_xp_boost: { - 1: { - name: "Alchemy XP Boost I Potion", - description: `Grants +5 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, - bonus: { - alchemy_wisdom: 5, - }, - }, - 2: { - name: "Alchemy XP Boost II Potion", - description: `Grants +10 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, - bonus: { - alchemy_wisdom: 10, - }, - }, - 3: { - name: "Alchemy XP Boost III Potion", - description: `Grants +20 ${symbols.alchemy_wisdom.symbol} Alchemy Wisdom.`, - bonus: { - alchemy_wisdom: 20, - }, - }, - }, - invisibility: { - 1: { - name: "Invisibility Potion", - description: `Grants invisibility from players and mobs.`, - bonus: {}, - }, - }, - jerry_candy: { - 1: { - name: "Jerry Candy", - description: `Grants +100 ${symbols.health.symbol} Health, +20 ${symbols.strength.symbol} Strength, +2 ${symbols.ferocity.symbol} Ferocity, +100 ${symbols.intelligence.symbol} Inteligence, +3 ${symbols.magic_find.symbol} Magic Find`, - bonus: { - health: 100, - strength: 20, - ferocity: 2, - intelligence: 100, - magic_find: 3, - }, - }, - }, - GABAGOEY: { - 1: { - name: "Gabagoey Mixin", - description: `Increases your ${symbols.true_defense.symbol} True Defense by 5.`, - bonus: { - true_defense: 5, - }, - }, - }, - END_PORTAL_FUMES: { - 1: { - name: "End Portal Fumes", - description: `${symbols.soulflow.symbol} Soulflow conversions provide +30% more ${symbols.overflow_mana.symbol} Overflow.`, - bonus: {}, - }, - }, - SPIDER_EGG: { - 1: { - name: "Spider Egg Mixin", - description: `Gain 5% dodge chance!`, - bonus: {}, - }, - }, - ZOMBIE_BRAIN: { - 1: { - name: "Zombie Brain Mixin", - description: `Gain +10 ${symbols.ferocity.symbol} Ferocity!`, - bonus: { - ferocity: 10, - }, - }, - }, - WOLF_FUR: { - 1: { - name: "Wolf Fur Mixin", - Description: `Gain +7 ${symbols.magic_find.symbol} Magic Find when slaying monsters in one hit!`, - bonus: {}, - }, - }, -}; From 3478cfcbda26b44b9dd7662f77905c9cdd806cb6 Mon Sep 17 00:00:00 2001 From: dukio Date: Mon, 10 Oct 2022 23:51:49 +0200 Subject: [PATCH 26/42] Fix HOTM TS --- public/resources/ts/globals.d.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 16bc81548a..70e1377daa 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -582,12 +582,10 @@ declare const calculated: SkyCryptPlayer & { [key: string]: number; }; hotm: { - [key in HOTMNames]: { - display_name: string; - level: number; - disabled: boolean; - }; - }; + display_name: HOTMNames | string; + level: number; + disabled: boolean; + }[]; }; interface SkyCryptRelativeTime { From 647b7d4d3c0c786f07c8837405d705f8e0dc7e31 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Tue, 11 Oct 2022 08:54:38 +0200 Subject: [PATCH 27/42] fix: fixed more TS errors --- public/resources/ts/calculate-player-stats.ts | 381 +++++++++--------- public/resources/ts/globals.d.ts | 9 + 2 files changed, 197 insertions(+), 193 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 84ab0208aa..4a440dfcbd 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -40,7 +40,7 @@ export function getPlayerStats() { health_cap: { base: 0 }, }; const allowedStats = Object.keys(stats); - const temp = {}; + const temp: { [key: string]: number; } = {}; let statsMultiplier = 0, healthMultiplier = 0, defenseMultiplier = 0, @@ -48,226 +48,221 @@ export function getPlayerStats() { bonusAttackSpeedMultiplier = 0, ferocityMultiplier = 0; - try { - // Bestiary Level - if (calculated?.bestiary.bonus > 0) { - stats.health.bestiary ??= 0; - stats.health.bestiary += calculated.bestiary.bonus; - } + // Bestiary Level + if (calculated?.bestiary.bonus > 0) { + stats.health.bestiary ??= 0; + stats.health.bestiary += calculated.bestiary.bonus; + } - // Unique Pets - if (calculated.pet_score_bonus.magic_find || 0 > 0) { - stats.magic_find.pet_score ??= 0; - stats.magic_find.pet_score += calculated.pet_score_bonus.magic_find || 0; - } + // Unique Pets + if (calculated.pet_score_bonus.magic_find || 0 > 0) { + stats.magic_find.pet_score ??= 0; + stats.magic_find.pet_score += calculated.pet_score_bonus.magic_find || 0; + } - // Jacob's Farming Shop - if (calculated.farming?.perks?.double_drops > 0) { - stats.farming_fortune.jacob_double_drops ??= 0; - stats.farming_fortune.jacob_double_drops += calculated.farming.perks.double_drops * 2; - } + // Jacob's Farming Shop + if (calculated.farming?.perks?.double_drops > 0) { + stats.farming_fortune.jacob_double_drops ??= 0; + stats.farming_fortune.jacob_double_drops += calculated.farming.perks.double_drops * 2; + } - // Slayer Completion - for (const type of Object.keys(calculated.slayers) || []) { - for (const tiers of Object.keys(calculated.slayers[type]?.kills)) { - if (parseInt(tiers) <= 3) { - temp[type] ??= 0; - temp[type] += 1; - } else if (parseInt(tiers) == 5) { - // Hypixel admins forgot to add tier 5 bosses to Wisdom calculation :/ - temp[type] ??= 0; - temp[type] += 2; - } + // Slayer Completion + for (const type of Object.keys(calculated.slayers) || []) { + for (const tiers of Object.keys(calculated.slayers[type as keyof typeof calculated.slayers]?.kills) || []) { + if (parseInt(tiers) <= 3) { + temp[type] ??= 0; + temp[type] += 1; + } else if (parseInt(tiers) == 5) { + // Hypixel admins forgot to add tier 5 bosses to Wisdom calculation :/ + temp[type] ??= 0; + temp[type] += 2; } } + } - for (const type of Object.keys(temp)) { - stats.combat_wisdom.slayer ??= 0; - stats.combat_wisdom.slayer += temp[type]; - } - - // Heart Of The Mountain - for (const a of calculated.hotm) { - if ( - a.display_name == "Mining Speed I" || - a.display_name == "Mining Speed II" || - a.display_name == "Mining Fortune I" || - a.display_name == "Mining Fortune II" || - a.display_name == "Mining Madness" || - a.display_name == "Seasoned Mineman" - ) { - a.level = a.tag.display.Lore[1].split(" ")[1] || 0; - a.disabled = a.tag.display.Lore[a.tag.display?.Lore.length - 1].includes("ENABLED") ? false : true || false; - if (a.display_name == "Mining Speed I" && a.disabled == false) { - stats.mining_speed.heart_of_the_mountain ??= 0; - stats.mining_speed.heart_of_the_mountain += a.level * 20; - } - if (a.display_name == "Mining Speed II" && a.disabled == false) { - stats.mining_speed.heart_of_the_mountain ??= 0; - stats.mining_speed.heart_of_the_mountain += a.level * 40; - } - if (a.display_name == "Mining Fortune I" && a.disabled == false) { - stats.mining_fortune.heart_of_the_mountain ??= 0; - stats.mining_fortune.heart_of_the_mountain += a.level * 5; - } - if (a.display_name == "Mining Fortune II" && a.disabled == false) { - stats.mining_fortune.heart_of_the_mountain ??= 0; - stats.mining_fortune.heart_of_the_mountain += a.level * 5; - } - if (a.display_name == "Seasoned Mineman" && a.disabled == false) { - stats.mining_wisdom.heart_of_the_mountain ??= 0; - stats.mining_wisdom.heart_of_the_mountain += 5 + a.level.split("/")[1] * 0.1 || 0; - } - if (a.display_name == "Mining Madness" && a.disabled == false) { - stats.mining_speed.heart_of_the_mountain ??= 0; - stats.mining_speed.heart_of_the_mountain += 50; - stats.mining_fortune.heart_of_the_mountain ??= 0; - stats.mining_fortune.heart_of_the_mountain += 50; - } + for (const type of Object.keys(temp)) { + stats.combat_wisdom.slayer ??= 0; + stats.combat_wisdom.slayer += temp[type]; + } + + // Heart Of The Mountain + for (const a of calculated.hotm) { + if ( + a.display_name == "Mining Speed I" || + a.display_name == "Mining Speed II" || + a.display_name == "Mining Fortune I" || + a.display_name == "Mining Fortune II" || + a.display_name == "Mining Madness" || + a.display_name == "Seasoned Mineman" + ) { + a.level = a.tag.display.Lore[1].split(" ")[1] || 0; + a.disabled = a.tag.display.Lore[a.tag.display?.Lore.length - 1].includes("ENABLED") ? false : true || false; + if (a.display_name == "Mining Speed I" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain ??= 0; + stats.mining_speed.heart_of_the_mountain += a.level * 20; + } + if (a.display_name == "Mining Speed II" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain ??= 0; + stats.mining_speed.heart_of_the_mountain += a.level * 40; + } + if (a.display_name == "Mining Fortune I" && a.disabled == false) { + stats.mining_fortune.heart_of_the_mountain ??= 0; + stats.mining_fortune.heart_of_the_mountain += a.level * 5; + } + if (a.display_name == "Mining Fortune II" && a.disabled == false) { + stats.mining_fortune.heart_of_the_mountain ??= 0; + stats.mining_fortune.heart_of_the_mountain += a.level * 5; + } + if (a.display_name == "Seasoned Mineman" && a.disabled == false) { + stats.mining_wisdom.heart_of_the_mountain ??= 0; + stats.mining_wisdom.heart_of_the_mountain += 5 + parseInt(a.level.toString().split("/")[1]) * 0.1 || 0; + } + if (a.display_name == "Mining Madness" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain ??= 0; + stats.mining_speed.heart_of_the_mountain += 50; + stats.mining_fortune.heart_of_the_mountain ??= 0; + stats.mining_fortune.heart_of_the_mountain += 50; } } + } - // Harp Quest - for (const harp in calculated.harp_quest || []) { - if (harp?.endsWith("_best_completion")) { - stats.intelligence.harp ??= 0; - stats.intelligence.harp += CONSTANTS.HARP_QUEST[harp]; - } + // Harp Quest + for (const harp in calculated.harp_quest || []) { + if (harp?.endsWith("_best_completion")) { + stats.intelligence.harp ??= 0; + stats.intelligence.harp += CONSTANTS.HARP_QUEST[harp]; } + } - // Dungeon Essence Shop - if (Object.keys(calculated.perks).length > 0) { - for (let [name, perkData] of Object.entries(calculated.perks)) { - name = name.replaceAll("permanent_", ""); - if (Object.keys(CONSTANTS.FORBIDDEN_STATS).includes(name)) { - stats[name].essence_shop ??= 0; - stats[name].essence_shop += perkData * CONSTANTS.FORBIDDEN_STATS[name]; - } + // Dungeon Essence Shop + if (Object.keys(calculated.perks).length > 0) { + for (let [name, perkData] of Object.entries(calculated.perks)) { + name = name.replaceAll("permanent_", ""); + if (Object.keys(CONSTANTS.FORBIDDEN_STATS).includes(name)) { + stats[name].essence_shop ??= 0; + stats[name].essence_shop += perkData * CONSTANTS.FORBIDDEN_STATS[name]; } } + } - // Armor Abiltiies - let boots, leggings, chestplate, helmet; - for (const piece of items.armor) { - if (piece.categories.includes("boots")) boots = piece; - if (piece.categories.includes("leggings")) leggings = piece; - if (piece.categories.includes("chestplate")) chestplate = piece; - if (piece.categories.includes("helmet")) helmet = piece; - } - - for (const armorSet of Object.keys(CONSTANTS.CUSTOM_ARMOR_ABILTIES)) { - if ( - helmet?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].helmet && - chestplate?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && - leggings?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].leggings && - boots?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].boots - ) { - for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { - console.log(armorSet, stat, value); - stats[stat].armor ??= 0; - stat.includes("_cap") ? (stats[stat].armor = value) : (stats[armor] += value); - } + // Armor Abiltiies + let boots, leggings, chestplate, helmet; + for (const piece of items.armor) { + if (piece.categories.includes("boots")) boots = piece; + if (piece.categories.includes("leggings")) leggings = piece; + if (piece.categories.includes("chestplate")) chestplate = piece; + if (piece.categories.includes("helmet")) helmet = piece; + } + + for (const armorSet of Object.keys(CONSTANTS.CUSTOM_ARMOR_ABILTIES)) { + if ( + helmet?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].helmet && + chestplate?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && + leggings?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].leggings && + boots?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].boots + ) { + for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { + console.log(armorSet, stat, value); + stats[stat].armor ??= 0; + stat.includes("_cap") ? (stats[stat].armor = value as keyof typeof value) : (stats[stat].armor += value as keyof typeof value); } + } - // TODO: Make Special Abilities work with format above - // ? Mastiff Armor - if ( - helmet?.tag.ExtraAttributes.id == "MASTIFF_HELMET" && - chestplate?.tag.ExtraAttributes.id == "MASTIFF_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "MASTIFF_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "MASTIFF_BOOTS" - ) { - stats.health.armor += (stats.crit_damage || 0) * 50; - stats.crit_damage.armor = stats["crit_damage"] / 2; - } + // TODO: Make Special Abilities work with format above + // ? Mastiff Armor + if ( + helmet?.tag.ExtraAttributes.id == "MASTIFF_HELMET" && + chestplate?.tag.ExtraAttributes.id == "MASTIFF_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "MASTIFF_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "MASTIFF_BOOTS" + ) { + stats.health.armor += stats.crit_damage * 50; + stats.crit_damage.armor = stats["crit_damage"] / 2; + } - // ? Obsidian Chestplate - /* - if (chestplate?.tag.ExtraAttributes.id == 'OBSIDIAN_CHESTPLATE') { - stats.speed.armor += itemCount.OBSIDIAN.armor / 20 ? (itemCount.OBSIDIAN.armor / 20).toFixed(0) : 0; - } - */ - - // ? Glacite Armor - if ( - helmet?.tag.ExtraAttributes.id == "GLACITE_HELMET" && - chestplate?.tag.ExtraAttributes.id == "GLACITE_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "GLACITE_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "GLACITE_BOOTS" - ) { - stats.mining_speed.armor += calculated.levels.mining.level * 2; - } + // ? Obsidian Chestplate + /* + if (chestplate?.tag.ExtraAttributes.id == 'OBSIDIAN_CHESTPLATE') { + stats.speed.armor += itemCount.OBSIDIAN.armor / 20 ? (itemCount.OBSIDIAN.armor / 20).toFixed(0) : 0; + } + */ - // ? Fairy Armor - if ( - helmet?.tag.ExtraAttributes.id == "FAIRY_HELMET" && - chestplate?.tag.ExtraAttributes.id == "FAIRY_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "FAIRY_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "FAIRY_BOOTS" - ) { - stats.health.armor += calculated.fairy_souls.collected || 0; - } + // ? Glacite Armor + if ( + helmet?.tag.ExtraAttributes.id == "GLACITE_HELMET" && + chestplate?.tag.ExtraAttributes.id == "GLACITE_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "GLACITE_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "GLACITE_BOOTS" + ) { + stats.mining_speed.armor += calculated.levels.mining.level * 2; + } - // ? Emerald Armor - if ( - helmet?.tag.ExtraAttributes.id == "EMERALD_ARMOR_HELMET" && - chestplate?.tag.ExtraAttributes.id == "EMERALD_ARMOR_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "EMERALD_ARMOR_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "EMERALD_ARMOR_BOOTS" - ) { - const amount = calculated.collections.EMERALD.amount || 0; - stats.health.armor ??= 0; - stats.health.armor += (amount / 3000).toFixed(0) > 350 ? 350 : (amount / 3000).toFixed(0); - stats.defense.armor ??= 0; - stats.defense.armor += (amount / 3000).toFixed(0) > 350 ? 350 : (amount / 3000).toFixed(0); - } + // ? Fairy Armor + if ( + helmet?.tag.ExtraAttributes.id == "FAIRY_HELMET" && + chestplate?.tag.ExtraAttributes.id == "FAIRY_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "FAIRY_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "FAIRY_BOOTS" + ) { + stats.health.armor += calculated.fairy_souls.collected || 0; } - // Custom pet abilities - const petStats = getPetData( - stats, - calculated.pets.find((a) => a.active), - calculated - ); + // ? Emerald Armor + if ( + helmet?.tag.ExtraAttributes.id == "EMERALD_ARMOR_HELMET" && + chestplate?.tag.ExtraAttributes.id == "EMERALD_ARMOR_CHESTPLATE" && + leggings?.tag.ExtraAttributes.id == "EMERALD_ARMOR_LEGGINGS" && + boots?.tag.ExtraAttributes.id == "EMERALD_ARMOR_BOOTS" + ) { + const amount: number = calculated.collections.EMERALD.amount; + stats.health.armor ??= 0; + stats.health.armor += parseInt((amount / 3000).toFixed(0)) > 350 ? 350 : parseInt((amount / 3000).toFixed(0)); + stats.defense.armor ??= 0; + stats.defense.armor += parseInt((amount / 3000).toFixed(0)) > 350 ? 350 : parseInt((amount / 3000).toFixed(0)); + } + } - Object.assign(stats, petStats.stats); + // Custom pet abilities + const petStats = getPetData( + stats, + calculated.pets.find((a) => a.active), + calculated + ); - statsMultiplier += petStats.statsMultiplier || 0; - bonusAttackSpeedMultiplier += petStats.bonusAttackSpeedMultiplier || 0; - ferocityMultiplier += petStats.ferocityMultiplier || 0; - defenseMultiplier += petStats.defenseMultiplier || 0; - healthMultiplier += petStats.healthMultiplier || 0; - strengthMultiplier += petStats.strengthMultiplier || 0; - statsMultiplier += petStats.statsMultiplier || 0; + Object.assign(stats, petStats.stats); - // Reforge - const rarities = items.accessory_rarities; - const player_magical_power = {}; + statsMultiplier += petStats.statsMultiplier || 0; + bonusAttackSpeedMultiplier += petStats.bonusAttackSpeedMultiplier || 0; + ferocityMultiplier += petStats.ferocityMultiplier || 0; + defenseMultiplier += petStats.defenseMultiplier || 0; + healthMultiplier += petStats.healthMultiplier || 0; + strengthMultiplier += petStats.strengthMultiplier || 0; + statsMultiplier += petStats.statsMultiplier || 0; - for (const rarity in CONSTANTS.MAGICAL_POWER) { - player_magical_power[rarity] = 0; - player_magical_power[rarity] += rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity]; - } + // Reforge + const rarities = items.accessory_rarities; + const playerMagicalPower: { [key: string]: number; } = {}; - const mp_hegemony = rarities.hegemony ? CONSTANTS.MAGICAL_POWER[rarities.hegemony.rarity] : 0; - const mp_total = Object.values(player_magical_power).reduce((a, b) => a + b) + mp_hegemony; + for (const rarity in CONSTANTS.MAGICAL_POWER) { + playerMagicalPower[rarity] = 0; + playerMagicalPower[rarity] += rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity]; + } - // ? Accessory reforge - if (calculated.selected_reforge && CONSTANTS.REFORGES[calculated.selected_reforge]?.reforge) { - for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].reforge)) { - stats[stat].reforge ??= 0; - stats[stat].reforge += value * mp_total || 0; - } + const mpHegemony: number = rarities.hegemony ? CONSTANTS.MAGICAL_POWER[rarities.hegemony.rarity] : 0; + const mpTotal: number = Object.values(playerMagicalPower).reduce((a, b) => a + b) + mpHegemony; - // ? Power Bonus from Reforge - for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].power_bonus)) { - stats[stat].reforge ??= 0; - stats[stat].reforge += value; - } + // ? Accessory reforge + if (calculated.selected_reforge && CONSTANTS.REFORGES[calculated.selected_reforge]?.reforge) { + for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].reforge)) { + stats[stat].reforge ??= 0; + stats[stat].reforge += value as number * mpTotal; + } + + // ? Power Bonus from Reforge + for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].power_bonus)) { + stats[stat].reforge ??= 0; + stats[stat].reforge += value as number; } - } catch (error) { - console.log(error); - console.error(error); } // Active armor stats @@ -315,7 +310,7 @@ export function getPlayerStats() { } // Active accessories stats - const accessoryDuplicates = []; + const accessoryDuplicates: string[] = []; for (const item of items.accessories.filter((item) => !(item as Item).isInactive)) { if (accessoryDuplicates.includes(item.tag?.ExtraAttributes?.id)) continue; accessoryDuplicates.push(item.tag?.ExtraAttributes?.id); diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 70e1377daa..915fdca27d 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -85,6 +85,8 @@ interface DisplayItem { } interface ItemSlot { + tag?: any; + categories: string[]; itemId: string; item_index: number; } @@ -101,6 +103,7 @@ interface Item extends DisplayItem, ItemSlot { tag: ItemTag; texture_pack?: Pack; isInactive?: boolean; + hegemony?: boolean; } interface ItemTag { @@ -164,6 +167,7 @@ interface Level { declare namespace constants { const MAX_FAVORITES: number; + const HARP_QUEST: string; } declare const calculated: SkyCryptPlayer & { @@ -582,10 +586,15 @@ declare const calculated: SkyCryptPlayer & { [key: string]: number; }; hotm: { + tag: unknown; display_name: HOTMNames | string; level: number; disabled: boolean; }[]; + active_effects: { + effect: string; + level: number; + }[]; }; interface SkyCryptRelativeTime { From d8b923d36a9cb11b2cbe5801eb948a9f48bf4101 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Tue, 11 Oct 2022 08:57:10 +0200 Subject: [PATCH 28/42] `npm run prettier:fix` --- public/resources/ts/calculate-player-stats.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 4a440dfcbd..4e72337a2f 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -40,7 +40,7 @@ export function getPlayerStats() { health_cap: { base: 0 }, }; const allowedStats = Object.keys(stats); - const temp: { [key: string]: number; } = {}; + const temp: { [key: string]: number } = {}; let statsMultiplier = 0, healthMultiplier = 0, defenseMultiplier = 0, @@ -164,7 +164,9 @@ export function getPlayerStats() { for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { console.log(armorSet, stat, value); stats[stat].armor ??= 0; - stat.includes("_cap") ? (stats[stat].armor = value as keyof typeof value) : (stats[stat].armor += value as keyof typeof value); + stat.includes("_cap") + ? (stats[stat].armor = value as keyof typeof value) + : (stats[stat].armor += value as keyof typeof value); } } @@ -241,7 +243,7 @@ export function getPlayerStats() { // Reforge const rarities = items.accessory_rarities; - const playerMagicalPower: { [key: string]: number; } = {}; + const playerMagicalPower: { [key: string]: number } = {}; for (const rarity in CONSTANTS.MAGICAL_POWER) { playerMagicalPower[rarity] = 0; @@ -255,7 +257,7 @@ export function getPlayerStats() { if (calculated.selected_reforge && CONSTANTS.REFORGES[calculated.selected_reforge]?.reforge) { for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].reforge)) { stats[stat].reforge ??= 0; - stats[stat].reforge += value as number * mpTotal; + stats[stat].reforge += (value as number) * mpTotal; } // ? Power Bonus from Reforge From 3bc3443465696a8096f95561f4de030c4f1cb62f Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Tue, 11 Oct 2022 09:00:50 +0200 Subject: [PATCH 29/42] fix: hotm TS error --- public/resources/ts/globals.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 915fdca27d..a3bf5da107 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -85,7 +85,6 @@ interface DisplayItem { } interface ItemSlot { - tag?: any; categories: string[]; itemId: string; item_index: number; @@ -586,7 +585,7 @@ declare const calculated: SkyCryptPlayer & { [key: string]: number; }; hotm: { - tag: unknown; + tag: any; display_name: HOTMNames | string; level: number; disabled: boolean; From d92069bd8eec440f46519bb9d9f611a35d6d1501 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Mon, 17 Oct 2022 20:37:52 +0200 Subject: [PATCH 30/42] fix: fix more TS errors --- public/resources/ts/calculate-player-stats.ts | 57 +++++++++---------- public/resources/ts/globals.d.ts | 27 ++++++++- 2 files changed, 52 insertions(+), 32 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 4e72337a2f..db0791e39d 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -146,23 +146,22 @@ export function getPlayerStats() { } // Armor Abiltiies - let boots, leggings, chestplate, helmet; + let boots: Item | undefined, leggings: Item | undefined, chestplate: Item | undefined, helmet: Item | undefined; for (const piece of items.armor) { - if (piece.categories.includes("boots")) boots = piece; - if (piece.categories.includes("leggings")) leggings = piece; - if (piece.categories.includes("chestplate")) chestplate = piece; - if (piece.categories.includes("helmet")) helmet = piece; + if (piece.categories.includes("boots")) boots = piece as Item; + if (piece.categories.includes("leggings")) leggings = piece as Item; + if (piece.categories.includes("chestplate")) chestplate = piece as Item; + if (piece.categories.includes("helmet")) helmet = piece as Item; } for (const armorSet of Object.keys(CONSTANTS.CUSTOM_ARMOR_ABILTIES)) { if ( - helmet?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].helmet && - chestplate?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && - leggings?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].leggings && - boots?.tag.ExtraAttributes.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].boots + helmet?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].helmet && + chestplate?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && + leggings?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].leggings && + boots?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].boots ) { for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { - console.log(armorSet, stat, value); stats[stat].armor ??= 0; stat.includes("_cap") ? (stats[stat].armor = value as keyof typeof value) @@ -173,48 +172,48 @@ export function getPlayerStats() { // TODO: Make Special Abilities work with format above // ? Mastiff Armor if ( - helmet?.tag.ExtraAttributes.id == "MASTIFF_HELMET" && - chestplate?.tag.ExtraAttributes.id == "MASTIFF_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "MASTIFF_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "MASTIFF_BOOTS" + helmet?.tag?.ExtraAttributes?.id == "MASTIFF_HELMET" && + chestplate?.tag?.ExtraAttributes?.id == "MASTIFF_CHESTPLATE" && + leggings?.tag?.ExtraAttributes?.id == "MASTIFF_LEGGINGS" && + boots?.tag?.ExtraAttributes?.id == "MASTIFF_BOOTS" ) { - stats.health.armor += stats.crit_damage * 50; - stats.crit_damage.armor = stats["crit_damage"] / 2; + stats.health.armor = stats.health.armor + stats.crit_damage * 50; + stats.crit_damage.armor = stats.crit_damage / 2; } // ? Obsidian Chestplate /* - if (chestplate?.tag.ExtraAttributes.id == 'OBSIDIAN_CHESTPLATE') { + if (chestplate?.tag?.ExtraAttributes?.id == 'OBSIDIAN_CHESTPLATE') { stats.speed.armor += itemCount.OBSIDIAN.armor / 20 ? (itemCount.OBSIDIAN.armor / 20).toFixed(0) : 0; } */ // ? Glacite Armor if ( - helmet?.tag.ExtraAttributes.id == "GLACITE_HELMET" && - chestplate?.tag.ExtraAttributes.id == "GLACITE_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "GLACITE_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "GLACITE_BOOTS" + helmet?.tag?.ExtraAttributes?.id == "GLACITE_HELMET" && + chestplate?.tag?.ExtraAttributes?.id == "GLACITE_CHESTPLATE" && + leggings?.tag?.ExtraAttributes?.id == "GLACITE_LEGGINGS" && + boots?.tag?.ExtraAttributes?.id == "GLACITE_BOOTS" ) { stats.mining_speed.armor += calculated.levels.mining.level * 2; } // ? Fairy Armor if ( - helmet?.tag.ExtraAttributes.id == "FAIRY_HELMET" && - chestplate?.tag.ExtraAttributes.id == "FAIRY_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "FAIRY_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "FAIRY_BOOTS" + helmet?.tag?.ExtraAttributes?.id == "FAIRY_HELMET" && + chestplate?.tag?.ExtraAttributes?.id == "FAIRY_CHESTPLATE" && + leggings?.tag?.ExtraAttributes?.id == "FAIRY_LEGGINGS" && + boots?.tag?.ExtraAttributes?.id == "FAIRY_BOOTS" ) { stats.health.armor += calculated.fairy_souls.collected || 0; } // ? Emerald Armor if ( - helmet?.tag.ExtraAttributes.id == "EMERALD_ARMOR_HELMET" && - chestplate?.tag.ExtraAttributes.id == "EMERALD_ARMOR_CHESTPLATE" && - leggings?.tag.ExtraAttributes.id == "EMERALD_ARMOR_LEGGINGS" && - boots?.tag.ExtraAttributes.id == "EMERALD_ARMOR_BOOTS" + helmet?.tag?.ExtraAttributes?.id == "EMERALD_ARMOR_HELMET" && + chestplate?.tag?.ExtraAttributes?.id == "EMERALD_ARMOR_CHESTPLATE" && + leggings?.tag?.ExtraAttributes?.id == "EMERALD_ARMOR_LEGGINGS" && + boots?.tag?.ExtraAttributes?.id == "EMERALD_ARMOR_BOOTS" ) { const amount: number = calculated.collections.EMERALD.amount; stats.health.armor ??= 0; diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index a3bf5da107..97e25cc427 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -72,7 +72,23 @@ type StatName = | "mining_fortune" | "farming_fortune" | "foraging_fortune" - | "pristine"; + | "pristine" + | "fishing_speed" + | "health_regen" + | "vitality" + | "mending" + | "combat_wisdom" + | "mining_wisdom" + | "farming_wisdom" + | "foraging_wisdom" + | "fishing_wisdom" + | "enchanting_wisdom" + | "alchemy_wisdom" + | "carpentry_wisdom" + | "runecrafting_wisdom" + | "social_wisdom" + | "speed_cap" + | "health_cap"; interface DisplayItem { display_name: string; @@ -102,7 +118,9 @@ interface Item extends DisplayItem, ItemSlot { tag: ItemTag; texture_pack?: Pack; isInactive?: boolean; - hegemony?: boolean; + hegemony?: { + [key: string]: string; + }; } interface ItemTag { @@ -582,7 +600,10 @@ declare const calculated: SkyCryptPlayer & { [key: string]: number; }; selected_reforge: { - [key: string]: number; + power_bonus: { + [key: string]: number; + } + refoge: string; }; hotm: { tag: any; From 38da953288b3ee89fd145a340ecd3d08b7704f9d Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sat, 22 Oct 2022 21:41:41 +0200 Subject: [PATCH 31/42] fix: es-lint & prettier error --- common/constants.js | 1 - public/resources/ts/globals.d.ts | 2 +- src/constants.js | 1 + {common => src}/constants/bestiary.js | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename {common => src}/constants/bestiary.js (100%) diff --git a/common/constants.js b/common/constants.js index 000513dc6f..07d4fe26eb 100644 --- a/common/constants.js +++ b/common/constants.js @@ -1,6 +1,5 @@ export * from "./constants/accessories.js"; export * from "./constants/armor.js"; -export * from "./constants/bestiary.js"; export * from "./constants/bonuses.js"; export * from "./constants/enchantments.js"; export * from "./constants/items.js"; diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 97e25cc427..b01c5b2f53 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -602,7 +602,7 @@ declare const calculated: SkyCryptPlayer & { selected_reforge: { power_bonus: { [key: string]: number; - } + }; refoge: string; }; hotm: { diff --git a/src/constants.js b/src/constants.js index 8b4d789dc3..a23ae8ea69 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,7 @@ export * from "../common/constants.js"; export * from "./constants/accessories.js"; +export * from "./constants/bestiary.js"; export * from "./constants/armor.js"; export * from "./constants/collections.js"; export * from "./constants/dungeons.js"; diff --git a/common/constants/bestiary.js b/src/constants/bestiary.js similarity index 100% rename from common/constants/bestiary.js rename to src/constants/bestiary.js From 6cbfc76d64ba3f3a9b4685a0c53001900fb03332 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 23 Oct 2022 14:01:14 +0200 Subject: [PATCH 32/42] fix: eslint error --- src/constants.js | 1 - src/constants/accessories.js | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/src/constants.js b/src/constants.js index 9e6a90ad04..a23ae8ea69 100644 --- a/src/constants.js +++ b/src/constants.js @@ -3,7 +3,6 @@ export * from "../common/constants.js"; export * from "./constants/accessories.js"; export * from "./constants/bestiary.js"; export * from "./constants/armor.js"; -export * from "./constants/bestiary.js"; export * from "./constants/collections.js"; export * from "./constants/dungeons.js"; export * from "./constants/forge.js"; diff --git a/src/constants/accessories.js b/src/constants/accessories.js index 9fe8a60e3f..e7e520a714 100644 --- a/src/constants/accessories.js +++ b/src/constants/accessories.js @@ -796,17 +796,6 @@ for (const upgrade in ACCESSORY_UPGRADES) { export const UNIQUE_ACCESSORIES_COUNT = Object.keys(uniqueAccessories).length; -export const MAGICAL_POWER = { - common: 3, - uncommon: 5, - rare: 8, - epic: 12, - legendary: 16, - mythic: 22, - special: 3, - very_special: 5, -}; - const recombableAccessories = uniqueAccessories; for (const accessory of Object.keys(recombableAccessories)) { From 2ce66d5b7823b62da148d0032a22ee0066b3bd0a Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 23 Oct 2022 15:11:12 +0200 Subject: [PATCH 33/42] fix: more TS errors --- public/resources/ts/calculate-player-stats.ts | 26 ++++++++++--------- public/resources/ts/globals.d.ts | 1 - 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 3df0db24f4..0d3fa0aff9 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -130,7 +130,7 @@ export function getPlayerStats() { for (const harp in calculated.harp_quest || []) { if (harp?.endsWith("_best_completion")) { stats.intelligence.harp ??= 0; - stats.intelligence.harp += CONSTANTS.HARP_QUEST[harp]; + stats.intelligence.harp += CONSTANTS.HARP_QUEST[harp as keyof typeof CONSTANTS.HARP_QUEST]; } } @@ -140,7 +140,7 @@ export function getPlayerStats() { name = name.replaceAll("permanent_", ""); if (Object.keys(CONSTANTS.FORBIDDEN_STATS).includes(name)) { stats[name].essence_shop ??= 0; - stats[name].essence_shop += perkData * CONSTANTS.FORBIDDEN_STATS[name]; + stats[name].essence_shop += perkData * CONSTANTS.FORBIDDEN_STATS[name as keyof typeof CONSTANTS.FORBIDDEN_STATS]; } } } @@ -156,12 +156,12 @@ export function getPlayerStats() { for (const armorSet of Object.keys(CONSTANTS.CUSTOM_ARMOR_ABILTIES)) { if ( - helmet?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].helmet && - chestplate?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].chestplate && - leggings?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].leggings && - boots?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].boots + helmet?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].helmet && + chestplate?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].chestplate && + leggings?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].leggings && + boots?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].boots ) { - for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet].bonus)) { + for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].bonus)) { stats[stat].armor ??= 0; stat.includes("_cap") ? (stats[stat].armor = value as keyof typeof value) @@ -246,7 +246,7 @@ export function getPlayerStats() { for (const rarity in CONSTANTS.MAGICAL_POWER) { playerMagicalPower[rarity] = 0; - playerMagicalPower[rarity] += rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity]; + playerMagicalPower[rarity] += rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity as keyof typeof CONSTANTS.MAGICAL_POWER]; } const mpHegemony: number = rarities.hegemony ? CONSTANTS.MAGICAL_POWER[rarities.hegemony.rarity] : 0; @@ -445,8 +445,8 @@ export function getPlayerStats() { if (!effect.effect || !CONSTANTS.POTION_EFFECTS[effect.effect][effect.level]?.bonus) continue; for (const [stat, value] of Object.entries(CONSTANTS.POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { stats[stat].potion ??= 0; - stats[stat].potion += value; - } + stats[stat].potion += value as number; + } } return stats; @@ -488,7 +488,7 @@ function getBonusStat(level: number, key: BonusType, max: number) { return bonus; } -function getPetData(stats, pet, calculated) { +function getPetData(stats: PlayerStats, pet: Pet, calculated: PlayerStats) { let statsMultiplier = 0, healthMultiplier = 0, defenseMultiplier = 0, @@ -564,7 +564,9 @@ function getPetData(stats, pet, calculated) { if (pet.type == "BABY_YETI") { if (pet.tier == "EPIC") { stats.defense.pet ??= 0; - stats.defense.pet += stats.strength / (0.5 * pet.level.level); + // add stats.defense.pet += stats.defense / (0.5 * pet.level.level) with typescript checks + stats.defense.pet += stats.defense / (0.5 * pet.level.level); + } if (pet.tier == "LEGENDARY") { stats.defense.pet ??= 0; diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index b01c5b2f53..369c445ca2 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -184,7 +184,6 @@ interface Level { declare namespace constants { const MAX_FAVORITES: number; - const HARP_QUEST: string; } declare const calculated: SkyCryptPlayer & { From c7c03d8836a720a603d1998918988ab62a1da1a3 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 23 Oct 2022 15:16:42 +0200 Subject: [PATCH 34/42] oops --- public/resources/ts/calculate-player-stats.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 0d3fa0aff9..b9bfba303c 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -564,9 +564,7 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: PlayerStats) { if (pet.type == "BABY_YETI") { if (pet.tier == "EPIC") { stats.defense.pet ??= 0; - // add stats.defense.pet += stats.defense / (0.5 * pet.level.level) with typescript checks stats.defense.pet += stats.defense / (0.5 * pet.level.level); - } if (pet.tier == "LEGENDARY") { stats.defense.pet ??= 0; From 7b3576b2c79dae9ec04ec87469048713e3c69cf0 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 6 Nov 2022 19:06:57 +0100 Subject: [PATCH 35/42] fix: fix more TS warnings --- public/resources/ts/calculate-player-stats.ts | 29 ++++++++++--------- public/resources/ts/globals.d.ts | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index b9bfba303c..49a9acc948 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -163,9 +163,12 @@ export function getPlayerStats() { ) { for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].bonus)) { stats[stat].armor ??= 0; - stat.includes("_cap") - ? (stats[stat].armor = value as keyof typeof value) - : (stats[stat].armor += value as keyof typeof value); + if (stat.includes("_cap")) { + stats[stat].armor = value; + } else { + stats[stat].armor += value; + } + } } @@ -177,8 +180,8 @@ export function getPlayerStats() { leggings?.tag?.ExtraAttributes?.id == "MASTIFF_LEGGINGS" && boots?.tag?.ExtraAttributes?.id == "MASTIFF_BOOTS" ) { - stats.health.armor = stats.health.armor + stats.crit_damage * 50; - stats.crit_damage.armor = stats.crit_damage / 2; + stats.health.armor = Object.keys(stats.crit_damage).map((key) => stats.crit_damage[key]).reduce((a, b) => a + b, 0) * 50; + stats.crit_damage.armor = Object.keys(stats.crit_damage).map((key) => stats.crit_damage[key]).reduce((a, b) => a + b, 0) / 2; } // ? Obsidian Chestplate @@ -253,8 +256,8 @@ export function getPlayerStats() { const mpTotal: number = Object.values(playerMagicalPower).reduce((a, b) => a + b) + mpHegemony; // ? Accessory reforge - if (calculated.selected_reforge && CONSTANTS.REFORGES[calculated.selected_reforge]?.reforge) { - for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].reforge)) { + if (calculated.selected_reforge && CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES]) { + for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES])) { stats[stat].reforge ??= 0; stats[stat].reforge += (value as number) * mpTotal; } @@ -544,20 +547,20 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: PlayerStats) { if (pet.tier == "RARE") { stats.defense.pet ??= 0; stats.health.pet ??= 0; - stats.defense.pet += (stats.speed / 100) * 0.15 * pet.level.level; - stats.health.pet += (stats.defense / 10) * 0.01 * pet.level.level; + stats.defense.pet += (Object.keys(stats.speed).map((key) => stats.speed[key]).reduce((a, b) => a + b, 0) / 100) * 0.15 * pet.level.level; + stats.health.pet += (Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0) / 10) * 0.01 * pet.level.level; } if (pet.tier == "EPIC") { stats.defense.pet ??= 0; stats.health.pet ??= 0; - stats.defense.pet += (stats.speed / 100) * 0.2 * pet.level.level; - stats.health.pet += (stats.defense / 10) * 0.01 * pet.level.level; + stats.defense.pet += (Object.keys(stats.speed).map((key) => stats.speed[key]).reduce((a, b) => a + b, 0) / 100) * 0.2 * pet.level.level; + stats.health.pet += (Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0) / 10) * 0.01 * pet.level.level; } if (pet.tier == "LEGENDARY") { stats.defense.pet ??= 0; stats.health.pet ??= 0; - stats.defense.pet += (stats.speed / 100) * 0.2 * pet.level.level; - stats.health.pet += (stats.defense / 10) * 0.01 * pet.level.level; + stats.defense.pet += (Object.keys(stats.speed).map((key) => stats.speed[key]).reduce((a, b) => a + b, 0) / 100) * 0.2 * pet.level.level; + stats.health.pet += (Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0) / 10) * 0.01 * pet.level.level; } } diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 369c445ca2..ab9ce58118 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -602,7 +602,7 @@ declare const calculated: SkyCryptPlayer & { power_bonus: { [key: string]: number; }; - refoge: string; + reforge: string; }; hotm: { tag: any; From 30af2e1d9fa8783228a65c4433f9b518ce9f3a03 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 6 Nov 2022 20:08:43 +0100 Subject: [PATCH 36/42] style: `npm run prettier:fix` --- public/resources/ts/calculate-player-stats.ts | 92 +++++++++++++++---- 1 file changed, 73 insertions(+), 19 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 49a9acc948..e1a66caced 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -140,7 +140,8 @@ export function getPlayerStats() { name = name.replaceAll("permanent_", ""); if (Object.keys(CONSTANTS.FORBIDDEN_STATS).includes(name)) { stats[name].essence_shop ??= 0; - stats[name].essence_shop += perkData * CONSTANTS.FORBIDDEN_STATS[name as keyof typeof CONSTANTS.FORBIDDEN_STATS]; + stats[name].essence_shop += + perkData * CONSTANTS.FORBIDDEN_STATS[name as keyof typeof CONSTANTS.FORBIDDEN_STATS]; } } } @@ -156,19 +157,24 @@ export function getPlayerStats() { for (const armorSet of Object.keys(CONSTANTS.CUSTOM_ARMOR_ABILTIES)) { if ( - helmet?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].helmet && - chestplate?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].chestplate && - leggings?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].leggings && - boots?.tag?.ExtraAttributes?.id == CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].boots + helmet?.tag?.ExtraAttributes?.id == + CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].helmet && + chestplate?.tag?.ExtraAttributes?.id == + CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].chestplate && + leggings?.tag?.ExtraAttributes?.id == + CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].leggings && + boots?.tag?.ExtraAttributes?.id == + CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].boots ) { - for (const [stat, value] of Object.entries(CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].bonus)) { + for (const [stat, value] of Object.entries( + CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].bonus + )) { stats[stat].armor ??= 0; if (stat.includes("_cap")) { stats[stat].armor = value; } else { stats[stat].armor += value; } - } } @@ -180,8 +186,14 @@ export function getPlayerStats() { leggings?.tag?.ExtraAttributes?.id == "MASTIFF_LEGGINGS" && boots?.tag?.ExtraAttributes?.id == "MASTIFF_BOOTS" ) { - stats.health.armor = Object.keys(stats.crit_damage).map((key) => stats.crit_damage[key]).reduce((a, b) => a + b, 0) * 50; - stats.crit_damage.armor = Object.keys(stats.crit_damage).map((key) => stats.crit_damage[key]).reduce((a, b) => a + b, 0) / 2; + stats.health.armor = + Object.keys(stats.crit_damage) + .map((key) => stats.crit_damage[key]) + .reduce((a, b) => a + b, 0) * 50; + stats.crit_damage.armor = + Object.keys(stats.crit_damage) + .map((key) => stats.crit_damage[key]) + .reduce((a, b) => a + b, 0) / 2; } // ? Obsidian Chestplate @@ -249,15 +261,21 @@ export function getPlayerStats() { for (const rarity in CONSTANTS.MAGICAL_POWER) { playerMagicalPower[rarity] = 0; - playerMagicalPower[rarity] += rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity as keyof typeof CONSTANTS.MAGICAL_POWER]; + playerMagicalPower[rarity] += + rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity as keyof typeof CONSTANTS.MAGICAL_POWER]; } const mpHegemony: number = rarities.hegemony ? CONSTANTS.MAGICAL_POWER[rarities.hegemony.rarity] : 0; const mpTotal: number = Object.values(playerMagicalPower).reduce((a, b) => a + b) + mpHegemony; // ? Accessory reforge - if (calculated.selected_reforge && CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES]) { - for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES])) { + if ( + calculated.selected_reforge && + CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES] + ) { + for (const [stat, value] of Object.entries( + CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES] + )) { stats[stat].reforge ??= 0; stats[stat].reforge += (value as number) * mpTotal; } @@ -449,7 +467,7 @@ export function getPlayerStats() { for (const [stat, value] of Object.entries(CONSTANTS.POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { stats[stat].potion ??= 0; stats[stat].potion += value as number; - } + } } return stats; @@ -547,20 +565,56 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: PlayerStats) { if (pet.tier == "RARE") { stats.defense.pet ??= 0; stats.health.pet ??= 0; - stats.defense.pet += (Object.keys(stats.speed).map((key) => stats.speed[key]).reduce((a, b) => a + b, 0) / 100) * 0.15 * pet.level.level; - stats.health.pet += (Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0) / 10) * 0.01 * pet.level.level; + stats.defense.pet += + (Object.keys(stats.speed) + .map((key) => stats.speed[key]) + .reduce((a, b) => a + b, 0) / + 100) * + 0.15 * + pet.level.level; + stats.health.pet += + (Object.keys(stats.defense) + .map((key) => stats.defense[key]) + .reduce((a, b) => a + b, 0) / + 10) * + 0.01 * + pet.level.level; } if (pet.tier == "EPIC") { stats.defense.pet ??= 0; stats.health.pet ??= 0; - stats.defense.pet += (Object.keys(stats.speed).map((key) => stats.speed[key]).reduce((a, b) => a + b, 0) / 100) * 0.2 * pet.level.level; - stats.health.pet += (Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0) / 10) * 0.01 * pet.level.level; + stats.defense.pet += + (Object.keys(stats.speed) + .map((key) => stats.speed[key]) + .reduce((a, b) => a + b, 0) / + 100) * + 0.2 * + pet.level.level; + stats.health.pet += + (Object.keys(stats.defense) + .map((key) => stats.defense[key]) + .reduce((a, b) => a + b, 0) / + 10) * + 0.01 * + pet.level.level; } if (pet.tier == "LEGENDARY") { stats.defense.pet ??= 0; stats.health.pet ??= 0; - stats.defense.pet += (Object.keys(stats.speed).map((key) => stats.speed[key]).reduce((a, b) => a + b, 0) / 100) * 0.2 * pet.level.level; - stats.health.pet += (Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0) / 10) * 0.01 * pet.level.level; + stats.defense.pet += + (Object.keys(stats.speed) + .map((key) => stats.speed[key]) + .reduce((a, b) => a + b, 0) / + 100) * + 0.2 * + pet.level.level; + stats.health.pet += + (Object.keys(stats.defense) + .map((key) => stats.defense[key]) + .reduce((a, b) => a + b, 0) / + 10) * + 0.01 * + pet.level.level; } } From c63a0d4132e3ae0b5be1596d1230934dbcd6952f Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 1 Jan 2023 17:32:43 +0100 Subject: [PATCH 37/42] fix: typescript errors --- common/constants/reforges.js | 6 +- public/resources/ts/calculate-player-stats.ts | 116 +++++++++++------- public/resources/ts/globals.d.ts | 40 +++--- 3 files changed, 90 insertions(+), 72 deletions(-) diff --git a/common/constants/reforges.js b/common/constants/reforges.js index a7a28ec28f..250efc5a7b 100644 --- a/common/constants/reforges.js +++ b/common/constants/reforges.js @@ -1,6 +1,6 @@ export const REFORGES = { - lucky: { - prefix: "Lucky", + fortuitous: { + prefix: "Fortuitous", name: null, reforge: { crit_chance: 42 / 250, @@ -8,7 +8,7 @@ export const REFORGES = { health: 32 / 250, defense: 12 / 250, strength: 46 / 250, - }, + } }, warrior: { prefix: "Warrior", diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index e1a66caced..1b940c4a1a 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -95,7 +95,7 @@ export function getPlayerStats() { a.display_name == "Mining Madness" || a.display_name == "Seasoned Mineman" ) { - a.level = a.tag.display.Lore[1].split(" ")[1] || 0; + a.level = parseInt(a.tag.display.Lore[1].split(" ")[1]); a.disabled = a.tag.display.Lore[a.tag.display?.Lore.length - 1].includes("ENABLED") ? false : true || false; if (a.display_name == "Mining Speed I" && a.disabled == false) { stats.mining_speed.heart_of_the_mountain ??= 0; @@ -239,9 +239,10 @@ export function getPlayerStats() { } // Custom pet abilities + const activePet = calculated.pets.find((a) => a.active === true) as Pet; const petStats = getPetData( stats, - calculated.pets.find((a) => a.active), + activePet, calculated ); @@ -256,34 +257,30 @@ export function getPlayerStats() { statsMultiplier += petStats.statsMultiplier || 0; // Reforge - const rarities = items.accessory_rarities; const playerMagicalPower: { [key: string]: number } = {}; - for (const rarity in CONSTANTS.MAGICAL_POWER) { - playerMagicalPower[rarity] = 0; - playerMagicalPower[rarity] += - rarities[rarity] * CONSTANTS.MAGICAL_POWER[rarity as keyof typeof CONSTANTS.MAGICAL_POWER]; + for (const rarity of Object.keys(CONSTANTS.MAGICAL_POWER)) { + const rarityNumber: number = parseInt(rarity); + playerMagicalPower[rarityNumber] = 0; + playerMagicalPower[rarityNumber] += (CONSTANTS.MAGICAL_POWER as any)[rarity] * CONSTANTS.MAGICAL_POWER[rarity as keyof typeof CONSTANTS.MAGICAL_POWER]; } - const mpHegemony: number = rarities.hegemony ? CONSTANTS.MAGICAL_POWER[rarities.hegemony.rarity] : 0; - const mpTotal: number = Object.values(playerMagicalPower).reduce((a, b) => a + b) + mpHegemony; + const mpTotal: number = Object.values(playerMagicalPower).reduce((a, b) => a + b); // ? Accessory reforge - if ( - calculated.selected_reforge && - CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES] - ) { - for (const [stat, value] of Object.entries( - CONSTANTS.REFORGES[calculated.selected_reforge.reforge as keyof typeof CONSTANTS.REFORGES] - )) { + if (calculated.selected_reforge && Object.keys(CONSTANTS.REFORGES).find((a) => a === calculated.selected_reforge.toString())) { + for (const [stat, value] of Object.entries((CONSTANTS as any).REFORGES[calculated.selected_reforge]?.reforge || {})) { + const valueInt: number = parseFloat(value as string); stats[stat].reforge ??= 0; - stats[stat].reforge += (value as number) * mpTotal; - } + stats[stat].reforge += valueInt * mpTotal; + } // ? Power Bonus from Reforge - for (const [stat, value] of Object.entries(CONSTANTS.REFORGES[calculated.selected_reforge].power_bonus)) { - stats[stat].reforge ??= 0; - stats[stat].reforge += value as number; + if ((CONSTANTS as any).REFORGES[calculated.selected_reforge].power_bonus !== undefined) { + for (const [stat, value] of Object.entries((CONSTANTS as any).REFORGES[calculated.selected_reforge].power_bonus)) { + stats[stat].reforge ??= 0; + stats[stat].reforge += value as number; + } } } @@ -333,9 +330,10 @@ export function getPlayerStats() { // Active accessories stats const accessoryDuplicates: string[] = []; - for (const item of items.accessories.filter((item) => !(item as Item).isInactive)) { - if (accessoryDuplicates.includes(item.tag?.ExtraAttributes?.id)) continue; - accessoryDuplicates.push(item.tag?.ExtraAttributes?.id); + for (const item of items.accessories.filter((item) => (item as Item).isInactive === false)) { + const itemData: Item = item as Item; + if (accessoryDuplicates.includes(itemData.tag?.ExtraAttributes?.id || "")) continue; + accessoryDuplicates.push(itemData.tag?.ExtraAttributes?.id || ""); const bonusStats: ItemStats = helper.getStatsFromItem(item as Item); @@ -347,8 +345,8 @@ export function getPlayerStats() { stats[name].accessories ??= 0; stats[name].accessories += value; - if (item.tag?.ExtraAttributes?.id == "NIGHT_CRYSTAL" || item.tag?.ExtraAttributes?.id == "DAY_CRYSTAL") { - accessoryDuplicates.push(item.tag?.ExtraAttributes?.id); + if (itemData.tag?.ExtraAttributes?.id == "NIGHT_CRYSTAL" || itemData.tag?.ExtraAttributes?.id == "DAY_CRYSTAL") { + accessoryDuplicates.push(itemData.tag?.ExtraAttributes?.id); stats.health.accessories += 5; stats.strength.accessories += 5; } @@ -356,7 +354,7 @@ export function getPlayerStats() { } // Skill bonus stats - for (const [skill, data] of Object.entries(calculated.levels)) { + for (const [skill, data] of Object.entries(calculated.levels as Level)) { const bonusStats: ItemStats = getBonusStat(data.level, `skill_${skill}` as BonusType, data.maxLevel); for (const [name, value] of Object.entries(bonusStats)) { @@ -434,24 +432,47 @@ export function getPlayerStats() { stats.health.reaper_peppers = calculated.reaper_peppers_eaten; } - stats.health ??= 0; - stats.ferocity ??= 0; - stats.defense ??= 0; - stats.strength ??= 0; - stats.bonus_attack_speed ??= 0; - stats.health = healthMultiplier > 0 ? stats.health + stats.health * healthMultiplier : stats.health; - stats.ferocity = ferocityMultiplier > 0 ? stats.ferocity + stats.ferocity * ferocityMultiplier : stats.ferocity; - stats.defense = defenseMultiplier > 0 ? stats.defense + stats.defense * defenseMultiplier : stats.defense; - stats.strength = strengthMultiplier > 0 ? stats.strength + stats.strength * strengthMultiplier : stats.strength; - stats.bonus_attack_speed = - bonusAttackSpeedMultiplier > 0 - ? stats.bonus_attack_speed + stats.bonus_attack_speed * bonusAttackSpeedMultiplier - : stats.bonus_attack_speed; + + if (healthMultiplier > 0) { + stats.health.stats_multiplier ??= 0; + const totalHealth = Object.keys(stats.health).map((key) => stats.health[key as keyof ItemStats["health"]] ?? 0).reduce((a, b) => a + b, 0); + stats.health.stats_multiplier = healthMultiplier > 0 ? totalHealth + totalHealth * healthMultiplier : 0; + } + + if (ferocityMultiplier > 0) { + stats.ferocity.stats_multiplier ??= 0; + const totalFerocity = Object.keys(stats.ferocity).map((key) => stats.ferocity[key as keyof ItemStats["ferocity"]] ?? 0).reduce((a, b) => a + b, 0); + stats.ferocity.stats_multiplier = ferocityMultiplier > 0 ? totalFerocity + totalFerocity * ferocityMultiplier : 0; + } + + if (defenseMultiplier > 0) { + stats.defense.stats_multiplier ??= 0; + const totalDefense = Object.keys(stats.defense).map((key) => stats.defense[key as keyof ItemStats["defense"]] ?? 0).reduce((a, b) => a + b, 0); + stats.defense.stats_multiplier = defenseMultiplier > 0 ? totalDefense + totalDefense * defenseMultiplier : 0; + } + + if (strengthMultiplier > 0) { + stats.strength.stats_multiplier ??= 0; + const totalStrength = Object.keys(stats.strength).map((key) => stats.strength[key as keyof ItemStats["strength"]] ?? 0).reduce((a, b) => a + b, 0); + stats.strength.stats_multiplier = strengthMultiplier > 0 ? totalStrength + totalStrength * strengthMultiplier : 0; + } + + if (bonusAttackSpeedMultiplier > 0) { + stats.bonus_attack_speed.stats_multiplier ??= 0; + const totalBonusAttackSpeed = Object.keys(stats.bonus_attack_speed).map((key) => stats.bonus_attack_speed[key as keyof ItemStats["bonus_attack_speed"]] ?? 0).reduce((a, b) => a + b, 0); + stats.bonus_attack_speed.stats_multiplier = + bonusAttackSpeedMultiplier > 0 + ? totalBonusAttackSpeed + totalBonusAttackSpeed * bonusAttackSpeedMultiplier + : 0; + } if (statsMultiplier > 0) { for (const stat of Object.keys(stats)) { if (stat.includes("fortune" || stat == "pristine" || stat == "effective_health")) continue; - stats.stat += stats.stat * statsMultiplier; + + stats[stat as keyof ItemStats].stat ??= 0; + const totalStat = Object.keys(stats[stat as keyof ItemStats]).map((key) => stats[stat as keyof ItemStats][key] ?? 0).reduce((a, b) => a + b, 0); + stats[stat as keyof ItemStats].stat += totalStat * statsMultiplier; } } @@ -463,8 +484,8 @@ export function getPlayerStats() { // Potion Effects for (const effect of calculated.active_effects) { - if (!effect.effect || !CONSTANTS.POTION_EFFECTS[effect.effect][effect.level]?.bonus) continue; - for (const [stat, value] of Object.entries(CONSTANTS.POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { + if (effect.effect === undefined || (CONSTANTS as any).POTION_EFFECTS[effect.effect as string][effect.level as number]?.bonus === undefined) continue; + for (const [stat, value] of Object.entries((CONSTANTS as any).POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { stats[stat].potion ??= 0; stats[stat].potion += value as number; } @@ -509,7 +530,7 @@ function getBonusStat(level: number, key: BonusType, max: number) { return bonus; } -function getPetData(stats: PlayerStats, pet: Pet, calculated: PlayerStats) { +function getPetData(stats: PlayerStats, pet: Pet, calculated: SkyCryptPlayer) { let statsMultiplier = 0, healthMultiplier = 0, defenseMultiplier = 0, @@ -619,13 +640,14 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: PlayerStats) { } if (pet.type == "BABY_YETI") { + const totalDefense = Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0); if (pet.tier == "EPIC") { stats.defense.pet ??= 0; - stats.defense.pet += stats.defense / (0.5 * pet.level.level); + stats.defense.pet += totalDefense / (0.5 * pet.level.level); } if (pet.tier == "LEGENDARY") { stats.defense.pet ??= 0; - stats.defense.pet += stats.strength / (0.75 * pet.level.level); + stats.defense.pet += totalDefense / (0.75 * pet.level.level); } } @@ -760,7 +782,7 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: PlayerStats) { if (pet.type == "AMMONITE") { if (pet.tier == "LEGENDARY") { stats.sea_creature_chance.pet ??= 0; - stats.sea_creature_chance.pet += calculated.hotm[0].display_name.split(" ")[1]; + calculated.hotm[0].display_name.split(" ")[1] } } diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index ab9ce58118..37f848bec6 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -119,8 +119,8 @@ interface Item extends DisplayItem, ItemSlot { texture_pack?: Pack; isInactive?: boolean; hegemony?: { - [key: string]: string; - }; + rarity: string; + } } interface ItemTag { @@ -135,7 +135,7 @@ interface ItemTag { } interface ItemTagExtraAttributes { - [key: string]: unknown; + [key: string]: string; } interface ItemTagSkullOwner { @@ -426,7 +426,9 @@ declare const calculated: SkyCryptPlayer & { [key: string]: number; }; levels: { - [key: string]: Level; + [key: string]: { + level: number + } | Level; }; members: SkyCryptPlayer[]; mining: { @@ -598,18 +600,17 @@ declare const calculated: SkyCryptPlayer & { perks: { [key: string]: number; }; - selected_reforge: { - power_bonus: { - [key: string]: number; - }; - reforge: string; - }; + selected_reforge: number; hotm: { - tag: any; - display_name: HOTMNames | string; level: number; + tag: { + display: { + Lore: string; + } + }; + display_name: string; disabled: boolean; - }[]; + }[], active_effects: { effect: string; level: number; @@ -622,6 +623,8 @@ interface SkyCryptRelativeTime { } interface SkyCryptPlayer { + hotm: any; + levels: any; display_name: string; display_emoji?: string; skin_data: { @@ -641,6 +644,7 @@ interface PetBase extends DisplayItem { interface Pet extends PetBase { active: boolean; + type: string; candyUsed: number; exp: number; heldItem: string | null; @@ -736,12 +740,4 @@ interface StatBonusType { [key: string]: { [key in StatName]?: number; }; -} - -type HOTMNames = - | "Mining Speed I" - | "Mining Speed II" - | "Mining Fortune I" - | "Mining Fortune II" - | "Mining Madness" - | "Seasoned Mineman"; +} \ No newline at end of file From 8f1a69b880808ef9a5202e06b83ea595ff8692d4 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 1 Jan 2023 17:35:24 +0100 Subject: [PATCH 38/42] style: `npm run prettier:fix` --- common/constants/reforges.js | 2 +- public/resources/ts/calculate-player-stats.ts | 73 ++++++++++++------- public/resources/ts/globals.d.ts | 16 ++-- 3 files changed, 57 insertions(+), 34 deletions(-) diff --git a/common/constants/reforges.js b/common/constants/reforges.js index 250efc5a7b..16fbf6807c 100644 --- a/common/constants/reforges.js +++ b/common/constants/reforges.js @@ -8,7 +8,7 @@ export const REFORGES = { health: 32 / 250, defense: 12 / 250, strength: 46 / 250, - } + }, }, warrior: { prefix: "Warrior", diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 1b940c4a1a..b115fe2466 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -240,11 +240,7 @@ export function getPlayerStats() { // Custom pet abilities const activePet = calculated.pets.find((a) => a.active === true) as Pet; - const petStats = getPetData( - stats, - activePet, - calculated - ); + const petStats = getPetData(stats, activePet, calculated); Object.assign(stats, petStats.stats); @@ -262,22 +258,31 @@ export function getPlayerStats() { for (const rarity of Object.keys(CONSTANTS.MAGICAL_POWER)) { const rarityNumber: number = parseInt(rarity); playerMagicalPower[rarityNumber] = 0; - playerMagicalPower[rarityNumber] += (CONSTANTS.MAGICAL_POWER as any)[rarity] * CONSTANTS.MAGICAL_POWER[rarity as keyof typeof CONSTANTS.MAGICAL_POWER]; + playerMagicalPower[rarityNumber] += + (CONSTANTS.MAGICAL_POWER as any)[rarity] * + CONSTANTS.MAGICAL_POWER[rarity as keyof typeof CONSTANTS.MAGICAL_POWER]; } const mpTotal: number = Object.values(playerMagicalPower).reduce((a, b) => a + b); // ? Accessory reforge - if (calculated.selected_reforge && Object.keys(CONSTANTS.REFORGES).find((a) => a === calculated.selected_reforge.toString())) { - for (const [stat, value] of Object.entries((CONSTANTS as any).REFORGES[calculated.selected_reforge]?.reforge || {})) { + if ( + calculated.selected_reforge && + Object.keys(CONSTANTS.REFORGES).find((a) => a === calculated.selected_reforge.toString()) + ) { + for (const [stat, value] of Object.entries( + (CONSTANTS as any).REFORGES[calculated.selected_reforge]?.reforge || {} + )) { const valueInt: number = parseFloat(value as string); stats[stat].reforge ??= 0; stats[stat].reforge += valueInt * mpTotal; - } + } // ? Power Bonus from Reforge if ((CONSTANTS as any).REFORGES[calculated.selected_reforge].power_bonus !== undefined) { - for (const [stat, value] of Object.entries((CONSTANTS as any).REFORGES[calculated.selected_reforge].power_bonus)) { + for (const [stat, value] of Object.entries( + (CONSTANTS as any).REFORGES[calculated.selected_reforge].power_bonus + )) { stats[stat].reforge ??= 0; stats[stat].reforge += value as number; } @@ -432,38 +437,45 @@ export function getPlayerStats() { stats.health.reaper_peppers = calculated.reaper_peppers_eaten; } - if (healthMultiplier > 0) { stats.health.stats_multiplier ??= 0; - const totalHealth = Object.keys(stats.health).map((key) => stats.health[key as keyof ItemStats["health"]] ?? 0).reduce((a, b) => a + b, 0); + const totalHealth = Object.keys(stats.health) + .map((key) => stats.health[key as keyof ItemStats["health"]] ?? 0) + .reduce((a, b) => a + b, 0); stats.health.stats_multiplier = healthMultiplier > 0 ? totalHealth + totalHealth * healthMultiplier : 0; } if (ferocityMultiplier > 0) { stats.ferocity.stats_multiplier ??= 0; - const totalFerocity = Object.keys(stats.ferocity).map((key) => stats.ferocity[key as keyof ItemStats["ferocity"]] ?? 0).reduce((a, b) => a + b, 0); + const totalFerocity = Object.keys(stats.ferocity) + .map((key) => stats.ferocity[key as keyof ItemStats["ferocity"]] ?? 0) + .reduce((a, b) => a + b, 0); stats.ferocity.stats_multiplier = ferocityMultiplier > 0 ? totalFerocity + totalFerocity * ferocityMultiplier : 0; } - + if (defenseMultiplier > 0) { stats.defense.stats_multiplier ??= 0; - const totalDefense = Object.keys(stats.defense).map((key) => stats.defense[key as keyof ItemStats["defense"]] ?? 0).reduce((a, b) => a + b, 0); - stats.defense.stats_multiplier = defenseMultiplier > 0 ? totalDefense + totalDefense * defenseMultiplier : 0; + const totalDefense = Object.keys(stats.defense) + .map((key) => stats.defense[key as keyof ItemStats["defense"]] ?? 0) + .reduce((a, b) => a + b, 0); + stats.defense.stats_multiplier = defenseMultiplier > 0 ? totalDefense + totalDefense * defenseMultiplier : 0; } if (strengthMultiplier > 0) { stats.strength.stats_multiplier ??= 0; - const totalStrength = Object.keys(stats.strength).map((key) => stats.strength[key as keyof ItemStats["strength"]] ?? 0).reduce((a, b) => a + b, 0); + const totalStrength = Object.keys(stats.strength) + .map((key) => stats.strength[key as keyof ItemStats["strength"]] ?? 0) + .reduce((a, b) => a + b, 0); stats.strength.stats_multiplier = strengthMultiplier > 0 ? totalStrength + totalStrength * strengthMultiplier : 0; } if (bonusAttackSpeedMultiplier > 0) { stats.bonus_attack_speed.stats_multiplier ??= 0; - const totalBonusAttackSpeed = Object.keys(stats.bonus_attack_speed).map((key) => stats.bonus_attack_speed[key as keyof ItemStats["bonus_attack_speed"]] ?? 0).reduce((a, b) => a + b, 0); + const totalBonusAttackSpeed = Object.keys(stats.bonus_attack_speed) + .map((key) => stats.bonus_attack_speed[key as keyof ItemStats["bonus_attack_speed"]] ?? 0) + .reduce((a, b) => a + b, 0); stats.bonus_attack_speed.stats_multiplier = - bonusAttackSpeedMultiplier > 0 - ? totalBonusAttackSpeed + totalBonusAttackSpeed * bonusAttackSpeedMultiplier - : 0; + bonusAttackSpeedMultiplier > 0 ? totalBonusAttackSpeed + totalBonusAttackSpeed * bonusAttackSpeedMultiplier : 0; } if (statsMultiplier > 0) { @@ -471,7 +483,9 @@ export function getPlayerStats() { if (stat.includes("fortune" || stat == "pristine" || stat == "effective_health")) continue; stats[stat as keyof ItemStats].stat ??= 0; - const totalStat = Object.keys(stats[stat as keyof ItemStats]).map((key) => stats[stat as keyof ItemStats][key] ?? 0).reduce((a, b) => a + b, 0); + const totalStat = Object.keys(stats[stat as keyof ItemStats]) + .map((key) => stats[stat as keyof ItemStats][key] ?? 0) + .reduce((a, b) => a + b, 0); stats[stat as keyof ItemStats].stat += totalStat * statsMultiplier; } } @@ -484,8 +498,13 @@ export function getPlayerStats() { // Potion Effects for (const effect of calculated.active_effects) { - if (effect.effect === undefined || (CONSTANTS as any).POTION_EFFECTS[effect.effect as string][effect.level as number]?.bonus === undefined) continue; - for (const [stat, value] of Object.entries((CONSTANTS as any).POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { + if ( + effect.effect === undefined || + (CONSTANTS as any).POTION_EFFECTS[effect.effect as string][effect.level as number]?.bonus === undefined + ) + continue; + for (const [stat, value] of Object.entries((CONSTANTS as any).POTION_EFFECTS[effect.effect][effect.level]?.bonus) || + []) { stats[stat].potion ??= 0; stats[stat].potion += value as number; } @@ -640,7 +659,9 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: SkyCryptPlayer) { } if (pet.type == "BABY_YETI") { - const totalDefense = Object.keys(stats.defense).map((key) => stats.defense[key]).reduce((a, b) => a + b, 0); + const totalDefense = Object.keys(stats.defense) + .map((key) => stats.defense[key]) + .reduce((a, b) => a + b, 0); if (pet.tier == "EPIC") { stats.defense.pet ??= 0; stats.defense.pet += totalDefense / (0.5 * pet.level.level); @@ -782,7 +803,7 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: SkyCryptPlayer) { if (pet.type == "AMMONITE") { if (pet.tier == "LEGENDARY") { stats.sea_creature_chance.pet ??= 0; - calculated.hotm[0].display_name.split(" ")[1] + calculated.hotm[0].display_name.split(" ")[1]; } } diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 37f848bec6..89dbd960c1 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -120,7 +120,7 @@ interface Item extends DisplayItem, ItemSlot { isInactive?: boolean; hegemony?: { rarity: string; - } + }; } interface ItemTag { @@ -426,9 +426,11 @@ declare const calculated: SkyCryptPlayer & { [key: string]: number; }; levels: { - [key: string]: { - level: number - } | Level; + [key: string]: + | { + level: number; + } + | Level; }; members: SkyCryptPlayer[]; mining: { @@ -606,11 +608,11 @@ declare const calculated: SkyCryptPlayer & { tag: { display: { Lore: string; - } + }; }; display_name: string; disabled: boolean; - }[], + }[]; active_effects: { effect: string; level: number; @@ -740,4 +742,4 @@ interface StatBonusType { [key: string]: { [key in StatName]?: number; }; -} \ No newline at end of file +} From 7bda15e2253de17adeff41e3cd595db1d840cb15 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 1 Jan 2023 17:37:26 +0100 Subject: [PATCH 39/42] refactor: removed useless parts of code --- common/constants/bonuses.js | 9 --------- src/constants.js | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/common/constants/bonuses.js b/common/constants/bonuses.js index 075d3e9b30..a2afe04259 100644 --- a/common/constants/bonuses.js +++ b/common/constants/bonuses.js @@ -47,25 +47,16 @@ export const STATS_BONUS = { // Slayer slayer_zombie: { 1: { health: 2 }, - 2: { health: 2 }, 3: { health: 3 }, - 4: { health: 3 }, 5: { health: 4 }, - 6: { health: 4 }, 7: { health: 5 }, - 8: { health: 5 }, 9: { health: 6 }, }, slayer_spider: { 1: { crit_damage: 1 }, - 2: { crit_damage: 1 }, - 3: { crit_damage: 1 }, - 4: { crit_damage: 1 }, 5: { crit_damage: 2 }, - 6: { crit_damage: 2 }, 7: { crit_chance: 1 }, 8: { crit_damage: 3 }, - 9: { crit_damage: 3 }, }, slayer_wolf: { 1: { speed: 1 }, diff --git a/src/constants.js b/src/constants.js index a23ae8ea69..0af95306f3 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,8 +1,8 @@ export * from "../common/constants.js"; export * from "./constants/accessories.js"; -export * from "./constants/bestiary.js"; export * from "./constants/armor.js"; +export * from "./constants/bestiary.js"; export * from "./constants/collections.js"; export * from "./constants/dungeons.js"; export * from "./constants/forge.js"; From 9d205c7c83ffe6b2f6f1518f8fee07636d55dd47 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Mon, 16 Jan 2023 21:28:06 +0100 Subject: [PATCH 40/42] fix: errors --- common/constants/potions.js | 8 ++++++++ common/constants/reforges.js | 6 +++--- public/resources/ts/calculate-player-stats.ts | 10 ++++++++-- src/lib.js | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/common/constants/potions.js b/common/constants/potions.js index 5e35c24803..65f99426c9 100644 --- a/common/constants/potions.js +++ b/common/constants/potions.js @@ -1115,4 +1115,12 @@ export const POTION_EFFECTS = { bonus: {}, }, }, + goblin_king_scent: { + 1: { + name: "Goblin King Scent", + description: + "Allows the player to sneak into the main area of the Goblin Queen's Den behind the Queen's Guards to obtain the Amber Crystal.", + bonus: {}, + }, + }, }; diff --git a/common/constants/reforges.js b/common/constants/reforges.js index 16fbf6807c..8e52e4f6af 100644 --- a/common/constants/reforges.js +++ b/common/constants/reforges.js @@ -250,7 +250,7 @@ export const REFORGES = { crit_damage: 50, }, reforge: { - strenght: 53 / 250, + strength: 53 / 250, intelligence: 267 / 250, }, }, @@ -304,7 +304,7 @@ export const REFORGES = { name: "Hazmat Enderman", power_bonus: { defense: 100, - strenght: 50, + strength: 50, }, reforge: { speed: 6 / 250, @@ -312,7 +312,7 @@ export const REFORGES = { crit_damage: 58 / 250, health: 81 / 250, defense: 58 / 250, - strenght: 58 / 250, + strength: 58 / 250, intelligence: 87 / 250, }, }, diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index b115fe2466..47b5ae0c7a 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -169,6 +169,8 @@ export function getPlayerStats() { for (const [stat, value] of Object.entries( CONSTANTS.CUSTOM_ARMOR_ABILTIES[armorSet as keyof typeof CONSTANTS.CUSTOM_ARMOR_ABILTIES].bonus )) { + if (stat.endsWith("Multiplier")) continue; + stats[stat].armor ??= 0; if (stat.includes("_cap")) { stats[stat].armor = value; @@ -500,9 +502,13 @@ export function getPlayerStats() { for (const effect of calculated.active_effects) { if ( effect.effect === undefined || - (CONSTANTS as any).POTION_EFFECTS[effect.effect as string][effect.level as number]?.bonus === undefined - ) + (CONSTANTS as any).POTION_EFFECTS[effect.effect as string]?.[effect.level as number]?.bonus === undefined + ) { + console.log("If you're seeing this, please report this to the developer, thanks."); + console.log("Potion effect data:"); + console.log(effect); continue; + } for (const [stat, value] of Object.entries((CONSTANTS as any).POTION_EFFECTS[effect.effect][effect.level]?.bonus) || []) { stats[stat].potion ??= 0; diff --git a/src/lib.js b/src/lib.js index c49f35e0b1..8c31ea4d2a 100644 --- a/src/lib.js +++ b/src/lib.js @@ -1833,7 +1833,7 @@ export async function getStats( output.harp_quest = userProfile.harp_quest; output.hotm = "mining_core" in userProfile ? await getHotmItems(userProfile) : []; output.active_effects = userProfile.active_effects || []; - output.selected_reforge = userProfile.accessory_bag_storage.selected_power || null; + output.selected_reforge = userProfile.accessory_bag_storage?.selected_power || null; output.essence = getEssence(userProfile, hypixelProfile); From 09c51be5b687bff8c6b0e88bba924ff29f6c824e Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Sun, 29 Jan 2023 12:06:00 +0100 Subject: [PATCH 41/42] feat: add SkyBlock Levels & fixes --- common/constants/bonuses.js | 1 + public/resources/ts/calculate-player-stats.ts | 105 ++++++++---------- public/resources/ts/globals.d.ts | 1 + src/lib.js | 9 ++ 4 files changed, 60 insertions(+), 56 deletions(-) diff --git a/common/constants/bonuses.js b/common/constants/bonuses.js index a2afe04259..98878117c7 100644 --- a/common/constants/bonuses.js +++ b/common/constants/bonuses.js @@ -4,6 +4,7 @@ export const STATS_BONUS = { 1: { health: 2, farming_fortune: 4 }, 15: { health: 3, farming_fortune: 4 }, 20: { health: 4, farming_fortune: 4 }, + 25: { health: 5, farming_fortune: 4 }, }, skill_mining: { 1: { defense: 1, mining_fortune: 4 }, diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index 47b5ae0c7a..de08cc7c2d 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -48,6 +48,17 @@ export function getPlayerStats() { bonusAttackSpeedMultiplier = 0, ferocityMultiplier = 0; + // Skyblock Level + if (calculated.skyblock_level.level > 0) { + stats.health.skyblock_level ??= 0; + stats.strength.skyblock_level ??= 0; + + stats.health.skyblock_level += calculated.skyblock_level.level * 5; + stats.strength.skyblock_level += Math.floor(calculated.skyblock_level.level / 5) * 1; + + stats.health.skyblock_level += Math.floor(calculated.skyblock_level.level / 10) * 5; + } + // Bestiary Level if (calculated?.bestiary.bonus > 0) { stats.health.bestiary ??= 0; @@ -67,70 +78,63 @@ export function getPlayerStats() { } // Slayer Completion - for (const type of Object.keys(calculated.slayers) || []) { - for (const tiers of Object.keys(calculated.slayers[type as keyof typeof calculated.slayers]?.kills) || []) { + for (const type in calculated.slayers || {}) { + for (const tiers in calculated.slayers[type as keyof typeof calculated.slayers]?.kills || {}) { + stats.combat_wisdom.slayer ??= 0; + if (parseInt(tiers) <= 3) { - temp[type] ??= 0; - temp[type] += 1; - } else if (parseInt(tiers) == 5) { - // Hypixel admins forgot to add tier 5 bosses to Wisdom calculation :/ - temp[type] ??= 0; - temp[type] += 2; + stats.combat_wisdom.slayer += 1; + } else if (parseInt(tiers) == 4) { + stats.combat_wisdom.slayer += 2; } } } - for (const type of Object.keys(temp)) { - stats.combat_wisdom.slayer ??= 0; - stats.combat_wisdom.slayer += temp[type]; - } - // Heart Of The Mountain + const miningAbilities = [ + "Mining Speed I", + "Mining Speed II", + "Mining Fortune I", + "Mining Fortune II", + "Mining Madness", + "Seasoned Mineman", + ]; + for (const a of calculated.hotm) { - if ( - a.display_name == "Mining Speed I" || - a.display_name == "Mining Speed II" || - a.display_name == "Mining Fortune I" || - a.display_name == "Mining Fortune II" || - a.display_name == "Mining Madness" || - a.display_name == "Seasoned Mineman" - ) { + if (miningAbilities.includes(a.display_name)) { a.level = parseInt(a.tag.display.Lore[1].split(" ")[1]); - a.disabled = a.tag.display.Lore[a.tag.display?.Lore.length - 1].includes("ENABLED") ? false : true || false; - if (a.display_name == "Mining Speed I" && a.disabled == false) { + a.disabled = !a.tag.display.Lore[a.tag.display?.Lore.length - 1].includes("ENABLED"); + + if (a.disabled === true) continue; + + if (a.display_name === "Mining Speed I") { stats.mining_speed.heart_of_the_mountain ??= 0; - stats.mining_speed.heart_of_the_mountain += a.level * 20; - } - if (a.display_name == "Mining Speed II" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain = (stats.mining_speed.heart_of_the_mountain || 0) + a.level * 20; + } else if (a.display_name === "Mining Speed II") { stats.mining_speed.heart_of_the_mountain ??= 0; - stats.mining_speed.heart_of_the_mountain += a.level * 40; - } - if (a.display_name == "Mining Fortune I" && a.disabled == false) { - stats.mining_fortune.heart_of_the_mountain ??= 0; - stats.mining_fortune.heart_of_the_mountain += a.level * 5; - } - if (a.display_name == "Mining Fortune II" && a.disabled == false) { + stats.mining_speed.heart_of_the_mountain = (stats.mining_speed.heart_of_the_mountain || 0) + a.level * 40; + } else if (["Mining Fortune II", "Mining Fortune I"].includes(a.display_name)) { stats.mining_fortune.heart_of_the_mountain ??= 0; - stats.mining_fortune.heart_of_the_mountain += a.level * 5; - } - if (a.display_name == "Seasoned Mineman" && a.disabled == false) { + stats.mining_fortune.heart_of_the_mountain = (stats.mining_fortune.heart_of_the_mountain || 0) + a.level * 5; + } else if (a.display_name === "Seasoned Mineman") { stats.mining_wisdom.heart_of_the_mountain ??= 0; - stats.mining_wisdom.heart_of_the_mountain += 5 + parseInt(a.level.toString().split("/")[1]) * 0.1 || 0; - } - if (a.display_name == "Mining Madness" && a.disabled == false) { + stats.mining_wisdom.heart_of_the_mountain += 5 + a.level * 0.1; + } else if (a.display_name === "Mining Madness") { stats.mining_speed.heart_of_the_mountain ??= 0; - stats.mining_speed.heart_of_the_mountain += 50; stats.mining_fortune.heart_of_the_mountain ??= 0; - stats.mining_fortune.heart_of_the_mountain += 50; + stats.mining_speed.heart_of_the_mountain = (stats.mining_speed.heart_of_the_mountain || 0) + 50; + stats.mining_fortune.heart_of_the_mountain = (stats.mining_fortune.heart_of_the_mountain || 0) + 50; } } } // Harp Quest for (const harp in calculated.harp_quest || []) { - if (harp?.endsWith("_best_completion")) { + if (harp === undefined) continue; + + if (harp.endsWith("_best_completion")) { stats.intelligence.harp ??= 0; - stats.intelligence.harp += CONSTANTS.HARP_QUEST[harp as keyof typeof CONSTANTS.HARP_QUEST]; + stats.intelligence.harp += CONSTANTS.HARP_QUEST[harp as keyof typeof CONSTANTS.HARP_QUEST] || 0; } } @@ -198,13 +202,6 @@ export function getPlayerStats() { .reduce((a, b) => a + b, 0) / 2; } - // ? Obsidian Chestplate - /* - if (chestplate?.tag?.ExtraAttributes?.id == 'OBSIDIAN_CHESTPLATE') { - stats.speed.armor += itemCount.OBSIDIAN.armor / 20 ? (itemCount.OBSIDIAN.armor / 20).toFixed(0) : 0; - } - */ - // ? Glacite Armor if ( helmet?.tag?.ExtraAttributes?.id == "GLACITE_HELMET" && @@ -336,11 +333,8 @@ export function getPlayerStats() { } // Active accessories stats - const accessoryDuplicates: string[] = []; for (const item of items.accessories.filter((item) => (item as Item).isInactive === false)) { const itemData: Item = item as Item; - if (accessoryDuplicates.includes(itemData.tag?.ExtraAttributes?.id || "")) continue; - accessoryDuplicates.push(itemData.tag?.ExtraAttributes?.id || ""); const bonusStats: ItemStats = helper.getStatsFromItem(item as Item); @@ -353,7 +347,6 @@ export function getPlayerStats() { stats[name].accessories += value; if (itemData.tag?.ExtraAttributes?.id == "NIGHT_CRYSTAL" || itemData.tag?.ExtraAttributes?.id == "DAY_CRYSTAL") { - accessoryDuplicates.push(itemData.tag?.ExtraAttributes?.id); stats.health.accessories += 5; stats.strength.accessories += 5; } @@ -377,7 +370,7 @@ export function getPlayerStats() { // Dungeoneering stats if (calculated.dungeons?.catacombs?.level?.level) { const bonusStats: ItemStats = getBonusStat( - Math.min(calculated.dungeons?.catacombs?.level?.maxLevel, 50), + Math.min(calculated.dungeons?.catacombs?.level?.level, 50), "skill_dungeoneering", calculated.dungeons.catacombs.level.maxLevel ); @@ -504,7 +497,7 @@ export function getPlayerStats() { effect.effect === undefined || (CONSTANTS as any).POTION_EFFECTS[effect.effect as string]?.[effect.level as number]?.bonus === undefined ) { - console.log("If you're seeing this, please report this to the developer, thanks."); + console.log("If you're seeing this, please report this to the developers, thanks."); console.log("Potion effect data:"); console.log(effect); continue; diff --git a/public/resources/ts/globals.d.ts b/public/resources/ts/globals.d.ts index 89dbd960c1..200df99da5 100644 --- a/public/resources/ts/globals.d.ts +++ b/public/resources/ts/globals.d.ts @@ -617,6 +617,7 @@ declare const calculated: SkyCryptPlayer & { effect: string; level: number; }[]; + skyblock_level: Level; }; interface SkyCryptRelativeTime { diff --git a/src/lib.js b/src/lib.js index 0d33cf4490..62849a4d29 100644 --- a/src/lib.js +++ b/src/lib.js @@ -2093,6 +2093,15 @@ export async function getStats( active: userProfile.nether_island_player_data?.abiphone?.active_contacts?.length || 0, }; + output.skyblock_level = { + xp: userProfile.leveling?.experience || 0, + level: Math.floor(userProfile.leveling?.experience / 100 || 0), + maxLevel: 386, + progress: (userProfile.leveling?.experience % 100) / 100 || 0, + xpCurrent: userProfile.leveling?.experience % 100 || 0, + xpForNext: 100, + }; + // MISC const misc = {}; From 9bb306e1d2a88d1daaf9efef1f521aa5410af4ed Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Fri, 24 Feb 2023 15:02:12 +0100 Subject: [PATCH 42/42] fix: eslint --- public/resources/ts/calculate-player-stats.ts | 10 ++++++++-- src/constants/accessories.js | 11 ----------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts index de08cc7c2d..871bf891a8 100644 --- a/public/resources/ts/calculate-player-stats.ts +++ b/public/resources/ts/calculate-player-stats.ts @@ -40,7 +40,6 @@ export function getPlayerStats() { health_cap: { base: 0 }, }; const allowedStats = Object.keys(stats); - const temp: { [key: string]: number } = {}; let statsMultiplier = 0, healthMultiplier = 0, defenseMultiplier = 0, @@ -240,6 +239,7 @@ export function getPlayerStats() { // Custom pet abilities const activePet = calculated.pets.find((a) => a.active === true) as Pet; const petStats = getPetData(stats, activePet, calculated); + console.log("pet", petStats.stats.farming_fortune); Object.assign(stats, petStats.stats); @@ -509,6 +509,8 @@ export function getPlayerStats() { } } + console.log(stats); + return stats; } @@ -833,7 +835,11 @@ function getPetData(stats: PlayerStats, pet: Pet, calculated: SkyCryptPlayer) { if (pet.type == "MOOSHROOM_COW") { if (pet.tier == "LEGENDARY") { stats.farming_fortune.pet ??= 0; - stats.farming_fortune.pet += stats.strength.pet / (40 - pet.level.level * 0.2); + const totalStrenght = Object.keys(stats.strength) + .map((key) => stats.strength[key as keyof ItemStats["strength"]] ?? 0) + .reduce((a, b) => a + b, 0); + + stats.farming_fortune.pet += totalStrenght / (40 - pet.level.level * 0.2); } } diff --git a/src/constants/accessories.js b/src/constants/accessories.js index 7b0447dced..e8f6eea31f 100644 --- a/src/constants/accessories.js +++ b/src/constants/accessories.js @@ -174,17 +174,6 @@ function getMaxAccessories() { export const UNIQUE_ACCESSORIES_COUNT = Object.keys(getMaxAccessories()).length; -export const MAGICAL_POWER = { - common: 3, - uncommon: 5, - rare: 8, - epic: 12, - legendary: 16, - mythic: 22, - special: 3, - very_special: 5, -}; - export const RECOMBABLE_ACCESSORIES_COUNT = getMaxAccessories().filter((accessory) => { if (specialAccessories[accessory.id]?.allowsRecomb === false) return false;