Files
Catacombs/dungeon/room.go
tolelom 7f29995833 feat: add secret rooms and mini-bosses on floors 4/9/14/19
Add RoomSecret (5% chance) and RoomMiniBoss room types. Add 4 mini-boss
monsters at 60% of boss stats (Guardian's Herald, Warden's Shadow,
Overlord's Lieutenant, Archlich's Harbinger) with IsMiniBoss flag and
boss pattern logic. Secret rooms grant double treasure. Mini-boss rooms
are placed on floors 4/9/14/19 at room index 1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 15:30:21 +09:00

66 lines
976 B
Go

package dungeon
import "math/rand"
type RoomType int
const (
RoomCombat RoomType = iota
RoomTreasure
RoomShop
RoomEvent
RoomEmpty
RoomBoss
RoomSecret
RoomMiniBoss
)
func (r RoomType) String() string {
return [...]string{"Combat", "Treasure", "Shop", "Event", "Empty", "Boss", "Secret", "MiniBoss"}[r]
}
type Tile int
const (
TileWall Tile = iota
TileFloor
TileCorridor
TileDoor
)
type Room struct {
Type RoomType
X, Y int // top-left in tile space
W, H int // dimensions in tiles
Visited bool
Cleared bool
Neighbors []int
}
type Floor struct {
Number int
Rooms []*Room
CurrentRoom int
Tiles [][]Tile
Width int
Height int
}
func RandomRoomType() RoomType {
r := rand.Float64() * 100
switch {
case r < 5:
return RoomSecret
case r < 50:
return RoomCombat
case r < 65:
return RoomTreasure
case r < 75:
return RoomShop
case r < 90:
return RoomEvent
default:
return RoomEmpty
}
}