diff --git a/scripts/e2e/client.mjs b/scripts/e2e/client.mjs index a66f7b5..5ce1691 100644 --- a/scripts/e2e/client.mjs +++ b/scripts/e2e/client.mjs @@ -53,5 +53,9 @@ const after = await call('village.show', { village_id: id }) log('after finish -> push received:', pushed, '| queue', after.data.queue.length, '| timber camp', JSON.stringify(after.data.buildings.find((b) => b.type === 'timber_camp'))) const map = await call('map.view', { world_id: dev.id, w: 41, h: 41 }) log('map.view ->', map.ok, 'centre', JSON.stringify(map.data.center), 'window', map.data.x, map.data.y, map.data.w, map.data.h, '| villages', map.data.villages.length, '| own', JSON.stringify(map.data.villages.find((v) => v.own)), '| barbarians', map.data.villages.filter((v) => !v.player).length) +const book = await call('quest.index', { village_id: id }) +log('quest.index ->', book.ok, '| lines', book.data.lines.map((l) => l.line + ':' + (l.quest?.key ?? '-')).join(' '), '| rewards', JSON.stringify(book.data.rewards.map((r) => r.type + ' ' + r.level)), '| badge', JSON.stringify(after.data.quests)) +const collected = await call('quest.collect', { village_id: id }) +log('quest.collect ->', collected.ok, '| rewards left', collected.data.book.rewards.length, '| wood', Math.round(collected.data.village.resources.wood)) ws.close() process.exit(0)