mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-05-05 03:07:14 -04:00
wip
This commit is contained in:
parent
70182b0129
commit
ca1c75a5a1
28 changed files with 992 additions and 1073 deletions
|
@ -113,6 +113,10 @@ export function upgradeLevelAndMaxDisplay(
|
|||
) {
|
||||
const lvl = gameState.perks[upgrade.id];
|
||||
const max = upgrade.max + gameState.perks.limitless;
|
||||
return levelAndMaxBadge(lvl, max);
|
||||
}
|
||||
|
||||
export function levelAndMaxBadge(lvl: number, max: number) {
|
||||
return ` <span class="level ${lvl < max ? "can-upgrade" : "capped"}"><span>${lvl}</span><span>${max}</span></span>`;
|
||||
}
|
||||
|
||||
|
@ -123,15 +127,19 @@ export function pickedUpgradesHTMl(gameState: GameState) {
|
|||
const newMax = Math.max(0, u.max + gameState.perks.limitless);
|
||||
|
||||
const state = (gameState.perks[u.id] && 1) || (!newMax && 2) || 3;
|
||||
const tooltip = escapeAttribute(u.fullHelp(gameState.perks[u.id] || 1));
|
||||
return {
|
||||
state,
|
||||
html: `
|
||||
<div class="upgrade ${["??", "used", "banned", "free"][state]}">
|
||||
${icons["icon:" + u.id]}
|
||||
<p>
|
||||
<p data-tooltip="${tooltip}"
|
||||
data-help-content="${tooltip}"
|
||||
>
|
||||
<strong>${u.name}</strong>
|
||||
${upgradeLevelAndMaxDisplay(u, gameState)}
|
||||
${u.help(Math.max(1, gameState.perks[u.id]))}
|
||||
${u.help(gameState.perks[u.id] || 1)}
|
||||
|
||||
</p>
|
||||
</div>
|
||||
`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue