From 5ab37780741fd277c668a35b2e0dc089cf12e735 Mon Sep 17 00:00:00 2001 From: Nyeogmi Date: Sun, 23 Feb 2025 14:50:29 -0800 Subject: [PATCH] Restructure level gen a little --- src/mapgen.ts | 32 +++++++++++++++----------------- src/pickups.ts | 2 +- src/thralls.ts | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/mapgen.ts b/src/mapgen.ts index c275a5e..d47eff3 100644 --- a/src/mapgen.ts +++ b/src/mapgen.ts @@ -15,19 +15,19 @@ import { import { getPlayerProgress } from "./playerprogress.ts"; import { ItemStage } from "./thralls.ts"; -const WIDTH = 19; -const HEIGHT = 19; +const WIDTH = 21; +const HEIGHT = 21; const MIN_VAULTS = 1; -const MAX_VAULTS = 1; +const MAX_VAULTS = 2; const NUM_VAULT_TRIES = 90; const NUM_ROOM_TRIES = 90; const NUM_STAIRCASE_TRIES = 90; const NUM_STAIRCASES_DESIRED = 3; -const NUM_ROOMS_DESIRED = 0; // 4; +const NUM_ROOMS_DESIRED = 4; const EXTRA_CONNECTOR_CHANCE = 0.15; -const WINDING_PERCENT = 0; +const WINDING_PERCENT = 50; // This is an implementation of Nystrom's algorithm: // https://journal.stuffwithstuff.com/2014/12/21/rooms-and-mazes/ @@ -473,18 +473,16 @@ function carveRoom(knife: Knife, room: Rect, label?: string) { new Point(room.size.w - dx - 1, room.size.h - dy - 1), ); let stat = choose(ALL_STATS); - knife.map.get(xy0).pickup = new BreakableBlockPickup( - new StatPickupCallbacks(stat), - ); - knife.map.get(xy1).pickup = new BreakableBlockPickup( - new StatPickupCallbacks(stat), - ); - knife.map.get(xy2).pickup = new BreakableBlockPickup( - new StatPickupCallbacks(stat), - ); - knife.map.get(xy3).pickup = new BreakableBlockPickup( - new StatPickupCallbacks(stat), - ); + let cb = choose([ + () => new StatPickupCallbacks(stat), + () => new StatPickupCallbacks(stat), + () => new StatPickupCallbacks(stat), + () => new ExperiencePickupCallbacks(), + ]); + knife.map.get(xy0).pickup = new BreakableBlockPickup(cb()); + knife.map.get(xy1).pickup = new BreakableBlockPickup(cb()); + knife.map.get(xy2).pickup = new BreakableBlockPickup(cb()); + knife.map.get(xy3).pickup = new BreakableBlockPickup(cb()); } } } diff --git a/src/pickups.ts b/src/pickups.ts index db4f620..46d1c9c 100644 --- a/src/pickups.ts +++ b/src/pickups.ts @@ -252,7 +252,7 @@ export class ExperiencePickupCallbacks { } obtain() { - getPlayerProgress().addExperience(250); + getPlayerProgress().addExperience(10); getPlayerProgress().purloinItem(); } diff --git a/src/thralls.ts b/src/thralls.ts index 06f933d..13f870e 100644 --- a/src/thralls.ts +++ b/src/thralls.ts @@ -516,7 +516,7 @@ export let thrallStare = table.add({ "Ridley admires the gear but -- to your surprise -- refuses to jam it into its brain.\n\nThe pup is elated and will never leave.", rewardMessage: "Ridley showers you with EXP!", rewardCallback: (spawn) => { - for (let i = 0; i < 6; i++) { + for (let i = 0; i < 10; i++) { spawn("EXP"); } },