Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add powers and stat tuning #1847

Open
wants to merge 12 commits into
base: development
Choose a base branch
from
20 changes: 19 additions & 1 deletion public/resources/scss/stats.scss
Original file line number Diff line number Diff line change
@@ -1530,7 +1530,8 @@ a.additional-player-stat:hover {
}

.missing-pet,
.missing-accessory {
.missing-accessory,
.missing-power {
filter: grayscale(0.8);
transition: filter 0.2s;

@@ -2569,6 +2570,23 @@ bonus-stats {
}
}

.stats-tuning {
bonus-stats p {
margin: 0;
}
}

.selected-power {
display: flex;
align-items: center;
gap: 4px;
font-size: 20px;

.piece {
margin-top: 0;
}
}

#techno-support {
text-align: center;
padding: 20px;
20 changes: 20 additions & 0 deletions public/resources/ts/calculate-player-stats.ts
Original file line number Diff line number Diff line change
@@ -84,6 +84,26 @@ export function getPlayerStats() {
}
}

// Thaumaturgist power
if (calculated.selected_power) {
for (const [name, value] of Object.entries(calculated.selected_power.stats)) {
if (!allowedStats.includes(name)) {
continue;
}

stats[name].thaumaturgist_power = value;
}
}

// Tuning points
for (const [name, value] of Object.entries(calculated.tuning_points.distribution)) {
if (!allowedStats.includes(name)) {
continue;
}

stats[name].tuning_points = value;
}

// Skill bonus stats
for (const [skill, data] of Object.entries(calculated.levels)) {
const bonusStats: ItemStats = getBonusStat(data.level, `skill_${skill}` as BonusType, data.maxLevel);
6 changes: 6 additions & 0 deletions public/resources/ts/development-defer.ts
Original file line number Diff line number Diff line change
@@ -37,6 +37,12 @@ document.addEventListener("click", (e) => {
} else if (element.hasAttribute("data-upgrade-accessory-index")) {
item =
calculated.missingAccessories.upgrades[parseInt(element.getAttribute("data-upgrade-accessory-index") as string)];
} else if (element.hasAttribute("data-power-selected")) {
item = calculated.selected_power;
} else if (element.hasAttribute("data-power-index")) {
item = calculated.unlocked_powers[parseInt(element.getAttribute("data-power-index") as string)];
} else if (element.hasAttribute("data-locked-power-index")) {
item = calculated.locked_powers[parseInt(element.getAttribute("data-locked-power-index") as string)];
}

console.log(item);
24 changes: 24 additions & 0 deletions public/resources/ts/globals.d.ts
Original file line number Diff line number Diff line change
@@ -569,6 +569,30 @@ declare const calculated: SkyCryptPlayer & {
amount: number;
}[];
reaper_peppers_eaten: number;
selected_power: Item & {
stats: {
[key in StatName]: number;
};
};
unlocked_powers: (Item & {
power_type: string;
stats: {
[key in StatName]: number;
};
})[];
locked_powers: (Item & {
power_type: string;
stats: {
[key in StatName]: number;
};
})[];
tuning_points: {
distribution: {
[key in StatName]: number;
};
total: number;
used: number;
};
skyblock_level: Level;
};

6 changes: 6 additions & 0 deletions public/resources/ts/stats-defer.ts
Original file line number Diff line number Diff line change
@@ -263,6 +263,12 @@ function fillLore(element: HTMLElement) {
} else if (element.hasAttribute("data-upgrade-accessory-index")) {
item =
calculated.missingAccessories.upgrades[parseInt(element.getAttribute("data-upgrade-accessory-index") as string)];
} else if (element.hasAttribute("data-power-selected")) {
item = calculated.selected_power;
} else if (element.hasAttribute("data-power-index")) {
item = calculated.unlocked_powers[parseInt(element.getAttribute("data-power-index") as string)];
} else if (element.hasAttribute("data-locked-power-index")) {
item = calculated.locked_powers[parseInt(element.getAttribute("data-locked-power-index") as string)];
}

if (item == undefined) {
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -19,3 +19,4 @@ export * from "./constants/skills.js";
export * from "./constants/skins-animations.js";
export * from "./constants/tags.js";
export * from "./constants/accessories.js";
export * from "./constants/powers.js";
Loading