aboutsummaryrefslogtreecommitdiff
path: root/internal/game/render_joker.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/render_joker.go')
-rw-r--r--internal/game/render_joker.go37
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
+}