aboutsummaryrefslogtreecommitdiff
path: root/go/game/areaEffect.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-08 17:50:10 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:50:10 +0200
commit45df9bf319d38db916ca983b8c92bb912f5ce9ee (patch)
treed7966002dad4a20bc3ef385bd152554fe278a6df /go/game/areaEffect.go
parenteb10f6f4940ecd09fd7d881fe5e1735ff146f919 (diff)
downloadmuhqs-game-45df9bf319d38db916ca983b8c92bb912f5ce9ee.tar.gz
muhqs-game-45df9bf319d38db916ca983b8c92bb912f5ce9ee.zip
intermediate commit
Diffstat (limited to 'go/game/areaEffect.go')
-rw-r--r--go/game/areaEffect.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/go/game/areaEffect.go b/go/game/areaEffect.go
index 8991bc3c..4cba29e9 100644
--- a/go/game/areaEffect.go
+++ b/go/game/areaEffect.go
@@ -25,3 +25,27 @@ func (e *dynamicAreaEffect) onLeaving(p Permanent) {
e._onLeaving(p)
}
}
+
+func newGrantFullActionEffect(cardPath string, f ActionFuncPrototype, desc, tag string,
+) *dynamicAreaEffect {
+ onEntering := func(p Permanent) {
+ if p.Card().Path() != cardPath {
+ return
+ }
+
+ u := p.(*Unit)
+ fa := NewFullAction(u, f, desc)
+ fa.tag = tag
+ u.FullActions = append(u.FullActions, fa)
+ }
+
+ onLeaving := func(p Permanent) {
+ if p.Card().Path() != cardPath {
+ return
+ }
+ u := p.(*Unit)
+ u.removeFullAction(tag)
+ }
+
+ return newDynamicAreaEffect(onEntering, onLeaving)
+}