aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/game/targets.go4
-rw-r--r--go/game/targets_test.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/go/game/targets.go b/go/game/targets.go
index 92fc6104..ba676677 100644
--- a/go/game/targets.go
+++ b/go/game/targets.go
@@ -948,5 +948,9 @@ func (t *Target) candidates() []any {
c = append(c, utils.TypedSliceToInterfaceSlice(cards.Cards())...)
}
+ if strings.Contains(t.desc, "declared") {
+ c = append(c, utils.TypedSliceToInterfaceSlice(t.s.stack.Actions)...)
+ }
+
return c
}
diff --git a/go/game/targets_test.go b/go/game/targets_test.go
index 134eef5f..ea511cf8 100644
--- a/go/game/targets_test.go
+++ b/go/game/targets_test.go
@@ -286,6 +286,10 @@ func TestSpellConstraint(t *testing.T) {
desc = newTargetDesc("declared spell")
target = newTarget(s, desc, NewPassPriority(p))
+ if !utils.InterfaceSliceContains(target.Options(), declaredSpell) {
+ t.Fatal("options does not contain the declared spell")
+ }
+
if err := target.AddSelection(declaredSpell); err != nil {
t.Fatal("failed to target spell:", err)
}