mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-05-04 18:59:13 -04:00
wip
This commit is contained in:
parent
b5fafa5f3c
commit
70182b0129
14 changed files with 344 additions and 475 deletions
|
@ -16,6 +16,7 @@ Break colourful bricks, catch bouncing coins and select powerful upgrades !
|
||||||
- instead of bouncing the ball,loosing a life pauses the game (with coins still in the air)
|
- instead of bouncing the ball,loosing a life pauses the game (with coins still in the air)
|
||||||
|
|
||||||
## Done
|
## Done
|
||||||
|
|
||||||
- rewoked perks choices to limit perk fatigue, avoid wall of texts, allow users to skip
|
- rewoked perks choices to limit perk fatigue, avoid wall of texts, allow users to skip
|
||||||
- removed rerolls
|
- removed rerolls
|
||||||
- offer to pick 1 upgrade out of 3 choices
|
- offer to pick 1 upgrade out of 3 choices
|
||||||
|
@ -28,8 +29,7 @@ Break colourful bricks, catch bouncing coins and select powerful upgrades !
|
||||||
- continue to level X/Y as button
|
- continue to level X/Y as button
|
||||||
- lives = upgrade points
|
- lives = upgrade points
|
||||||
- clarify challenges
|
- clarify challenges
|
||||||
- missed challenges show as greyed out choices (with unlock condition).
|
- removed the "sides bounce" challenge
|
||||||
|
|
||||||
- upgrades list now uses numbers instead of bars, looks better with limitless
|
- upgrades list now uses numbers instead of bars, looks better with limitless
|
||||||
- somehow score clicks didn't register while the game was playing, that's solved
|
- somehow score clicks didn't register while the game was playing, that's solved
|
||||||
- Fix : click tooltip to open on mobile, click anywhere to close
|
- Fix : click tooltip to open on mobile, click anywhere to close
|
||||||
|
|
186
dist/index.html
vendored
186
dist/index.html
vendored
File diff suppressed because one or more lines are too long
116
src/game.less
116
src/game.less
|
@ -1,6 +1,5 @@
|
||||||
* {
|
* {
|
||||||
font-family:
|
font-family: Courier New,
|
||||||
Courier New,
|
|
||||||
Courier,
|
Courier,
|
||||||
Lucida Sans Typewriter,
|
Lucida Sans Typewriter,
|
||||||
Lucida Typewriter,
|
Lucida Typewriter,
|
||||||
|
@ -422,6 +421,60 @@ h2.histogram-title strong {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&.used {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.free {
|
||||||
|
//opacity: 0.8;
|
||||||
|
|
||||||
|
img {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.banned {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.greyed-out {
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
text-shadow: 0 0 2px #185fa8;
|
||||||
|
user-select: none;
|
||||||
|
background: linear-gradient(#5da3ea, #3e86ce);
|
||||||
|
border: 2px solid #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
align-self: flex-start;
|
||||||
|
padding: 5px;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: transform 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
box-shadow: 0 1px 0 black inset,
|
||||||
|
0 2px #5da3ea,
|
||||||
|
0 4px white;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #5da3ea;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: translate(0, 4px);
|
||||||
|
box-shadow: 0 1px 0 black inset,
|
||||||
|
0 0px #5da3ea,
|
||||||
|
0 0px white;
|
||||||
|
}
|
||||||
|
|
||||||
|
transition: transform 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.level {
|
.level {
|
||||||
color: #000;
|
color: #000;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
@ -468,6 +521,7 @@ h2.histogram-title strong {
|
||||||
|
|
||||||
&.capped {
|
&.capped {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
|
||||||
> span:first-child {
|
> span:first-child {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #000;
|
background: #000;
|
||||||
|
@ -480,61 +534,6 @@ h2.histogram-title strong {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.used {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.free {
|
|
||||||
//opacity: 0.8;
|
|
||||||
|
|
||||||
img {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.banned {
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.greyed-out {
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
color: #fff;
|
|
||||||
cursor: pointer;
|
|
||||||
text-shadow: 0 0 2px #185fa8;
|
|
||||||
user-select: none;
|
|
||||||
background: linear-gradient(#5da3ea, #3e86ce);
|
|
||||||
border: 2px solid #fff;
|
|
||||||
border-radius: 5px;
|
|
||||||
align-self: flex-start;
|
|
||||||
padding: 5px;
|
|
||||||
font-weight: bold;
|
|
||||||
transition:
|
|
||||||
transform 0.2s,
|
|
||||||
box-shadow 0.2s;
|
|
||||||
box-shadow:
|
|
||||||
0 1px 0 black inset,
|
|
||||||
0 2px #5da3ea,
|
|
||||||
0 4px white;
|
|
||||||
&:hover {
|
|
||||||
background: #5da3ea;
|
|
||||||
}
|
|
||||||
&:active {
|
|
||||||
transform: translate(0, 4px);
|
|
||||||
box-shadow:
|
|
||||||
0 1px 0 black inset,
|
|
||||||
0 0px #5da3ea,
|
|
||||||
0 0px white;
|
|
||||||
}
|
|
||||||
|
|
||||||
transition:
|
|
||||||
transform 0.2s,
|
|
||||||
box-shadow 0.2s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#tooltip {
|
#tooltip {
|
||||||
display: block;
|
display: block;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -625,8 +624,7 @@ h2.histogram-title strong {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
transition:
|
transition: opacity 200ms,
|
||||||
opacity 200ms,
|
|
||||||
transform 200ms;
|
transform 200ms;
|
||||||
z-index: 7;
|
z-index: 7;
|
||||||
|
|
||||||
|
|
|
@ -76,8 +76,6 @@
|
||||||
"level_up.challenges.levelMisses.name": "",
|
"level_up.challenges.levelMisses.name": "",
|
||||||
"level_up.challenges.levelTime.description": "",
|
"level_up.challenges.levelTime.description": "",
|
||||||
"level_up.challenges.levelTime.name": "",
|
"level_up.challenges.levelTime.name": "",
|
||||||
"level_up.challenges.levelWallBounces.description": "",
|
|
||||||
"level_up.challenges.levelWallBounces.name": "",
|
|
||||||
"level_up.go": "",
|
"level_up.go": "",
|
||||||
"level_up.go_with_upgrades": "",
|
"level_up.go_with_upgrades": "",
|
||||||
"level_up.gold": "",
|
"level_up.gold": "",
|
||||||
|
|
|
@ -2790,81 +2790,6 @@
|
||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
|
||||||
<name>levelWallBounces</name>
|
|
||||||
<children>
|
|
||||||
<concept_node>
|
|
||||||
<name>description</name>
|
|
||||||
<description/>
|
|
||||||
<comment/>
|
|
||||||
<translations>
|
|
||||||
<translation>
|
|
||||||
<language>ar-LB</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>de-DE</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>en-US</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>es-CL</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>fr-FR</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>ru-RU</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>tr-TR</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
</translations>
|
|
||||||
</concept_node>
|
|
||||||
<concept_node>
|
|
||||||
<name>name</name>
|
|
||||||
<description/>
|
|
||||||
<comment/>
|
|
||||||
<translations>
|
|
||||||
<translation>
|
|
||||||
<language>ar-LB</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>de-DE</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>en-US</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>es-CL</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>fr-FR</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>ru-RU</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
<translation>
|
|
||||||
<language>tr-TR</language>
|
|
||||||
<approved>false</approved>
|
|
||||||
</translation>
|
|
||||||
</translations>
|
|
||||||
</concept_node>
|
|
||||||
</children>
|
|
||||||
</folder_node>
|
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
|
|
|
@ -76,8 +76,6 @@
|
||||||
"level_up.challenges.levelMisses.name": "",
|
"level_up.challenges.levelMisses.name": "",
|
||||||
"level_up.challenges.levelTime.description": "",
|
"level_up.challenges.levelTime.description": "",
|
||||||
"level_up.challenges.levelTime.name": "",
|
"level_up.challenges.levelTime.name": "",
|
||||||
"level_up.challenges.levelWallBounces.description": "",
|
|
||||||
"level_up.challenges.levelWallBounces.name": "",
|
|
||||||
"level_up.go": "",
|
"level_up.go": "",
|
||||||
"level_up.go_with_upgrades": "",
|
"level_up.go_with_upgrades": "",
|
||||||
"level_up.gold": "",
|
"level_up.gold": "",
|
||||||
|
|
|
@ -68,26 +68,24 @@
|
||||||
"lab.reset": "Reset",
|
"lab.reset": "Reset",
|
||||||
"lab.select_level": "Select a level to play on",
|
"lab.select_level": "Select a level to play on",
|
||||||
"lab.unlocks_at": "Unlocks at total score {{score}}",
|
"lab.unlocks_at": "Unlocks at total score {{score}}",
|
||||||
"level_up.add_perks": "Add perks to your build",
|
"level_up.add_perks": "Add perks",
|
||||||
"level_up.challenges.catchRateGood.description": "You'll get a gold medal (+1 choices, +1 upgrade point) for catching {{gold}}% of coins. You'll get a silver medal (+1 upgrade point) if you catch {{silver}}%. This level you caught {{caught}} coins out of {{total}}",
|
"level_up.challenges.catchRateGood.description": "Catch {{gold}}% of coins for gold, {{silver}}% for silver. Last level you caught {{caught}} coins out of {{total}}",
|
||||||
"level_up.challenges.catchRateGood.name": "{{value}}% coins caught ",
|
"level_up.challenges.catchRateGood.name": "{{value}}% coins caught ",
|
||||||
"level_up.challenges.intro": "Play well to earn extra upgrades and choices",
|
"level_up.challenges.intro": "Challenges",
|
||||||
"level_up.challenges.levelMisses.description": "You'll get a gold medal (+1 choices, +1 upgrade point) if you miss all bricks less than {{gold}} times. You'll get a silver medal (+1 upgrade point) under {{silver}} missed shots. ",
|
"level_up.challenges.levelMisses.description": "You'll get a gold medal if you miss less than {{gold}} times, silver under {{silver}}. ",
|
||||||
"level_up.challenges.levelMisses.name": "{{value}} missed shots",
|
"level_up.challenges.levelMisses.name": "{{value}} missed shots",
|
||||||
"level_up.challenges.levelTime.description": "You'll get a gold medal (+1 choices, +1 upgrade point) if you clear the level under {{gold}}s . You'll get a silver medal (+1 upgrade point) under {{silver}}s. ",
|
"level_up.challenges.levelTime.description": "You'll get a gold medal under {{gold}}s and a silver medal under {{silver}}s. ",
|
||||||
"level_up.challenges.levelTime.name": "{{value}}s play time",
|
"level_up.challenges.levelTime.name": "{{value}}s play time",
|
||||||
"level_up.challenges.levelWallBounces.description": "You'll get a gold medal (+1 choices, +1 upgrade point) if the ball bounces less than {{gold}} times on the wall and ceiling. You'll get a silver medal (+1 upgrade point) if if the ball bounces less than {{silver}} times. ",
|
|
||||||
"level_up.challenges.levelWallBounces.name": "{{value}} wall bounces",
|
|
||||||
"level_up.go": "Continue to level \"{{name}}\"",
|
"level_up.go": "Continue to level \"{{name}}\"",
|
||||||
"level_up.go_with_upgrades": "Spend your {{count}} upgrade points first",
|
"level_up.go_with_upgrades": "Spend your {{count}} upgrade points first",
|
||||||
"level_up.gold": "You gained one choice and upgrade point.",
|
"level_up.gold": "You gained two choices and upgrade point.",
|
||||||
"level_up.maxed_upgrade": "\"{{name}}\" is at max level",
|
"level_up.maxed_upgrade": "\"{{name}}\" is at max level",
|
||||||
"level_up.no": "You did not meet the reward condition.",
|
"level_up.no": "You did not meet the reward condition.",
|
||||||
"level_up.pick": "Pick",
|
"level_up.pick": "Pick",
|
||||||
"level_up.silver": "You gained an upgrade point.",
|
"level_up.silver": "You gained one choice and upgrade point.",
|
||||||
"level_up.title": "Level {{level}}/{{max}} cleared",
|
"level_up.title": "Level {{level}}/{{max}} cleared",
|
||||||
"level_up.upgrade": "Upgrade",
|
"level_up.upgrade": "Upgrade",
|
||||||
"level_up.upgrade_perks": "Your current perks",
|
"level_up.upgrade_perks": "Upgrade your perks",
|
||||||
"main_menu.basic": "",
|
"main_menu.basic": "",
|
||||||
"main_menu.basic_help": "",
|
"main_menu.basic_help": "",
|
||||||
"main_menu.colorful_coins": "",
|
"main_menu.colorful_coins": "",
|
||||||
|
|
|
@ -76,8 +76,6 @@
|
||||||
"level_up.challenges.levelMisses.name": "",
|
"level_up.challenges.levelMisses.name": "",
|
||||||
"level_up.challenges.levelTime.description": "",
|
"level_up.challenges.levelTime.description": "",
|
||||||
"level_up.challenges.levelTime.name": "",
|
"level_up.challenges.levelTime.name": "",
|
||||||
"level_up.challenges.levelWallBounces.description": "",
|
|
||||||
"level_up.challenges.levelWallBounces.name": "",
|
|
||||||
"level_up.go": "",
|
"level_up.go": "",
|
||||||
"level_up.go_with_upgrades": "",
|
"level_up.go_with_upgrades": "",
|
||||||
"level_up.gold": "",
|
"level_up.gold": "",
|
||||||
|
|
|
@ -76,8 +76,6 @@
|
||||||
"level_up.challenges.levelMisses.name": "",
|
"level_up.challenges.levelMisses.name": "",
|
||||||
"level_up.challenges.levelTime.description": "",
|
"level_up.challenges.levelTime.description": "",
|
||||||
"level_up.challenges.levelTime.name": "",
|
"level_up.challenges.levelTime.name": "",
|
||||||
"level_up.challenges.levelWallBounces.description": "",
|
|
||||||
"level_up.challenges.levelWallBounces.name": "",
|
|
||||||
"level_up.go": "",
|
"level_up.go": "",
|
||||||
"level_up.go_with_upgrades": "",
|
"level_up.go_with_upgrades": "",
|
||||||
"level_up.gold": "",
|
"level_up.gold": "",
|
||||||
|
|
|
@ -76,8 +76,6 @@
|
||||||
"level_up.challenges.levelMisses.name": "",
|
"level_up.challenges.levelMisses.name": "",
|
||||||
"level_up.challenges.levelTime.description": "",
|
"level_up.challenges.levelTime.description": "",
|
||||||
"level_up.challenges.levelTime.name": "",
|
"level_up.challenges.levelTime.name": "",
|
||||||
"level_up.challenges.levelWallBounces.description": "",
|
|
||||||
"level_up.challenges.levelWallBounces.name": "",
|
|
||||||
"level_up.go": "",
|
"level_up.go": "",
|
||||||
"level_up.go_with_upgrades": "",
|
"level_up.go_with_upgrades": "",
|
||||||
"level_up.gold": "",
|
"level_up.gold": "",
|
||||||
|
|
|
@ -76,8 +76,6 @@
|
||||||
"level_up.challenges.levelMisses.name": "",
|
"level_up.challenges.levelMisses.name": "",
|
||||||
"level_up.challenges.levelTime.description": "",
|
"level_up.challenges.levelTime.description": "",
|
||||||
"level_up.challenges.levelTime.name": "",
|
"level_up.challenges.levelTime.name": "",
|
||||||
"level_up.challenges.levelWallBounces.description": "",
|
|
||||||
"level_up.challenges.levelWallBounces.name": "",
|
|
||||||
"level_up.go": "",
|
"level_up.go": "",
|
||||||
"level_up.go_with_upgrades": "",
|
"level_up.go_with_upgrades": "",
|
||||||
"level_up.gold": "",
|
"level_up.gold": "",
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
import {GameState, PerkId} from "./types";
|
import {GameState, PerkId} from "./types";
|
||||||
import {
|
import {catchRateBest, catchRateGood, levelTimeBest, levelTimeGood, missesBest, missesGood,} from "./pure_functions";
|
||||||
catchRateBest,
|
|
||||||
catchRateGood,
|
|
||||||
levelTimeBest,
|
|
||||||
levelTimeGood,
|
|
||||||
missesBest,
|
|
||||||
missesGood,
|
|
||||||
wallBouncedBest,
|
|
||||||
wallBouncedGood,
|
|
||||||
} from "./pure_functions";
|
|
||||||
import {t} from "./i18n/i18n";
|
import {t} from "./i18n/i18n";
|
||||||
import {icons, upgrades} from "./loadGameData";
|
import {icons, upgrades} from "./loadGameData";
|
||||||
import { asyncAlert, requiredAsyncAlert } from "./asyncAlert";
|
import {requiredAsyncAlert} from "./asyncAlert";
|
||||||
import {
|
import {
|
||||||
escapeAttribute,
|
escapeAttribute,
|
||||||
getPossibleUpgrades,
|
getPossibleUpgrades,
|
||||||
|
@ -28,16 +19,19 @@ export async function openUpgradesPicker(gameState: GameState) {
|
||||||
let choices = 3;
|
let choices = 3;
|
||||||
let upgradesWon = 1;
|
let upgradesWon = 1;
|
||||||
let medals = [];
|
let medals = [];
|
||||||
|
|
||||||
function challengeResult(
|
function challengeResult(
|
||||||
name: String,
|
name: String,
|
||||||
description: String,
|
description: String,
|
||||||
medal: "gold" | "silver" | "no",
|
medal: "gold" | "silver" | "no",
|
||||||
) {
|
) {
|
||||||
if (medal === "gold") {
|
if (medal === "gold") {
|
||||||
|
choices++;
|
||||||
choices++;
|
choices++;
|
||||||
upgradesWon++;
|
upgradesWon++;
|
||||||
}
|
}
|
||||||
if (medal === "silver") {
|
if (medal === "silver") {
|
||||||
|
choices++;
|
||||||
upgradesWon++;
|
upgradesWon++;
|
||||||
}
|
}
|
||||||
medals.push(`<div class="upgrade" data-tooltip="${escapeAttribute(description)}">
|
medals.push(`<div class="upgrade" data-tooltip="${escapeAttribute(description)}">
|
||||||
|
@ -49,18 +43,6 @@ export async function openUpgradesPicker(gameState: GameState) {
|
||||||
</div>`);
|
</div>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
challengeResult(
|
|
||||||
t("level_up.challenges.levelWallBounces.name", {
|
|
||||||
value: gameState.levelWallBounces,
|
|
||||||
}),
|
|
||||||
t("level_up.challenges.levelWallBounces.description", {
|
|
||||||
silver: wallBouncedGood,
|
|
||||||
gold: wallBouncedBest,
|
|
||||||
}),
|
|
||||||
(gameState.levelWallBounces < wallBouncedBest && "gold") ||
|
|
||||||
(gameState.levelWallBounces < wallBouncedGood && "silver") ||
|
|
||||||
"no",
|
|
||||||
);
|
|
||||||
|
|
||||||
challengeResult(
|
challengeResult(
|
||||||
t("level_up.challenges.levelTime.name", {
|
t("level_up.challenges.levelTime.name", {
|
||||||
|
@ -132,40 +114,28 @@ export async function openUpgradesPicker(gameState: GameState) {
|
||||||
dontOfferTooSoon(gameState, u.id);
|
dontOfferTooSoon(gameState, u.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
const actions = list.map((u) => {
|
const upgradesActions = list.filter(u => gameState.perks[u.id])
|
||||||
const max = u.max + gameState.perks.limitless;
|
.map(u => ({
|
||||||
const lvl = gameState.perks[u.id];
|
value: u.id,
|
||||||
|
text: u.name + upgradeLevelAndMaxDisplay(u, gameState),
|
||||||
|
icon: icons["icon:" + u.id],
|
||||||
|
disabled: !gameState.upgrade_points || gameState.perks[u.id] >= u.max + gameState.perks.limitless,
|
||||||
|
tooltip: u.help(gameState.perks[u.id]) + u.fullHelp(gameState.perks[u.id])
|
||||||
|
}))
|
||||||
|
|
||||||
const button =
|
const addPerkActions = list.filter(u => !gameState.perks[u.id])
|
||||||
!gameState.upgrade_points || gameState.perks[u.id] >= max
|
.map(u => ({
|
||||||
? ""
|
value: u.id,
|
||||||
: ` <button data-resolve-to="${u.id}">${
|
text: u.name,
|
||||||
lvl ? t("level_up.upgrade") : t("level_up.pick")
|
icon: icons["icon:" + u.id],
|
||||||
}</button>`;
|
disabled: !gameState.upgrade_points,
|
||||||
|
help: u.help(1),
|
||||||
|
tooltip: u.fullHelp(1)
|
||||||
|
|
||||||
const lvlInfo = lvl ? upgradeLevelAndMaxDisplay(u, gameState) : "";
|
}))
|
||||||
const help = u.help(Math.max(1, lvl));
|
|
||||||
|
|
||||||
return {
|
|
||||||
u,
|
|
||||||
button,
|
|
||||||
html: `<div class="upgrade choice ${
|
|
||||||
(!lvl && gameState.upgrade_points && " ") ||
|
|
||||||
(lvl && "used") ||
|
|
||||||
"greyed-out"
|
|
||||||
}" >
|
|
||||||
${icons["icon:" + u.id]}
|
|
||||||
<p data-tooltip="${escapeAttribute(lvl ? help : u.fullHelp(Math.max(1, lvl)))}">
|
|
||||||
<strong>${u.name}</strong> ${lvlInfo}
|
|
||||||
${lvl ? "" : help}
|
|
||||||
</p>
|
|
||||||
${button}
|
|
||||||
</div>`,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
const forcePick =
|
const forcePick = !![...upgradesActions, ...addPerkActions].find(a => !a.disabled)
|
||||||
gameState.upgrade_points > 0 && !!actions.find((a) => a.button !== "");
|
|
||||||
|
|
||||||
const upgradeId = await requiredAsyncAlert<PerkId | null>({
|
const upgradeId = await requiredAsyncAlert<PerkId | null>({
|
||||||
title: t("level_up.title", {
|
title: t("level_up.title", {
|
||||||
|
@ -186,11 +156,10 @@ export async function openUpgradesPicker(gameState: GameState) {
|
||||||
},
|
},
|
||||||
|
|
||||||
t("level_up.upgrade_perks"),
|
t("level_up.upgrade_perks"),
|
||||||
|
...upgradesActions,
|
||||||
...actions.filter((a) => gameState.perks[a.u.id]).map((a) => a.html),
|
|
||||||
|
|
||||||
t("level_up.add_perks"),
|
t("level_up.add_perks"),
|
||||||
...actions.filter((a) => !gameState.perks[a.u.id]).map((a) => a.html),
|
...addPerkActions,
|
||||||
|
|
||||||
t("level_up.challenges.intro"),
|
t("level_up.challenges.intro"),
|
||||||
...medals,
|
...medals,
|
||||||
|
|
|
@ -98,9 +98,6 @@ export function render(gameState: GameState) {
|
||||||
<span class="${(gameState.levelTime < levelTimeBest * 1000 && "great") || (gameState.levelTime < levelTimeGood * 1000 && "good") || ""}" data-tooltip="${t("play.stats.levelTime")}">
|
<span class="${(gameState.levelTime < levelTimeBest * 1000 && "great") || (gameState.levelTime < levelTimeGood * 1000 && "good") || ""}" data-tooltip="${t("play.stats.levelTime")}">
|
||||||
${Math.ceil(gameState.levelTime / 1000)}s
|
${Math.ceil(gameState.levelTime / 1000)}s
|
||||||
</span><span> / </span>
|
</span><span> / </span>
|
||||||
<span class="${(gameState.levelWallBounces < wallBouncedBest && "great") || (gameState.levelWallBounces < wallBouncedGood && "good") || ""}" data-tooltip="${t("play.stats.levelWallBounces")}">
|
|
||||||
${gameState.levelWallBounces} B
|
|
||||||
</span><span> / </span>
|
|
||||||
<span class="${(gameState.levelMisses < missesBest && "great") || (gameState.levelMisses < missesGood && "good") || ""}" data-tooltip="${t("play.stats.levelMisses")}">
|
<span class="${(gameState.levelMisses < missesBest && "great") || (gameState.levelMisses < missesGood && "good") || ""}" data-tooltip="${t("play.stats.levelMisses")}">
|
||||||
${gameState.levelMisses} M
|
${gameState.levelMisses} M
|
||||||
</span><span> / </span>
|
</span><span> / </span>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue