diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-02 00:13:30 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:46:38 +0200 |
| commit | e8f44219976edf8cf57cbd9e964f66fe9d145a9c (patch) | |
| tree | 8618f3b22d94ff443227d7ebbc84014e2a786fae /go/game/cardImplementations.go | |
| parent | e64e268155c4398a82245626cf36bc39f3bea6a8 (diff) | |
| download | muhqs-game-e8f44219976edf8cf57cbd9e964f66fe9d145a9c.tar.gz muhqs-game-e8f44219976edf8cf57cbd9e964f66fe9d145a9c.zip | |
change unit attack representation and implement sword
Diffstat (limited to 'go/game/cardImplementations.go')
| -rw-r--r-- | go/game/cardImplementations.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go index 8024e4fc..b20b46bc 100644 --- a/go/game/cardImplementations.go +++ b/go/game/cardImplementations.go @@ -46,10 +46,27 @@ func (impl *missionaryImplementation) fullAction(u *Unit) []*FullAction { return []*FullAction{NewFullAction(u, resolvePrototype, "put faith ...")} } +type swordImplementation struct { + cardImplementationBase +} + +func (*swordImplementation) onPile(p Permanent) { + if u, ok := p.(*Unit); ok && !INVALID_ATTACK(u.Attack) { + u.Attack.attacks[0] += 1 + } +} + +func (*swordImplementation) onDrop(p Permanent) { + if u, ok := p.(*Unit); ok && !INVALID_ATTACK(u.Attack) { + u.Attack.attacks[0] -= 1 + } +} + func init() { cardImplementations = map[string]cardImplementation{ "base/advisor": &advisorImplementation{}, "base/missionary": &missionaryImplementation{}, + "base/sword": &swordImplementation{}, "misc/farmer": &farmerImplementation{}, } |
