aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-12-26 09:23:38 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:11 +0200
commite4fdbf2f2cc2b86fa5e4bd3c783c2055a526ef22 (patch)
tree3873bc95db14019b2af6380e3a0a3d5964858fc8
parente4af3c1bee2f4c0b3fc74b1675ae5ba9141b0780 (diff)
downloadmuhqs-game-e4fdbf2f2cc2b86fa5e4bd3c783c2055a526ef22.tar.gz
muhqs-game-e4fdbf2f2cc2b86fa5e4bd3c783c2055a526ef22.zip
implement appear!
-rw-r--r--go/TODO2
-rw-r--r--go/game/cardImplementations.go18
2 files changed, 20 insertions, 0 deletions
diff --git a/go/TODO b/go/TODO
index 36bef54f..93c3a9ab 100644
--- a/go/TODO
+++ b/go/TODO
@@ -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{},