aboutsummaryrefslogtreecommitdiff
path: root/go/game/cardImplementations.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/cardImplementations.go')
-rw-r--r--go/game/cardImplementations.go17
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{},
}