aboutsummaryrefslogtreecommitdiff
path: root/go/game
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-08-12 08:23:56 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:36 +0200
commit661cfcad1cb8ff95bb0c86efab19263b3e49b9a0 (patch)
treedc8dbd062448cefa5b4dead0e51e8fdc31fcb2fd /go/game
parent1ece5985a0ce5982434c1b727cbfec16125fa4bc (diff)
downloadmuhqs-game-661cfcad1cb8ff95bb0c86efab19263b3e49b9a0.tar.gz
muhqs-game-661cfcad1cb8ff95bb0c86efab19263b3e49b9a0.zip
strip reminder text from effects
Diffstat (limited to 'go/game')
-rw-r--r--go/game/card.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/go/game/card.go b/go/game/card.go
index f26c27c5..41fab76f 100644
--- a/go/game/card.go
+++ b/go/game/card.go
@@ -306,7 +306,16 @@ func (card *Card) getCanonicalValues(key string) []string {
}
func (card *Card) getEffects() []string {
- return card.getCanonicalValues("effect")
+ effects := card.getCanonicalValues("effect")
+ for i, effect := range effects {
+ // Trim explanation from the effect
+ if effect[len(effect)-1:] != ")" {
+ continue
+ }
+ // Trim after " (..."
+ effects[i] = effect[0 : strings.IndexByte(effect, '(')-1]
+ }
+ return effects
}
func (card *Card) hasEffect(effect string) bool {