Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cli/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,14 +1171,10 @@ export class Renderer {
const t = game.world.tiles[y][x];
if (t === "#") return game.theme.treeVariants[game.world.treeVariantAt(x, y)];
if (t === "~") return game.theme.rockTile;
if (t === "w") return chalk.bgBlue(game.theme.waterTile) + RESET;
if (t === "%") return game.theme.woodTile;
if (t === "M") return game.theme.mode === "bugs" ? "🔋" : TILE_MEAT;
if (t === "B") return game.theme.brickTile;
if (t === "+") return chalk.greenBright(TILE_CURE) + RESET;
if (t === "L") return game.theme.mode === "bugs" ? "💾" : "🍃";
if (t === "F") return game.theme.mode === "bugs" ? "💿" : "🐟";
if (t === "G") return game.theme.mode === "bugs" ? "📡" : "🌿";
if (t === "E") return game.theme.mode === "bugs" ? "🔋" : "🥩";
if (t === "H") return "❤️ ";
if (t === "T") return "🕳️ ";
Expand Down Expand Up @@ -1255,7 +1251,7 @@ export class Renderer {
if (game.theme.mode === "bugs") {
return `${wood} 🔋${p.batteries} ⚡${p.energy} ${fed}`;
}
return `${wood} 🥩${p.meat} 🍃${p.mana} ${fed}`;
return `${wood} 🥩${p.meat} ${fed}`;
}

private compactStateBadge(
Expand Down
3 changes: 0 additions & 3 deletions core/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,8 @@ export class Agent extends Entity {
t === "%" ||
t === "M" ||
t === "+" ||
t === "F" ||
t === "G" ||
t === "E" ||
t === "$" ||
t === "L" ||
t === "H"
);
}
Expand Down
11 changes: 2 additions & 9 deletions core/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ const GOLD_DROP_VALUE = 3;

function tileLabel(t: string): string {
if (t === "M") return "🥩";
if (t === "F") return "🐟";
if (t === "G") return "🌿";
if (t === "L") return "🍃";
if (t === "E") return "🔋";
if (t === "H") return "❤️";
return t;
Expand Down Expand Up @@ -772,7 +769,7 @@ export class Game {
for (let x = Math.max(0, px - range); x <= Math.min(this.world.width - 1, px + range); x++) {
if (Math.abs(x - px) + Math.abs(y - py) > range) continue;
const t = this.world.tiles[y][x];
if (t === "%" || t === "M" || t === "G") {
if (t === "%" || t === "M") {
out.push(`${x},${y}`);
}
}
Expand Down Expand Up @@ -1190,7 +1187,7 @@ export class Game {
/* sound removed */
return { message: `+${healed} HP` };
}
if (t === "M" || t === "F" || t === "G" || t === "L" || t === "E") {
if (t === "M" || t === "E") {
const cls = this.player.characterClass;
if (!canEat(cls, t)) {
const refusal = dietRefusal(cls, this.player.name);
Expand Down Expand Up @@ -1560,10 +1557,6 @@ export class Game {
const p = this.player;
if (tile === "M") {
p.meat += 1;
} else if (tile === "F") {
p.fish += 1;
} else if (tile === "G") {
p.plants += 1;
} else if (tile === "E") {
p.batteries += 1;
p.gainEnergy(15);
Expand Down
6 changes: 0 additions & 6 deletions core/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ export class Player extends Entity {
maxEnergy: number;
wood: number;
meat: number;
fish: number;
plants: number;
batteries: number;
mana: number;
lastFedAt: number;
lastMoveTick: number;
pickupFlashUntil: number;
Expand Down Expand Up @@ -80,10 +77,7 @@ export class Player extends Entity {
this.maxEnergy = 100;
this.wood = 0;
this.meat = 0;
this.fish = 0;
this.plants = 0;
this.batteries = 0;
this.mana = 0;
this.lastFedAt = Date.now();
this.lastMoveTick = -100;
this.pickupFlashUntil = -100;
Expand Down
3 changes: 0 additions & 3 deletions core/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export interface Theme {
treeVariants: string[];
rockTile: string;
woodTile: string;
waterTile: string;
brickTile: string;
npcIcon: string;
displayAvatars: ThemeAvatar[];
Expand Down Expand Up @@ -79,7 +78,6 @@ export const THEMES: Record<GameMode, Theme> = {
treeVariants: ["🌲", "🌲", "🌲"],
rockTile: "🪨",
woodTile: "🪵",
waterTile: "🌊",
brickTile: "🧱",
npcIcon: "👴",
displayAvatars: [
Expand Down Expand Up @@ -135,7 +133,6 @@ export const THEMES: Record<GameMode, Theme> = {
treeVariants: ["🧱", "🧱", "🧱"],
rockTile: "🧱",
woodTile: "🔩",
waterTile: "⛓️ ",
brickTile: "🧱",
npcIcon: "📚",
displayAvatars: [
Expand Down
4 changes: 0 additions & 4 deletions core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ export type TileType =
| "M"
| "B"
| "+"
| "L"
| "F"
| "G"
| "E"
| "$"
| "w"
| "H"
| "T";

Expand Down
73 changes: 2 additions & 71 deletions core/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ const DEFAULT_DIST: WorldDistribution = {

const ITEM_TILES: ReadonlySet<TileType> = new Set<TileType>([
"M",
"G",
"F",
"E",
"L",
"H",
]);

Expand Down Expand Up @@ -148,24 +145,13 @@ export class World {
const forestCount = Math.max(1, Math.floor(totalInterior / 110));
this.scatterForests(grid, forestCount);

if (this.mode !== "adventure") {
const lakeCount = Math.max(1, Math.floor(totalInterior / 120));
this.scatterLakes(grid, lakeCount);
}

const rocks = Math.floor(
totalInterior * this.dist.treesAndRocksPct * 0.4 * DENSITY_FACTOR
);
this.scatter(grid, "~", rocks);

/* M/E/H scatter removed — items only drop from bug deaths */
this.scatter(grid, "T", 2);
if (this.mode !== "adventure") {
this.scatterFishInWater(
grid,
Math.max(1, Math.floor(totalInterior * 0.015 * DENSITY_FACTOR))
);
}

return grid;
}
Expand Down Expand Up @@ -195,57 +181,6 @@ export class World {
}
}

private scatterLakes(grid: TileType[][], count: number): void {
for (let i = 0; i < count; i++) {
const cx = 3 + Math.floor(Math.random() * (this.width - 6));
const cy = 3 + Math.floor(Math.random() * (this.height - 6));
for (let dy = -1; dy <= 1; dy++) {
for (let dx = -1; dx <= 1; dx++) {
const nx = cx + dx;
const ny = cy + dy;
if (
nx <= 0 ||
ny <= 0 ||
nx >= this.width - 1 ||
ny >= this.height - 1
)
continue;
grid[ny][nx] = "w";
}
}
const extra = 2 + Math.floor(Math.random() * 4);
for (let j = 0; j < extra; j++) {
const dx = Math.floor(Math.random() * 5) - 2;
const dy = Math.floor(Math.random() * 5) - 2;
const nx = cx + dx;
const ny = cy + dy;
if (
nx <= 0 ||
ny <= 0 ||
nx >= this.width - 1 ||
ny >= this.height - 1
)
continue;
if (grid[ny][nx] === ".") grid[ny][nx] = "w";
}
}
}

private scatterFishInWater(grid: TileType[][], count: number): void {
const waterCells: Array<[number, number]> = [];
for (let y = 0; y < this.height; y++) {
for (let x = 0; x < this.width; x++) {
if (grid[y][x] === "w") waterCells.push([x, y]);
}
}
const target = Math.min(count, waterCells.length);
for (let i = 0; i < target; i++) {
const idx = Math.floor(Math.random() * waterCells.length);
const [x, y] = waterCells[idx];
grid[y][x] = "F";
waterCells.splice(idx, 1);
}
}

private registerInitialItems(): void {
const now = Date.now();
Expand Down Expand Up @@ -325,13 +260,9 @@ export class World {
t === "." ||
t === "M" ||
t === "+" ||
t === "L" ||
t === "F" ||
t === "G" ||
t === "E" ||
t === "H" ||
t === "T" ||
t === "w"
t === "T"
);
}

Expand Down Expand Up @@ -425,7 +356,7 @@ export class World {
for (let y = 1; y < this.height - 1; y++) {
for (let x = 1; x < this.width - 1; x++) {
const t = this.tiles[y][x];
if (t !== "." && t !== "%" && t !== "M" && t !== "G" && t !== "+") {
if (t !== "." && t !== "%" && t !== "M" && t !== "+") {
if ((x + y) % 3 === 0) this.tiles[y][x] = ".";
}
}
Expand Down
Loading