diff options
| author | historia <[not public]> | 2026-09-30 18:57:30 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-30 18:57:30 -0400 |
| commit | a5b9c1052c4640ba519e608e0c97e603ce6aa5ef (patch) | |
| tree | c48ac64ca8d1ec2505eedd18fb9e2fc39a885689 /internal/game/vesta_world_test.go | |
| parent | 2317022c16b520dd5272facfd5092a4c58cac44b (diff) | |
| download | thehouseoficarus-a5b9c1052c4640ba519e608e0c97e603ce6aa5ef.tar.gz | |
feat: blackjack and baccarat rules felt added, casino layout simplified
Diffstat (limited to 'internal/game/vesta_world_test.go')
| -rw-r--r-- | internal/game/vesta_world_test.go | 66 |
1 files changed, 57 insertions, 9 deletions
diff --git a/internal/game/vesta_world_test.go b/internal/game/vesta_world_test.go index 50e799c..1a26bf6 100644 --- a/internal/game/vesta_world_test.go +++ b/internal/game/vesta_world_test.go @@ -269,12 +269,11 @@ func TestVestaEarlySkillsAndSeparateServices(t *testing.T) { func TestVestaCasinoFloorsAndVariants(t *testing.T) { _, rooms, zones := loadVesta(t) - grid := world.BuildGrid(6102, func(id int) (*world.Room, bool) { + grid := world.BuildGrid(6101, func(id int) (*world.Room, bool) { r, ok := rooms[id] return r, ok }, nil, nil, nil) games := map[string]int{} - floors := map[int]int{} future := 0 soft17, surrender, singleDeck, huff, classic := false, false, false, false, false for id, r := range rooms { @@ -284,14 +283,17 @@ func TestVestaCasinoFloorsAndVariants(t *testing.T) { } continue } - floor := grid.Coord[id][2] - floors[floor]++ + // The vestibule stays at street level (below the gaming floor); + // every gaming room shares 6101's floor. + if id != 6100 && grid.Coord[id][2] != grid.Coord[6101][2] { + t.Errorf("casino room %d drifted off the gaming floor", id) + } if strings.Contains(r.Name, "Future ") { future++ } count := len(r.CasinoTables) + len(r.CasinoMachines) - if count > 1 || count > 0 && floor != 0 { - t.Errorf("room %d: games must have individual ground-floor salons", id) + if count > 1 { + t.Errorf("room %d: games must have individual salons", id) } for _, table := range r.CasinoTables { games[string(table.Game)]++ @@ -307,11 +309,57 @@ func TestVestaCasinoFloorsAndVariants(t *testing.T) { classic = classic || machine.Variant == "" } } - if games["blackjack"] < 5 || games["baccarat"] < 3 || games["slots"] < 5 || !soft17 || !surrender || !singleDeck || !huff || !classic { + if games["blackjack"] != 5 || games["baccarat"] != 3 || games["roulette"] != 3 || games["craps"] != 7 || games["slots"] != 5 || !soft17 || !surrender || !singleDeck || !huff || !classic { t.Errorf("casino variant coverage lost: %v", games) } - if future < 15 || floors[0] < 30 || floors[1] < 15 || floors[2] < 15 || floors[3] < 15 { - t.Errorf("casino needs a large ground floor and substantial expansion floors: floors=%v future=%d", floors, future) + if future != 0 { + t.Errorf("placeholder galleries remain: %d", future) + } + // One salon per game sits on the gaming street; each keeps its editions + // within a couple of steps north or south, so no variant is ever far away. + street := map[int]string{6101: "blackjack", 6127: "baccarat", 6182: "roulette", 6185: "craps", 6118: "slots"} + for id, game := range street { + r := rooms[id] + found := false + for _, table := range r.CasinoTables { + found = found || string(table.Game) == game + } + for _, machine := range r.CasinoMachines { + found = found || string(machine.Game) == game + } + if !found { + t.Errorf("street room %d lost its %s salon", id, game) + } + } + // Street links: the blackjack salon joins the vestibule by stairs and + // the street eastward; the middle salons connect west and east; the + // slots salon ends the street. + for id, want := range map[int][]world.ExitDir{ + 6101: {world.Down, world.East}, + 6127: {world.West, world.East}, + 6182: {world.West, world.East}, + 6185: {world.West, world.East}, + 6118: {world.West}, + } { + r := rooms[id] + for _, dir := range want { + exit, ok := r.Exits[dir] + if !ok || rooms[exit.Room] == nil { + t.Errorf("street room %d lost its %s link", id, dir) + } + } + } + if rooms[6100].Exits[world.Up].Room != 6101 || rooms[5111].Exits[world.North].Room != 6100 { + t.Fatal("vestibule disconnected") + } + foundBank := false + for _, ref := range rooms[6100].Objects { + if ref.ID == "bank_booth" { + foundBank = true + } + } + if !foundBank { + t.Fatal("casino lost its bank booth") } } |
