Spawn items outside the main maps

This commit is contained in:
Pyrex 2025-02-15 15:29:41 -08:00
parent 841031573c
commit e8c097fd74

View File

@ -1,5 +1,5 @@
import metamap from "./metamap.txt?raw"; import metamap from "./metamap.txt?raw";
import {Architecture, LoadedNewMap, NewMap} from "../../newmap.ts"; import {Architecture, LoadedNewMap, NewMap, Progress} from "../../newmap.ts";
import {Grid, Point} from "../../engine/datatypes.ts"; import {Grid, Point} from "../../engine/datatypes.ts";
import mapZoo from "../zoo/map.ts"; import mapZoo from "../zoo/map.ts";
import mapOptometrist from "../optometrist/map.ts"; import mapOptometrist from "../optometrist/map.ts";
@ -8,6 +8,8 @@ import mapCoffeeShop from "../coffeeShop/map.ts";
import mapClub from "../club/map.ts"; import mapClub from "../club/map.ts";
import mapManor from "../manor/map.ts"; import mapManor from "../manor/map.ts";
import mapLibrary from "../library/map.ts"; import mapLibrary from "../library/map.ts";
import {choose} from "../../utils.ts";
import {ALL_STATS} from "../../datatypes.ts";
const mapHub: NewMap = () => { const mapHub: NewMap = () => {
let metamapLayer = Grid.createGridFromMultilineString(metamap); let metamapLayer = Grid.createGridFromMultilineString(metamap);
@ -34,6 +36,8 @@ const mapHub: NewMap = () => {
cell.architecture = Architecture.Wall; cell.architecture = Architecture.Wall;
} else if (metamapLayer.get(src) == " ") { } else if (metamapLayer.get(src) == " ") {
cell.architecture = Architecture.Floor; cell.architecture = Architecture.Floor;
let stat = choose(ALL_STATS);
cell.pickup = choose<Progress>([stat, stat, stat, "EXP"]);
} }
} }
} }