diff options
| author | historia <[not public]> | 2026-10-01 14:38:08 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-01 14:38:08 -0400 |
| commit | 1082f3336085c15992ca83d5553c0ba52208d70a (patch) | |
| tree | 4fcedaa90bc01c41456258a9d57f492f31754948 /internal/game/render_joker.go | |
| parent | d4eae333a8d8a96452bbf3617aa85b50466c11a7 (diff) | |
| download | thehouseoficarus-1082f3336085c15992ca83d5553c0ba52208d70a.tar.gz | |
feat: pai gow poker added to the casino
Diffstat (limited to 'internal/game/render_joker.go')
| -rw-r--r-- | internal/game/render_joker.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/internal/game/render_joker.go b/internal/game/render_joker.go new file mode 100644 index 0000000..821f9f4 --- /dev/null +++ b/internal/game/render_joker.go @@ -0,0 +1,37 @@ +package game + +import ( + "strings" + "thehouseoficarus/internal/cardart" +) + +// Dedicated Joker face in every supported size, also usable without cards.yaml. +// Never reuse Unicode store art for ASCII-only clients. +func jokerCardArt(size int, unicode bool, style string, store *cardart.Store) []string { + if size == 1 { + return []string{"JK"} + } + var lines []string + if unicode { + lines = store.Art("JK", size) + } + if len(lines) != size { + lines = generatedCardArt("JK", "", size, unicode, style) + motifs := map[int][]string{5: {" * "}, 7: {" ^ ^ ", "(o o)", " v "}, 9: {" /\u005c /\u005c ", " o o ", " <J> ", " \\_/ ", " * "}} + if motif, ok := motifs[size]; ok { + for i, text := range motif { + left, right := "|", "|" + if unicode { + left, right = "│", "│" + } + lines[2+i] = left + text + right + } + } + } + lines = append([]string(nil), lines...) + if unicode && style == "light" { + lines[0] = strings.Repeat("▄", size) + lines[size-1] = strings.Repeat("▀", size) + } + return lines +} |
