summaryrefslogtreecommitdiff
path: root/resources/js/main.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-20 20:48:29 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-20 20:48:29 +0200
commit43a28ad77190f2e55e2e6ba65a9a7b5b1f5dea6c (patch)
tree759b4f27a68e729df313b9f8370117d4a6fbae37 /resources/js/main.js
parentb227fc9c2ef361f8aa5ee2f24aa1ade6bc972a73 (diff)
area progression, item usage
Diffstat (limited to 'resources/js/main.js')
-rw-r--r--resources/js/main.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/resources/js/main.js b/resources/js/main.js
index 815d734..8622731 100644
--- a/resources/js/main.js
+++ b/resources/js/main.js
@@ -4,23 +4,26 @@
// Start Game
const possibleStarterMonsters = ['budaye', 'dollfin', 'grintot', 'ignibus', 'memnomnom'];
- Memory.state.player = new Trainer(
- [
+ Memory.state.player = new Trainer({
+ monsters: [
await fetchMonster(possibleStarterMonsters[Math.round(Math.random() * (possibleStarterMonsters.length - 1))]),
],
- [
- new InventoryItem(await fetchItem('tuxeball')),
+ inventory: [
+ new InventoryItem(await fetchItem('tuxeball'), 5),
new InventoryItem(await fetchItem('potion')),
]
- );
+ });
await Memory.state.player.initialize();
Memory.state.activeTechnique = Memory.state.player.activeMonster.activeTechniques[0];
+ Memory.state.activeBall = Memory.state.player.inventory[0]; // tuxeball
Memory.state.rivalMonster = await fetchMonster(possibleStarterMonsters[Math.round(Math.random() * (possibleStarterMonsters.length - 1))]);
const area = await fetchArea('paper-town');
- await Game.progressToArea(area);
+ await Game.jumpToArea(area);
+ await Game.encounterTrainer();
+ UI.drawStatus();
UI.drawActiveMonster();
UI.drawActiveTechniques();