aboutsummaryrefslogtreecommitdiff
path: root/go/game/cardImplementations_test.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-09-08 15:38:07 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-09-08 15:41:45 +0200
commita3ca136cd776ff0089dc33e401d1fc474dc17138 (patch)
tree1968a8ff318c7f021e2cc94df5a057eeee39b099 /go/game/cardImplementations_test.go
parentee605fa7fa48803756b0c3216afc4bd692ec144a (diff)
downloadmuhqs-game-a3ca136cd776ff0089dc33e401d1fc474dc17138.tar.gz
muhqs-game-a3ca136cd776ff0089dc33e401d1fc474dc17138.zip
support explicitly winning and implement Approach Supremacy!
Diffstat (limited to 'go/game/cardImplementations_test.go')
-rw-r--r--go/game/cardImplementations_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/go/game/cardImplementations_test.go b/go/game/cardImplementations_test.go
index 8ab87ecd..8e298491 100644
--- a/go/game/cardImplementations_test.go
+++ b/go/game/cardImplementations_test.go
@@ -469,3 +469,30 @@ func TestPierce(t *testing.T) {
t.Fatal("Archer did not take 2 damage")
}
}
+
+func TestApproachSupremacy(t *testing.T) {
+ s, _, p, _ := newMockState()
+ p.Resource = 60
+ pa := NewPlayAction(p, NewCard("exp1/approach_supremacy!"))
+
+ // Play the first time
+ s.declareAction(pa)
+ s.stack.pop() // resolve once
+ if p.Won {
+ t.Fatal("player already won")
+ }
+
+ // Play the second time
+ s.declareAction(pa)
+ s.counterAction(pa) // do not resolve it
+ if p.Won {
+ t.Fatal("player already won")
+ }
+
+ // Play the third time
+ s.declareAction(pa)
+ s.stack.pop() // resolve it
+ if !p.Won {
+ t.Fatal("player did not win")
+ }
+}