From c1fe94a630a88c4f7203d54f34985c109030791c Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 19 Aug 2023 15:32:48 +0200 Subject: translations --- resources/js/game.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'resources/js/game.js') diff --git a/resources/js/game.js b/resources/js/game.js index 833265e..1a95ce4 100644 --- a/resources/js/game.js +++ b/resources/js/game.js @@ -38,8 +38,7 @@ const Game = { Memory.state.player.activeMonster.levelUp(); } if (Memory.state.player.activeMonster.canEvolve()) { - await fetchMonster(Memory.state.player.activeMonster.evolutions[0].monster_slug); - Memory.state.player.activeMonster.evolve(); + await Game.evolveMonster(Memory.state.player.activeMonster); } await Game.spawnOpponentMonster(); @@ -63,6 +62,7 @@ const Game = { // recharge if (technique.isRecharging()) { const feedbackNode = UI.createActionFeedback('recharge'); + feedbackNode.classList.add('recharge'); UI.drawActionFeedback(feedbackNode); canUse = false; @@ -300,6 +300,14 @@ const Game = { }); }, + /** + * @param {Monster} monster + */ + async evolveMonster (monster) { + await fetchMonster(monster.evolutions[0].monster_slug); + monster.evolve(monster.evolutions[0]); + }, + async spawnOpponentMonster () { Memory.state.opponent.activeMonster = await fetchMonster(DB.allMonsters[Math.floor(Math.random() * DB.allMonsters.length)]); Memory.state.opponent.activeMonster.level = Math.ceil(Math.random() * Memory.state.player.activeMonster.level); -- cgit v1.2.3