diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-12-26 09:23:38 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:57 +0100 |
| commit | 045af897f3d7a8f4230adba937bd733b1e5ed6b2 (patch) | |
| tree | 09fc6e34caf8795a5a9375626ab603c04e5b7e22 | |
| parent | c310483be65c4031ae3ac298ef730d9919c77a67 (diff) | |
| download | muhqs-game-045af897f3d7a8f4230adba937bd733b1e5ed6b2.tar.gz muhqs-game-045af897f3d7a8f4230adba937bd733b1e5ed6b2.zip | |
implement appear!
| -rw-r--r-- | go/TODO | 2 | ||||
| -rw-r--r-- | go/game/cardImplementations.go | 18 |
2 files changed, 20 insertions, 0 deletions
@@ -2,6 +2,8 @@ * implement representation of next target and current seelction in prompt * implement equipment actions * drop +* implement X-Cost +* implement HandCardSelection with condition * implement spell target parsing * implement triggers * implement target selection for triggers diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go index 34567962..ac2b5431 100644 --- a/go/game/cardImplementations.go +++ b/go/game/cardImplementations.go @@ -220,6 +220,23 @@ func (*attackImpl) onPlay(s *State, c *Card, p *Player, t *Targets) { } } +type appearImpl struct{ cardImplementationBase } + +func (*appearImpl) playTargets() TargetDesc { + return newTargetDesc("free tile") +} + +func (*appearImpl) onPlay(s *State, c *Card, p *Player, t *Targets) { + selection := p.PromptHandCardSelection(1, 1) + if len(selection) != 1 || selection[0].Type != CardTypes.Unit { + } + unitCard := selection[0] + p.Hand.RemoveCard(unitCard) + + tile := t.Cur().sel[0].(*Tile) + s.addNewUnit(unitCard, tile.Position, p) +} + type healImpl struct{ cardImplementationBase } func (*healImpl) playTargets() TargetDesc { @@ -664,6 +681,7 @@ func init() { "base/wormtongue": &wormtongueImpl{}, "magic/attack!": &attackImpl{}, + "magic/appear!": &appearImpl{}, "magic/die!": &dieImpl{}, "magic/heal!": &healImpl{}, "magic/more!": &moreImpl{}, |
