From 416d666b308ab6679b5c7ce97664492664165e88 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Fri, 24 May 2024 18:43:38 -0500 Subject: [PATCH] Update Biome Text Labels and Variable Name (#1340) * Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object. * Revert "Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object." This reverts commit 0f87000aa46ebb0a6d1fc628dd56ac39ef7229db. * Reverted changes, added biome text to line one and renamed wavecounttext to a more standard name. * Update battle-scene.ts * Update Formatting * Update Enums * Revert * Update overrides.ts * Update battle-scene.ts --------- Co-authored-by: Jon Studders --- src/battle-scene.ts | 30 +++++++++++++++--------------- src/data/biomes.ts | 4 +--- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index e3df4275af9..8cd42d3c89e 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -151,8 +151,8 @@ export default class BattleScene extends SceneBase { public money: integer; public pokemonInfoContainer: PokemonInfoContainer; private party: PlayerPokemon[]; - private lineOneText: Phaser.GameObjects.Text; - private waveCountText: Phaser.GameObjects.Text; + /** Combined Biome and Wave count text */ + private biomeWaveText: Phaser.GameObjects.Text; private moneyText: Phaser.GameObjects.Text; private scoreText: Phaser.GameObjects.Text; private luckLabelText: Phaser.GameObjects.Text; @@ -351,9 +351,9 @@ export default class BattleScene extends SceneBase { this.candyBar.setup(); this.fieldUI.add(this.candyBar); - this.lineOneText = addTextObject(this, (this.game.canvas.width / 6) - 2, 0, startingWave.toString(), TextStyle.BATTLE_INFO); - this.lineOneText.setOrigin(1, 0); - this.fieldUI.add(this.lineOneText); + this.biomeWaveText = addTextObject(this, (this.game.canvas.width / 6) - 2, 0, startingWave.toString(), TextStyle.BATTLE_INFO); + this.biomeWaveText.setOrigin(1, 0); + this.fieldUI.add(this.biomeWaveText); this.moneyText = addTextObject(this, (this.game.canvas.width / 6) - 2, 0, "", TextStyle.MONEY); this.moneyText.setOrigin(1, 0); @@ -481,7 +481,7 @@ export default class BattleScene extends SceneBase { } }); - this.updateLineOneText(); + this.updateBiomeWaveText(); this.updateMoneyText(); this.updateScoreText(); } @@ -795,8 +795,8 @@ export default class BattleScene extends SceneBase { this.currentBattle = null; - this.lineOneText.setText(startingWave.toString()); - this.lineOneText.setVisible(false); + this.biomeWaveText.setText(startingWave.toString()); + this.biomeWaveText.setVisible(false); this.updateMoneyText(); this.moneyText.setVisible(false); @@ -1245,13 +1245,13 @@ export default class BattleScene extends SceneBase { }); } - updateLineOneText(): void { + updateBiomeWaveText(): void { const isBoss = !(this.currentBattle.waveIndex % 10); const biomeString: string = getBiomeName(this.arena.biomeType); - this.lineOneText.setText( biomeString + " - " + this.currentBattle.waveIndex.toString()); - this.lineOneText.setColor(!isBoss ? "#404040" : "#f89890"); - this.lineOneText.setShadowColor(!isBoss ? "#ded6b5" : "#984038"); - this.lineOneText.setVisible(true); + this.biomeWaveText.setText( biomeString + " - " + this.currentBattle.waveIndex.toString()); + this.biomeWaveText.setColor(!isBoss ? "#404040" : "#f89890"); + this.biomeWaveText.setShadowColor(!isBoss ? "#ded6b5" : "#984038"); + this.biomeWaveText.setVisible(true); } updateMoneyText(): void { @@ -1299,8 +1299,8 @@ export default class BattleScene extends SceneBase { updateUIPositions(): void { const enemyModifierCount = this.enemyModifiers.filter(m => m.isIconVisible(this)).length; - this.lineOneText.setY(-(this.game.canvas.height / 6) + (enemyModifierCount ? enemyModifierCount <= 12 ? 15 : 24 : 0)); - this.moneyText.setY(this.lineOneText.y + 10); + this.biomeWaveText.setY(-(this.game.canvas.height / 6) + (enemyModifierCount ? enemyModifierCount <= 12 ? 15 : 24 : 0)); + this.moneyText.setY(this.biomeWaveText.y + 10); this.scoreText.setY(this.moneyText.y + 10); [ this.luckLabelText, this.luckText ].map(l => l.setY((this.scoreText.visible ? this.scoreText : this.moneyText).y + 10)); const offsetY = (this.scoreText.visible ? this.scoreText : this.moneyText).y + 15; diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 2b93de49806..770101607fa 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -18,10 +18,8 @@ export function getBiomeName(biome: Biome | -1) { return "Ancient Ruins"; case Biome.ABYSS: return "The Abyss"; - case Biome.SPACE: - return "Stratosphere"; case Biome.END: - return "Final Destination"; + return "???"; default: return Utils.toReadableString(Biome[biome]); }