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.go33
1 files changed, 29 insertions, 4 deletions
diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go
index d1f8de70..8024e4fc 100644
--- a/go/game/cardImplementations.go
+++ b/go/game/cardImplementations.go
@@ -8,8 +8,9 @@ type advisorImplementation struct {
cardImplementationBase
}
-func (impl *advisorImplementation) fullActionPrototypes(u *Unit) []*FullActionPrototype {
- resolvePrototype := func(s *State, u *Unit) func(*State) {
+func (impl *advisorImplementation) fullAction(u *Unit) []*FullAction {
+ resolvePrototype := func(a Action) ActionResolveFunc {
+ u := a.Source().(*Unit)
return func(s *State) {
controller := u.Controller()
controller.DrawN(1)
@@ -19,12 +20,36 @@ func (impl *advisorImplementation) fullActionPrototypes(u *Unit) []*FullActionPr
}
}
}
- return []*FullActionPrototype{NewFullActionPrototype(u, resolvePrototype)}
+ return []*FullAction{NewFullAction(u, resolvePrototype, "draw 1. exile 1")}
+}
+
+type missionaryImplementation struct {
+ cardImplementationBase
+}
+
+func (impl *missionaryImplementation) fullAction(u *Unit) []*FullAction {
+ resolvePrototype := func(a Action) ActionResolveFunc {
+ u := a.Source().(*Unit)
+ target := a.Targets().sel[0].(*Unit)
+ return func(s *State) {
+ faith, found := target.States[UnitMarks.Faith]
+ if !found {
+ target.States[UnitMarks.Faith] = 2
+ } else {
+ target.States[UnitMarks.Faith] = faith + 2
+ if faith+2 > target.Card().BuyCost {
+ target.controller = u.Controller()
+ }
+ }
+ }
+ }
+ return []*FullAction{NewFullAction(u, resolvePrototype, "put faith ...")}
}
func init() {
cardImplementations = map[string]cardImplementation{
- "base/advisor": &advisorImplementation{},
+ "base/advisor": &advisorImplementation{},
+ "base/missionary": &missionaryImplementation{},
"misc/farmer": &farmerImplementation{},
}