Restructure level gen a little
This commit is contained in:
parent
18ce5875c5
commit
5ab3778074
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ export class ExperiencePickupCallbacks {
|
||||
}
|
||||
|
||||
obtain() {
|
||||
getPlayerProgress().addExperience(250);
|
||||
getPlayerProgress().addExperience(10);
|
||||
getPlayerProgress().purloinItem();
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user