Build 29058753

This commit is contained in:
Renan LE CARO 2025-04-01 18:33:58 +02:00
parent 2c75005127
commit 92a0edabef
11 changed files with 31 additions and 33 deletions

View file

@ -85,14 +85,14 @@ export function pickedUpgradesHTMl(gameState: GameState) {
.map((u) => {
const newMax = Math.max(0, u.max - gameState.bannedPerks[u.id]);
let bars =[];
let bars = [];
for (let i = 0; i < Math.max(u.max, newMax, gameState.perks[u.id]); i++) {
if (i < gameState.perks[u.id]) {
bars .push('<span class="used"></span>');
bars.push('<span class="used"></span>');
} else if (i < newMax) {
bars .push('<span class="free"></span>');
bars.push('<span class="free"></span>');
} else {
bars .push('<span class="banned"></span>');
bars.push('<span class="banned"></span>');
}
}
@ -106,7 +106,7 @@ export function pickedUpgradesHTMl(gameState: GameState) {
<strong>${u.name}</strong>
${u.help(Math.max(1, gameState.perks[u.id]))}
</p>
${bars.reverse().join('')}
${bars.reverse().join("")}
</div>
`,
};