diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-19 15:32:48 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-19 15:32:48 +0200 |
commit | c1fe94a630a88c4f7203d54f34985c109030791c (patch) | |
tree | e6e75fe468dddddcbe440cbd356ddaaaf605144f /resources/js/game.js | |
parent | 218da95a4b387ee5ac25f168d1529419039f2e54 (diff) |
translations
Diffstat (limited to 'resources/js/game.js')
-rw-r--r-- | resources/js/game.js | 12 |
1 files changed, 10 insertions, 2 deletions
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); |