import { sample, random } from 'lodash';
import { createFight, getRandomMonster, loadMonster } from "../../server/monster";
+const MONSTER_ENCOUNTER_CHANCE = 30;
+
export const explore: SocketEvent = {
eventName: 'city:travel',
handler: async (api, data: { args: string }) => {
// @TODO send back monsters
const chanceToSeeMonster = random(0, 100);
- // 20% chance to see monster
const things: any[] = [];
- if(chanceToSeeMonster < 20 || true) {
+ if(chanceToSeeMonster < MONSTER_ENCOUNTER_CHANCE) {
const monster = await getRandomMonster([closest]);
things.push(monster);
}