mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-23 21:46:15 -04:00
wip
This commit is contained in:
parent
ac2100860f
commit
2f51f83514
6 changed files with 96 additions and 60 deletions
17
src/game.ts
17
src/game.ts
|
@ -839,18 +839,19 @@ async function openUnlocksList() {
|
|||
};
|
||||
});
|
||||
|
||||
const percentUnlock = Math.round(
|
||||
([...upgradeActions, ...levelActions].filter((a) => !a.disabled).length /
|
||||
(upgradeActions.length + levelActions.length)) *
|
||||
100,
|
||||
);
|
||||
const tryOn = await asyncAlert<RunParams>({
|
||||
title: t("unlocks.title", { percentUnlock }),
|
||||
title: t("unlocks.title_upgrades", {
|
||||
unlocked:upgradeActions.filter((a) => !a.disabled).length,
|
||||
out_of:upgradeActions.length
|
||||
}),
|
||||
content: [
|
||||
`<p>${t("unlocks.intro", { ts })}
|
||||
${percentUnlock < 100 ? t("unlocks.greyed_out_help") : ""}</p> `,
|
||||
${upgradeActions.find(u=>u.disabled)? t("unlocks.greyed_out_help") : ""}</p> `,
|
||||
...upgradeActions,
|
||||
t("unlocks.level"),
|
||||
t("unlocks.level",{
|
||||
unlocked:levelActions.filter((a) => !a.disabled).length,
|
||||
out_of:levelActions.length
|
||||
}),
|
||||
...levelActions,
|
||||
],
|
||||
allowClose: true,
|
||||
|
|
|
@ -4,6 +4,7 @@ import { t } from "./i18n/i18n";
|
|||
import { brickAt } from "./level_editor/levels_editor_util";
|
||||
import { clamp } from "./pure_functions";
|
||||
import {isOptionOn} from "./options";
|
||||
import {rawUpgrades} from "./upgrades";
|
||||
|
||||
export function describeLevel(level: Level) {
|
||||
let bricks = 0,
|
||||
|
@ -272,3 +273,33 @@ export function highScoreText( ) {
|
|||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
export function unlockCondition(levelIndex:number){
|
||||
if(levelIndex<7){
|
||||
return {}
|
||||
}
|
||||
if(levelIndex<20){
|
||||
return {
|
||||
minScore:100*levelIndex
|
||||
}
|
||||
}
|
||||
const excluded:PerkId[]=[
|
||||
'extra_levels','extra_life', "one_more_choice", "instant_upgrade"
|
||||
]
|
||||
|
||||
const possibletargets = rawUpgrades.slice(0,Math.floor(levelIndex/2))
|
||||
.map(u=>u.id)
|
||||
.filter(u=>!excluded.includes(u))
|
||||
.sort((a,b)=>Math.random()-0.5)
|
||||
|
||||
const length=Math.ceil(levelIndex/30)
|
||||
|
||||
return {
|
||||
minScore:100*levelIndex*Math.pow(1.02,levelIndex),
|
||||
withUpgrades : possibletargets.slice(0,length),
|
||||
withoutUpgrades : possibletargets.slice(length,length+length),
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -87,6 +87,21 @@
|
|||
<folder_node>
|
||||
<name>gameOver</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>creative</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>cumulative_total</name>
|
||||
<description/>
|
||||
|
@ -320,21 +335,6 @@
|
|||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>loops</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>total_score</name>
|
||||
<description/>
|
||||
|
@ -367,21 +367,6 @@
|
|||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<concept_node>
|
||||
<name>test_run</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>unlocked_count</name>
|
||||
<description/>
|
||||
|
@ -2193,7 +2178,7 @@
|
|||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
|
@ -2213,7 +2198,7 @@
|
|||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>title</name>
|
||||
<name>title_upgrades</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
|
@ -2223,7 +2208,7 @@
|
|||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"confirmRestart.text": "You're about to start a new game, is that really what you wanted ?",
|
||||
"confirmRestart.title": "Start a new game ?",
|
||||
"confirmRestart.yes": "Restart game",
|
||||
"gameOver.creative": "This is a test game, its score is not recorded.",
|
||||
"gameOver.cumulative_total": "Your total cumulative score went from {{startTs}} to {{endTs}}.",
|
||||
"gameOver.lost.summary": "You dropped the ball after catching {{score}} coins.",
|
||||
"gameOver.lost.title": "Game Over",
|
||||
|
@ -18,10 +19,8 @@
|
|||
"gameOver.stats.hit_rate": "Hit rate",
|
||||
"gameOver.stats.intro": "Find below your game statistics compared to your {{count}} best games.",
|
||||
"gameOver.stats.level_reached": "Level reached",
|
||||
"gameOver.stats.loops": "Loops",
|
||||
"gameOver.stats.total_score": "Total score",
|
||||
"gameOver.stats.upgrades_applied": "Upgrades applied",
|
||||
"gameOver.test_run": "This is a test game, its score is not recorded.",
|
||||
"gameOver.unlocked_count": "You unlocked {{count}} items :",
|
||||
"gameOver.win.summary": "This game is over. You stashed {{score}} coins. ",
|
||||
"gameOver.win.title": "You completed this game",
|
||||
|
@ -139,9 +138,9 @@
|
|||
"score_panel.upgrades_picked": "Upgrades picked so far : ",
|
||||
"unlocks.greyed_out_help": "The greyed out ones can be unlocked by increasing your total score. The total score increases every time you score in game.",
|
||||
"unlocks.intro": "Your total score is {{ts}}. Below are all the upgrades and levels the games has to offer. Click an upgrade or level below to start a game with it.",
|
||||
"unlocks.level": "Here are all the game levels, click one to start a game with that starting level. ",
|
||||
"unlocks.level": "<h2>You unlocked {{unlocked}} levels out of {{out_of}}</h2>\n<p>Here are all the game levels, click one to start a game with that starting level. </p> ",
|
||||
"unlocks.level_description": "A {{size}}x{{size}} level with {{bricks}} bricks, {{colors}} colors and {{bombs}} bombs.",
|
||||
"unlocks.title": "You unlocked {{percentUnlock}}% of the game. ",
|
||||
"unlocks.title_upgrades": "You unlocked {{unlocked}} upgrades out of {{out_of}}",
|
||||
"upgrades.addiction.fullHelp": "The countdown only starts after breaking the first brick of each level. It stops as soon as all bricks are destroyed.",
|
||||
"upgrades.addiction.help": "+{{lvl}} combo / brick, combo resets {{delay}}s after breaking a brick. ",
|
||||
"upgrades.addiction.name": "Addiction",
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"confirmRestart.text": "Vous êtes sur le point de commencer une nouvelle partie, est-ce vraiment ce que vous vouliez ?",
|
||||
"confirmRestart.title": "Démarrer une nouvelle partie ?",
|
||||
"confirmRestart.yes": "Commencer une nouvelle partie",
|
||||
"gameOver.creative": "Cette partie de test et son score ne sont pas enregistrés.",
|
||||
"gameOver.cumulative_total": "Votre score total cumulé est passé de {{startTs}} à {{endTs}}.",
|
||||
"gameOver.lost.summary": "Vous avez fait tomber la balle après avoir attrapé {{score}} pièces.",
|
||||
"gameOver.lost.title": "Balle perdue",
|
||||
|
@ -18,10 +19,8 @@
|
|||
"gameOver.stats.hit_rate": "Précision",
|
||||
"gameOver.stats.intro": "Vous trouverez ci-dessous les statistiques de cette partie comparées à vos {{count}} meilleures parties.",
|
||||
"gameOver.stats.level_reached": "Niveau atteint",
|
||||
"gameOver.stats.loops": "Boucles",
|
||||
"gameOver.stats.total_score": "Score total",
|
||||
"gameOver.stats.upgrades_applied": "Mises à jour appliquées",
|
||||
"gameOver.test_run": "Cette partie de test et son score ne sont pas enregistrés.",
|
||||
"gameOver.unlocked_count": "Vous avez débloqué {{count}} objet(s) :",
|
||||
"gameOver.win.summary": "Cette partie est terminée. Vous avez accumulé {{score}} pièces. ",
|
||||
"gameOver.win.title": "Vous avez terminé cette partie",
|
||||
|
@ -139,9 +138,9 @@
|
|||
"score_panel.upgrades_picked": "Améliorations choisies jusqu'à présent :",
|
||||
"unlocks.greyed_out_help": "Les éléments grisées peuvent être débloquées en augmentant votre score total. Le score total augmente à chaque fois que vous marquez des points dans le jeu.",
|
||||
"unlocks.intro": "Votre score total est de {{ts}}. Vous trouverez ci-dessous toutes les améliorations et tous les niveaux que le jeu peut offrir. Cliquez sur l'un d'entre eux pour commencer une nouvelle partie. ",
|
||||
"unlocks.level": "Voici tous les niveaux du jeu. Cliquez sur un niveau pour commencer une nouvelle partie avec ce niveau de départ. ",
|
||||
"unlocks.level": "<h2>Vous avez débloqué {{unlocked}} niveaux sur {{out_of}}</h2>\n<p>Voici tous les niveaux du jeu, cliquez sur l'un d'eux pour démarrer une partie avec ce niveau de départ. </p> ",
|
||||
"unlocks.level_description": "Un niveau {{size}}x{{size}} avec {{bricks}} briques, {{colors}} couleurs et {{bombs}} bombes.",
|
||||
"unlocks.title": "Vous avez débloqué {{percentUnlock}}% du jeu.",
|
||||
"unlocks.title_upgrades": "Vous avez débloqué {{unlocked}} améliorations sur {{out_of}}",
|
||||
"upgrades.addiction.fullHelp": "Le décompte ne commence qu'à parti de la destruction de la première brique du niveau, et s'arrête dès qu'il n'y a plus de briques. ",
|
||||
"upgrades.addiction.help": "+{{lvl}} combo / brique, le combo RAZ après {{delay}}s sans casser de briques",
|
||||
"upgrades.addiction.name": "Addiction",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue