mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 21:16:14 -04:00
Clairvoyant perks, hps adjusments
This commit is contained in:
parent
3745b527f5
commit
af02565bf1
12 changed files with 238 additions and 104 deletions
|
@ -989,5 +989,12 @@
|
|||
"bricks": "___t______tt__tttttt_ttttttttttttt____tt_____t___",
|
||||
"svg": null,
|
||||
"color": ""
|
||||
},
|
||||
{
|
||||
"name": "icon:clairvoyant",
|
||||
"size": 9,
|
||||
"bricks": "__y___y__y__y_y__y_y__t__y____ttt_____tWWWt___tWWgWWt_tttWWWttt__________________",
|
||||
"svg": null,
|
||||
"color": ""
|
||||
}
|
||||
]
|
||||
]
|
|
@ -14,7 +14,7 @@ import {
|
|||
import { getAudioContext, playPendingSounds } from "./sounds";
|
||||
import {
|
||||
currentLevelInfo,
|
||||
getRowColIndex,
|
||||
getRowColIndex, levelsListHTMl,
|
||||
max_levels,
|
||||
pickedUpgradesHTMl,
|
||||
} from "./game_utils";
|
||||
|
@ -271,7 +271,10 @@ export async function openUpgradesPicker(gameState: GameState) {
|
|||
wallHitsGain,
|
||||
compliment,
|
||||
})}
|
||||
</p>`,
|
||||
</p>
|
||||
|
||||
<p>${levelsListHTMl(gameState)}</p>
|
||||
`,
|
||||
allowClose: false,
|
||||
textAfterButtons,
|
||||
})) as PerkId;
|
||||
|
@ -432,6 +435,8 @@ async function openScorePanel() {
|
|||
${gameState.isCreativeModeRun ? `<p>${t("score_panel.test_run")}</p>` : ""}
|
||||
<p>${t("score_panel.upgrades_picked")}</p>
|
||||
<p>${pickedUpgradesHTMl(gameState)}</p>
|
||||
|
||||
<p>${levelsListHTMl(gameState)}</p>
|
||||
`,
|
||||
allowClose: true,
|
||||
});
|
||||
|
|
|
@ -49,6 +49,7 @@ import {
|
|||
} from "./game";
|
||||
import { stopRecording } from "./recording";
|
||||
import { isOptionOn } from "./options";
|
||||
import {use} from "react";
|
||||
|
||||
export function setMousePos(gameState: GameState, x: number) {
|
||||
// Sets the puck position, and updates the ball position if they are supposed to follow it
|
||||
|
@ -97,7 +98,7 @@ export function resetBalls(gameState: GameState) {
|
|||
|
||||
sx: 0,
|
||||
sy: 0,
|
||||
piercedSinceBounce: 0,
|
||||
piercePoints: gameState.perks.pierce*3,
|
||||
hitSinceBounce: 0,
|
||||
brokenSinceBounce: 0,
|
||||
hitItem: [],
|
||||
|
@ -129,7 +130,7 @@ export function putBallsAtPuck(gameState: GameState) {
|
|||
ball.hitItem = [];
|
||||
ball.hitSinceBounce = 0;
|
||||
ball.brokenSinceBounce = 0;
|
||||
ball.piercedSinceBounce = 0;
|
||||
ball.piercePoints = gameState.perks.pierce * 3;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -258,10 +259,6 @@ export function explosionAt(
|
|||
const size = 1 + gameState.perks.bigger_explosions;
|
||||
schedulGameSound(gameState, "explode", ball.x, 1);
|
||||
if (index !== -1) {
|
||||
if (gameState.bricks[index] == "black") {
|
||||
setBrick(gameState, index, "")
|
||||
}
|
||||
|
||||
const col = index % gameState.gridSize;
|
||||
const row = Math.floor(index / gameState.gridSize);
|
||||
// Break bricks around
|
||||
|
@ -271,8 +268,9 @@ export function explosionAt(
|
|||
if (gameState.bricks[i] && i !== -1) {
|
||||
// Study bricks resist explosions too
|
||||
gameState.brickHP[i]--
|
||||
if (gameState.brickHP<=0)
|
||||
explodeBrick(gameState, i, ball, true);
|
||||
if (gameState.brickHP<=0) {
|
||||
explodeBrick(gameState, i, ball, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -315,6 +313,7 @@ export function explodeBrick(
|
|||
if (color === "black") {
|
||||
const x = brickCenterX(gameState, index),
|
||||
y = brickCenterY(gameState, index);
|
||||
setBrick(gameState, index, '')
|
||||
explosionAt(gameState, index, x, y, ball);
|
||||
} else if (color) {
|
||||
// Even if it bounces we don't want to count that as a miss
|
||||
|
@ -684,7 +683,7 @@ export function attract(gameState: GameState, a: Ball, b: Ball, power: number) {
|
|||
}
|
||||
|
||||
export function coinBrickHitCheck(gameState: GameState, coin: Coin) {
|
||||
if (gameState.perks.ghost_coins) return undefined;
|
||||
|
||||
// Make ball/coin bonce, and return bricks that were hit
|
||||
const radius = coin.size / 2;
|
||||
const { x, y, previousX, previousY } = coin;
|
||||
|
@ -696,28 +695,30 @@ export function coinBrickHitCheck(gameState: GameState, coin: Coin) {
|
|||
typeof hhit == "undefined" &&
|
||||
hitsSomething(x, y, radius)) ||
|
||||
undefined;
|
||||
if(!gameState.perks.ghost_coins){
|
||||
|
||||
if (typeof vhit !== "undefined" || typeof chit !== "undefined") {
|
||||
coin.y = coin.previousY;
|
||||
coin.vy *= -1;
|
||||
if (typeof vhit !== "undefined" || typeof chit !== "undefined") {
|
||||
coin.y = coin.previousY;
|
||||
coin.vy *= -1;
|
||||
|
||||
// Roll on corners
|
||||
const leftHit = gameState.bricks[brickIndex(x - radius, y + radius)];
|
||||
const rightHit = gameState.bricks[brickIndex(x + radius, y + radius)];
|
||||
// Roll on corners
|
||||
const leftHit = gameState.bricks[brickIndex(x - radius, y + radius)];
|
||||
const rightHit = gameState.bricks[brickIndex(x + radius, y + radius)];
|
||||
|
||||
if (leftHit && !rightHit) {
|
||||
coin.vx += 1;
|
||||
coin.sa -= 1;
|
||||
if (leftHit && !rightHit) {
|
||||
coin.vx += 1;
|
||||
coin.sa -= 1;
|
||||
}
|
||||
if (!leftHit && rightHit) {
|
||||
coin.vx -= 1;
|
||||
coin.sa += 1;
|
||||
}
|
||||
}
|
||||
if (!leftHit && rightHit) {
|
||||
coin.vx -= 1;
|
||||
coin.sa += 1;
|
||||
if (typeof hhit !== "undefined" || typeof chit !== "undefined") {
|
||||
coin.x = coin.previousX;
|
||||
coin.vx *= -1;
|
||||
}
|
||||
}
|
||||
if (typeof hhit !== "undefined" || typeof chit !== "undefined") {
|
||||
coin.x = coin.previousX;
|
||||
coin.vx *= -1;
|
||||
}
|
||||
return vhit ?? hhit ?? chit;
|
||||
}
|
||||
|
||||
|
@ -963,7 +964,8 @@ export function gameStateTick(
|
|||
schedulGameSound(gameState, "colorChange", coin.x, 0.3);
|
||||
}
|
||||
}
|
||||
if (typeof hitBrick !== "undefined" || hitBorder) {
|
||||
|
||||
if ((!gameState.perks.ghost_coins && typeof hitBrick !== "undefined") || hitBorder) {
|
||||
coin.vx *= 0.8;
|
||||
coin.vy *= 0.8;
|
||||
coin.sa *= 0.9;
|
||||
|
@ -1408,7 +1410,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
});
|
||||
}
|
||||
ball.hitItem = [];
|
||||
if (!ball.hitSinceBounce) {
|
||||
if (!ball.hitSinceBounce && gameState.bricks.find(i=>i)) {
|
||||
gameState.runStatistics.misses++;
|
||||
if (gameState.perks.forgiving) {
|
||||
const loss = Math.floor(
|
||||
|
@ -1434,7 +1436,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
ball.hitSinceBounce = 0;
|
||||
ball.brokenSinceBounce = 0;
|
||||
ball.sapperUses = 0;
|
||||
ball.piercedSinceBounce = 0;
|
||||
ball.piercePoints = gameState.perks.pierce*3;
|
||||
}
|
||||
|
||||
const lostOnSides =
|
||||
|
@ -1468,21 +1470,21 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
const hitBrick = vhit ?? hhit ?? chit;
|
||||
|
||||
if (typeof hitBrick !== "undefined") {
|
||||
// TODO higher damage balls
|
||||
gameState.brickHP[hitBrick]--
|
||||
let sturdyBounce = gameState.brickHP[hitBrick]
|
||||
|
||||
ball.hitSinceBounce++;
|
||||
let pierce = false;
|
||||
if (sturdyBounce) {
|
||||
schedulGameSound(gameState, "wallBeep", x, 1);
|
||||
} else if (shouldPierceByColor(gameState, vhit, hhit, chit)) {
|
||||
pierce = true;
|
||||
} else if (ball.piercedSinceBounce < gameState.perks.pierce * 3) {
|
||||
pierce = true;
|
||||
ball.piercedSinceBounce++;
|
||||
}
|
||||
let damage= 1+(shouldPierceByColor(gameState, vhit, hhit, chit) ? gameState.perks.pierce_color :0)
|
||||
|
||||
gameState.brickHP[hitBrick]-=damage
|
||||
|
||||
const used = Math.min(ball.piercePoints, Math.max(1,gameState.brickHP[hitBrick]))
|
||||
gameState.brickHP[hitBrick]-=used
|
||||
ball.piercePoints-=used
|
||||
|
||||
if(gameState.brickHP[hitBrick]<0){
|
||||
gameState.brickHP[hitBrick]=0
|
||||
pierce=true
|
||||
}
|
||||
if (typeof vhit !== "undefined" || typeof chit !== "undefined") {
|
||||
if (!pierce) {
|
||||
ball.y = ball.previousY;
|
||||
|
@ -1496,7 +1498,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!sturdyBounce) {
|
||||
if (!gameState.brickHP[hitBrick]) {
|
||||
const initialBrickColor = gameState.bricks[hitBrick];
|
||||
ball.brokenSinceBounce++;
|
||||
|
||||
|
@ -1513,8 +1515,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
}
|
||||
|
||||
if (!isOptionOn("basic")) {
|
||||
const remainingPierce =
|
||||
gameState.perks.pierce * 3 - ball.piercedSinceBounce;
|
||||
const remainingPierce = ball.piercePoints;
|
||||
const remainingSapper = ball.sapperUses < gameState.perks.sapper;
|
||||
const extraCombo = gameState.combo - 1;
|
||||
if (
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Ball, GameState, PerkId, PerksMap } from "./types";
|
||||
import { icons, upgrades } from "./loadGameData";
|
||||
import {t} from "./i18n/i18n";
|
||||
|
||||
export function getMajorityValue(arr: string[]): string {
|
||||
const count: { [k: string]: number } = {};
|
||||
|
@ -64,6 +65,14 @@ export function pickedUpgradesHTMl(gameState: GameState) {
|
|||
}
|
||||
return list;
|
||||
}
|
||||
export function levelsListHTMl(gameState: GameState) {
|
||||
if(!gameState.perks.clairvoyant) return ''
|
||||
let list = "";
|
||||
for (let i=0;i<max_levels(gameState);i++) {
|
||||
list += `<span style="opacity: ${i>=gameState.currentLevel ? 1:0.2}">${icons[gameState.runLevels[i].name]}</span>` ;
|
||||
}
|
||||
return `<p>${t('score_panel.upcoming_levels')}</p><p>${list}</p>`;
|
||||
}
|
||||
|
||||
export function currentLevelInfo(gameState: GameState) {
|
||||
return gameState.runLevels[
|
||||
|
|
|
@ -1552,6 +1552,21 @@
|
|||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>upcoming_levels</name>
|
||||
<description/>
|
||||
<comment/>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>upgrades_picked</name>
|
||||
<description/>
|
||||
|
@ -2032,6 +2047,56 @@
|
|||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>clairvoyant</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>fullHelp</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>help</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>name</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>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>coin_magnet</name>
|
||||
<children>
|
||||
|
@ -2872,11 +2937,11 @@
|
|||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
|
@ -2887,11 +2952,11 @@
|
|||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
|
@ -2902,11 +2967,11 @@
|
|||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-FR</language>
|
||||
<approved>true</approved>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
"score_panel.resume_help": "Return to your run",
|
||||
"score_panel.test_run": "This is a test run, score is not recorded permanently",
|
||||
"score_panel.title": "{{score}} points at level {{level}}/{{max}} ",
|
||||
"score_panel.upcoming_levels": "Upcoming levels :",
|
||||
"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.",
|
||||
|
@ -127,6 +128,9 @@
|
|||
"upgrades.bigger_puck.fullHelp": "A bigger puck makes it easier to never miss the ball and to catch more coins, and also to precisely angle the bounces (the ball's angle only depends on where it hits the puck). \n However, a large puck is harder to use around the sides of the level, and will make it sometimes unavoidable to miss (not hit anything) which comes with downsides. ",
|
||||
"upgrades.bigger_puck.help": "Easily catch more coins.",
|
||||
"upgrades.bigger_puck.name": "Bigger puck",
|
||||
"upgrades.clairvoyant.fullHelp": "Helps you pick the right upgrades and understand what's going on with sturdy bricks. ",
|
||||
"upgrades.clairvoyant.help": "See upcoming levels list and bricks HP",
|
||||
"upgrades.clairvoyant.name": "Clairvoyant",
|
||||
"upgrades.coin_magnet.fullHelp": "Directs the coins to the puck. The effect is stronger if the coin is close to it already. Catching 90% or 100% of coins bring special bonuses in the game. \n\nAnother way to catch more coins is to hit bricks from the bottom. The ball's speed and direction impacts the spawned coin's velocity. ",
|
||||
"upgrades.coin_magnet.help": "Puck attracts coins",
|
||||
"upgrades.coin_magnet.help_plural": "Stronger effect on the coins",
|
||||
|
@ -186,8 +190,8 @@
|
|||
"upgrades.pierce.fullHelp": "The ball normally bounces as soon as it touches something. With this perk, it will continue its trajectory for up to 3 bricks broken. \nAfter that, it will bounce on the 4th brick, and you'll need to touch the puck to reset the counter.",
|
||||
"upgrades.pierce.help": "Ball pierces {{count}} bricks after a puck bounce",
|
||||
"upgrades.pierce.name": "Piercing",
|
||||
"upgrades.pierce_color.fullHelp": "Whenever a ball hits a brick of the same color, it will just go through unimpeded. \nOnce it reaches a brick of a different color, it will break it, take its color and bounce.",
|
||||
"upgrades.pierce_color.help": "Balls pierce bricks of their color",
|
||||
"upgrades.pierce_color.fullHelp": "Whenever a ball hits a brick of the same color, it will just go through unimpeded. \nOnce it reaches a brick of a different color, it will break it, take its color and bounce.\nIf you have sturdy bricks, the ball might still bounce off a brick of the same color.",
|
||||
"upgrades.pierce_color.help": "+{{lvl}} damage to bricks of the ball's color",
|
||||
"upgrades.pierce_color.name": "Color pierce",
|
||||
"upgrades.puck_repulse_ball.fullHelp": "When a ball gets close to the puck, it will start slowing down, and even potentially bouncing without touching the puck.",
|
||||
"upgrades.puck_repulse_ball.help": "Puck repulses balls",
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
"score_panel.resume_help": "Fermer cette fenêtre pour retourner au jeu",
|
||||
"score_panel.test_run": "Il s'agit d'une partie d'essai, le score n'est pas enregistré.",
|
||||
"score_panel.title": "{{score}} points au niveau {{level}}/{{max}} ",
|
||||
"score_panel.upcoming_levels": "Niveaux de la parties : ",
|
||||
"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.",
|
||||
|
@ -127,6 +128,9 @@
|
|||
"upgrades.bigger_puck.fullHelp": "Un grand palet permet de ne jamais rater la balle et d'attraper plus de pièces, ainsi que d'orienter précisément les rebonds (l'angle de la balle ne dépend que de l'endroit où elle touche le palet). Cependant, un grand palet est plus difficile à utiliser sur les côtés du niveau.",
|
||||
"upgrades.bigger_puck.help": "Attrapez facilement plus de pièces.",
|
||||
"upgrades.bigger_puck.name": "Palet plus grand",
|
||||
"upgrades.clairvoyant.fullHelp": "Vous aide à choisir les bonnes améliorations et à comprendre ce qu'il se passe avec \"briques solides\"",
|
||||
"upgrades.clairvoyant.help": "Révèle les niveaux à venir et les points de vie des briques",
|
||||
"upgrades.clairvoyant.name": "Clairvoyant",
|
||||
"upgrades.coin_magnet.fullHelp": "Dirige les pièces vers le palet. L'effet est plus fort si la pièce est déjà proche du palet. Attraper 90 % ou 100 % des pièces apporte des bonus spéciaux dans le jeu. Une autre façon d'attraper plus de pièces est de frapper les briques par le bas. La vitesse et la direction de la balle ont un impact sur la vitesse des pièces produites.",
|
||||
"upgrades.coin_magnet.help": "Le palet attire les pièces",
|
||||
"upgrades.coin_magnet.help_plural": "Effet plus marqué sur les pièces",
|
||||
|
@ -186,8 +190,8 @@
|
|||
"upgrades.pierce.fullHelp": "Normalement , la balle rebondit dès qu'elle touche une brique. Avec cette caractéristique, elle continuera sa trajectoire jusqu'à 3 briques cassées.\n\nAprès cela, elle rebondira sur la quatrième brique et vous devez toucher le palet pour remettre le compteur à zéro.",
|
||||
"upgrades.pierce.help": "La balle perce {{count}} briques après chaque rebond sur le palet",
|
||||
"upgrades.pierce.name": "Balle perçante",
|
||||
"upgrades.pierce_color.fullHelp": "Chaque fois qu'une balle touche une brique de la même couleur, elle la traverse sans encombre.\nLorsqu'elle atteint une brique de couleur différente, elle la casse, prend sa couleur et rebondit.",
|
||||
"upgrades.pierce_color.help": "Les balles transpercent les briques de leur couleur",
|
||||
"upgrades.pierce_color.fullHelp": "Chaque fois qu'une balle touche une brique de la même couleur, elle la traverse sans encombre.\nLorsqu'elle atteint une brique de couleur différente, elle la casse, prend sa couleur et rebondit. \nSi vous avez des briques solides, le fonctionnement est un peu différent. ",
|
||||
"upgrades.pierce_color.help": "+{{lvl}} dommage sur les briques de la couleur de la balle",
|
||||
"upgrades.pierce_color.name": "Perceur de couleur",
|
||||
"upgrades.puck_repulse_ball.fullHelp": "Lorsqu'une balle s'approche du palet, elle commence à ralentir, voire à rebondir sans toucher le palet. Beaucoup de choses sont liées à un passage par le palet dans le jeu, donc ça pourrait ouvrir des possibilités. ",
|
||||
"upgrades.puck_repulse_ball.help": "Le palet repousse les balles",
|
||||
|
|
|
@ -388,6 +388,8 @@ export function renderAllBricks() {
|
|||
gameState.perks.picky_eater &&
|
||||
!isOptionOn("basic");
|
||||
|
||||
const clairVoyance= gameState.perks.clairvoyant && gameState.brickHP.reduce((a,b)=>a+b,0)
|
||||
|
||||
const newKey =
|
||||
gameState.gameZoneWidth +
|
||||
"_" +
|
||||
|
@ -399,7 +401,7 @@ export function renderAllBricks() {
|
|||
gameState.ballsColor +
|
||||
"_" +
|
||||
gameState.perks.pierce_color +
|
||||
"_"+ gameState.brickHP.reduce((a,b)=>a+b,0);
|
||||
"_"+ clairVoyance;
|
||||
if (newKey !== cachedBricksRenderKey) {
|
||||
cachedBricksRenderKey = newKey;
|
||||
|
||||
|
@ -430,7 +432,7 @@ export function renderAllBricks() {
|
|||
|
||||
canctx.globalCompositeOperation = "source-over";
|
||||
drawBrick(canctx, color, (redBorder && "red") || color, x, y);
|
||||
if(gameState.brickHP[index]>1){
|
||||
if(gameState.brickHP[index]>1 && gameState.perks.clairvoyant){
|
||||
canctx.globalCompositeOperation="destination-out"
|
||||
drawText(canctx, gameState.brickHP[index].toString(), "white", gameState.puckHeight, x,y )
|
||||
}
|
||||
|
|
4
src/types.d.ts
vendored
4
src/types.d.ts
vendored
|
@ -94,8 +94,8 @@ export type Ball = {
|
|||
previousVY: number;
|
||||
sx: number;
|
||||
sy: number;
|
||||
// Uses of the pierce perk only
|
||||
piercedSinceBounce: number;
|
||||
// Ability to pierce N HP
|
||||
piercePoints: number;
|
||||
// Any bounce counts, even if brick resisted the hit
|
||||
hitSinceBounce: number;
|
||||
// Brick was really broken ,but could have been respawned as a bomb
|
||||
|
|
|
@ -275,9 +275,9 @@ export const rawUpgrades = [
|
|||
threshold: 15000,
|
||||
giftable: false,
|
||||
id: "pierce_color",
|
||||
max: 1,
|
||||
max: 4,
|
||||
name: t("upgrades.pierce_color.name"),
|
||||
help: (lvl: number) => t("upgrades.pierce_color.help"),
|
||||
help: (lvl: number) => t("upgrades.pierce_color.help",{lvl}),
|
||||
fullHelp: t("upgrades.pierce_color.fullHelp"),
|
||||
},
|
||||
{
|
||||
|
@ -575,4 +575,15 @@ export const rawUpgrades = [
|
|||
help: (lvl: number) => t("upgrades.passive_income.help"),
|
||||
fullHelp: t("upgrades.passive_income.fullHelp"),
|
||||
},
|
||||
{
|
||||
requires: "",
|
||||
rejects: "",
|
||||
threshold: 145000,
|
||||
giftable: false,
|
||||
id: "clairvoyant",
|
||||
max: 1,
|
||||
name: t("upgrades.clairvoyant.name"),
|
||||
help: (lvl: number) => t("upgrades.clairvoyant.help"),
|
||||
fullHelp: t("upgrades.clairvoyant.fullHelp"),
|
||||
},
|
||||
] as const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue