refactor(wilderness): delete dead generateAct3Jungle pass
Remove unused generateAct3Jungle function and its import. Active jungle generation uses DRLG_GenerateJungles. TAG=agy CONV=2a1934de-30ef-464e-b3f3-fcbcdbbc49f1
This commit is contained in:
parent
710efa0a71
commit
37dc936169
|
|
@ -409,123 +409,6 @@ export function initAct2OutdoorLevel(
|
|||
* Act 3: DRLGOUTPLACE_InitAct3OutdoorLevel & DRLG_GenerateJungles
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Generate Act 3 Jungle River & Clearings layout (`DRLG_GenerateJungles`):
|
||||
* - Spans wooden river bridges across the East river channel at row crossings.
|
||||
* - Connects West clearings to wooden river bridges via winding jungle causeways/paths.
|
||||
*/
|
||||
export function generateAct3Jungle(
|
||||
canvas: Canvas,
|
||||
levelId: number,
|
||||
pieces: readonly WildernessPiece[],
|
||||
rng: Rng,
|
||||
stats: WildernessStats,
|
||||
): Set<string> {
|
||||
const placed = new Set<string>()
|
||||
const tailPiece = pieces.find(p => p.name === 'Act 3 - Jungle Tail')
|
||||
const headPiece = pieces.find(p => p.name === 'Act 3 - Jungle Head')
|
||||
|
||||
if (tailPiece?.levels[0]) {
|
||||
stampDs1(canvas, tailPiece.levels[0], 0, 0)
|
||||
placed.add(tailPiece.name)
|
||||
stats.substitutions.push({ name: tailPiece.name, role: 'object', enabled: true, clusters: 1 })
|
||||
}
|
||||
if (headPiece?.levels[0]) {
|
||||
stampDs1(canvas, headPiece.levels[0], 0, 160)
|
||||
placed.add(headPiece.name)
|
||||
stats.substitutions.push({ name: headPiece.name, role: 'object', enabled: true, clusters: 1 })
|
||||
}
|
||||
|
||||
const clearingPrefix =
|
||||
levelId === 76
|
||||
? 'Act 3 - Clearing Webby'
|
||||
: levelId === 77
|
||||
? 'Act 3 - Clearing Boggy'
|
||||
: 'Act 3 - Clearing Pygmy'
|
||||
const allClearingPieces = pieces.filter(p => p.name.startsWith(clearingPrefix) && p.levels.length > 0)
|
||||
const eastOpeningClearings = allClearingPieces.filter(p => /\b(E|EW|SE|NE)\b/i.test(p.name))
|
||||
const clearingPool = eastOpeningClearings.length > 0 ? eastOpeningClearings : allClearingPieces
|
||||
|
||||
const allRiverPieces = pieces.filter(
|
||||
p =>
|
||||
p.name.startsWith('Act 3 - Jungle ') &&
|
||||
p.name !== 'Act 3 - Jungle Head' &&
|
||||
p.name !== 'Act 3 - Jungle Tail' &&
|
||||
p.levels.length > 0,
|
||||
)
|
||||
const nsWestRivers = allRiverPieces.filter(p => /NS W|NS$/i.test(p.name))
|
||||
const riverPool = nsWestRivers.length > 0 ? nsWestRivers : allRiverPieces
|
||||
|
||||
for (let row = 0; row < 4; row += 1) {
|
||||
const y = 32 + row * 32
|
||||
// West column (x = 0): Jungle Clearing opening East
|
||||
if (clearingPool.length > 0) {
|
||||
const chosenClearing = clearingPool[rng.int(0, clearingPool.length - 1)]!
|
||||
const ds1 = chosenClearing.levels[rng.int(0, chosenClearing.levels.length - 1)]!
|
||||
stampDs1(canvas, ds1, 0, y)
|
||||
placed.add(chosenClearing.name)
|
||||
stats.substitutions.push({ name: chosenClearing.name, role: 'object', enabled: true, clusters: 1 })
|
||||
}
|
||||
// East column (x = 32): Continuous North-South River channel
|
||||
if (riverPool.length > 0) {
|
||||
const chosenRiver = riverPool[rng.int(0, riverPool.length - 1)]!
|
||||
const ds1 = chosenRiver.levels[rng.int(0, chosenRiver.levels.length - 1)]!
|
||||
stampDs1(canvas, ds1, 32, y)
|
||||
placed.add(chosenRiver.name)
|
||||
stats.substitutions.push({ name: chosenRiver.name, role: 'object', enabled: true, clusters: 1 })
|
||||
}
|
||||
}
|
||||
|
||||
// Stamp Wooden River Bridges & Jungle Paths spanning the river channel
|
||||
let riverBridges = 0
|
||||
let junglePathCells = 0
|
||||
|
||||
// Two canonical wooden bridge crossings at row 1 (y = 78..81) and row 3 (y = 142..145)
|
||||
const bridgeYPositions = [78, 142]
|
||||
for (const by of bridgeYPositions) {
|
||||
for (let y = by; y < by + 4; y += 1) {
|
||||
for (let x = 32; x < 60; x += 1) {
|
||||
// Style 4: wooden bridge planks
|
||||
paintFloor(canvas, x, y, makeFloor(4, 0, 2), true)
|
||||
clearWalls(canvas, x, y)
|
||||
}
|
||||
}
|
||||
riverBridges += 1
|
||||
}
|
||||
|
||||
// Jungle Trails connecting clearings across to the river bridges
|
||||
for (const by of bridgeYPositions) {
|
||||
// West clearing connection (x = 12..32)
|
||||
for (let x = 12; x < 32; x += 1) {
|
||||
for (let dy = 0; dy < 3; dy += 1) {
|
||||
const y = by + dy
|
||||
paintFloor(canvas, x, y, makeFloor(5, 0, 194))
|
||||
clearWalls(canvas, x, y)
|
||||
junglePathCells += 1
|
||||
}
|
||||
}
|
||||
// East trail along riverbank (x = 58..61, North-South trail)
|
||||
for (let y = by - 14; y <= by + 14; y += 1) {
|
||||
if (y >= 4 && y < canvas.height - 4) {
|
||||
paintFloor(canvas, 59, y, makeFloor(5, 0, 194))
|
||||
clearWalls(canvas, 59, y)
|
||||
junglePathCells += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stats.act3Topography = {
|
||||
causewayCells: 0,
|
||||
riverBridges,
|
||||
canalCells: 0,
|
||||
junglePathCells,
|
||||
}
|
||||
stats.notes.push(
|
||||
`Act 3 Jungle Topography: ${String(riverBridges)} river bridges, ${String(junglePathCells)} jungle path cells`,
|
||||
)
|
||||
|
||||
return placed
|
||||
}
|
||||
|
||||
/**
|
||||
* Stamp Kurast Causeway (LevelId 82):
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ import type { Side } from './world-graph.ts'
|
|||
import {
|
||||
initAct2OutdoorLevel,
|
||||
initAct3OutdoorLevel,
|
||||
generateAct3Jungle,
|
||||
stampAct3KurastCauseway,
|
||||
initAct4OutdoorLevel,
|
||||
initAct5OutdoorLevel,
|
||||
|
|
|
|||
Loading…
Reference in New Issue