diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-03-25 18:32:38 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:10 +0200 |
| commit | ff41f6f2c9c0bef972f8c1194ed49de700528d77 (patch) | |
| tree | 230b609df92d7caf0bbc216474d0df5104f3f6cf | |
| parent | 6e0b2008ec3326e8c1acae69a488719a3ac8a347 (diff) | |
| download | muhqs-game-ff41f6f2c9c0bef972f8c1194ed49de700528d77.tar.gz muhqs-game-ff41f6f2c9c0bef972f8c1194ed49de700528d77.zip | |
add illusionist implementation
| -rw-r--r-- | go/game/cardImplementations.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go index 33d874b9..80865c1c 100644 --- a/go/game/cardImplementations.go +++ b/go/game/cardImplementations.go @@ -611,6 +611,31 @@ func (*unholyCannonballImpl) onPlay(s *State, _ *Card, kraken *Player, _ *Target } } +type illusionistImpl struct{ cardImplementationBase } + +func (*illusionistImpl) fullActions(u *Unit) []*FullAction { + resolvePrototype := func(a Action) ActionResolveFunc { + u := a.Source().(*Unit) + return func(s *State) { + t := a.Target().sel[0].(*Tile) + s.addNewUnit(NewCard("exp1/illusion"), t.Position, u.Controller()) + } + } + + s := u.Controller().gameState + a := newFullAction(u, resolvePrototype, "create illusion") + a.targets = newTargets(newTarget(s, newTargetDesc("adjacent free tile"), a)) + return []*FullAction{a} +} + +type illusionImpl struct{ cardImplementationBase } + +func (*illusionImpl) onETB(s *State, p Permanent) { + s.addTrigger(newTargetedTrigger(p, true, func(s *State) { + s.destroyPermanent(p) + }, p.Card().getEffects()[0])) +} + func init() { cardImplementations = map[string]cardImplementation{ "base/advisor": &advisorImpl{}, @@ -654,5 +679,8 @@ func init() { "kraken/tentacle_slap": &tentacleSlapImpl{}, "kraken/tides_change!": &tidesChangeImpl{}, "kraken/unholy_cannonball": &unholyCannonballImpl{}, + + "exp1/illusionist": &illusionistImpl{}, + "exp1/illusion": &illusionImpl{}, } } |
