summaryrefslogtreecommitdiff
path: root/resources/js/main.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-19 13:18:54 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-19 13:18:54 +0200
commit218da95a4b387ee5ac25f168d1529419039f2e54 (patch)
tree21375d6aae287da413cbfc1002c2c8eeb7bba1ed /resources/js/main.js
parent91d048ef0f994446aaee91e3afcbd99788e439d7 (diff)
refactor: enemy -> opponent, State.monsters~ -> State.Trainer.monsters
Diffstat (limited to 'resources/js/main.js')
-rw-r--r--resources/js/main.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/resources/js/main.js b/resources/js/main.js
index d5bf6fe..a3568bf 100644
--- a/resources/js/main.js
+++ b/resources/js/main.js
@@ -3,10 +3,13 @@
const possibleStarterMonsters = ['budaye', 'dollfin', 'grintot', 'ignibus', 'memnomnom'];
- // state.enemy.monster = await fetchMonster('grintot');
- state.enemy.monster = await fetchMonster(possibleStarterMonsters[Math.round(Math.random() * (possibleStarterMonsters.length - 1))]);
+ Memory.state.opponent = new Trainer();
+ Memory.state.opponent.monsters = [
+ await fetchMonster(possibleStarterMonsters[Math.round(Math.random() * (possibleStarterMonsters.length - 1))])
+ ];
- state.partyMonsters = [
+ Memory.state.player = new Trainer();
+ Memory.state.player.monsters = [
await fetchMonster('dollfin'),
await fetchMonster(possibleStarterMonsters[Math.round(Math.random() * (possibleStarterMonsters.length - 1))]),
await fetchMonster('corvix'),
@@ -19,12 +22,10 @@
await fetchMonster('dragarbor'),
await fetchMonster('mk01_omega'),
await fetchMonster('jelillow'),
+ await fetchMonster('picc'),
];
- state.activeMonster = state.partyMonsters[0];
- state.activeTechnique = state.activeMonster.activeTechniques[0];
-
- state.inventory = [
+ Memory.state.player.inventory = [
new InventoryItem(await fetchItem('tuxeball')),
new InventoryItem(await fetchItem('ancient_egg')),
new InventoryItem(await fetchItem('sweet_sand')),
@@ -41,7 +42,11 @@
new InventoryItem(await fetchItem('revive')),
];
- UI.drawEnemyMonster();
+ Memory.state.opponent.activeMonster = Memory.state.opponent.monsters[0];
+ Memory.state.player.activeMonster = Memory.state.player.monsters[0];
+ Memory.state.activeTechnique = Memory.state.player.activeMonster.activeTechniques[0];
+
+ UI.drawOpponentMonster();
UI.drawActiveMonster();
UI.drawActiveTechniques();
})();