diff options
| -rw-r--r-- | go/game/action.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/go/game/action.go b/go/game/action.go index 5bb8bd67..856ea6bc 100644 --- a/go/game/action.go +++ b/go/game/action.go @@ -682,13 +682,22 @@ func NewFreeAction(p Permanent, resolveProto ActionFuncPrototype, costFunc Actio func (a *FreeAction) Speed() ActionSpeed { return fast } -func (a *FreeAction) String() string { - p := a.source.(Permanent) - if a.targets.RequireSelection() { - return fmt.Sprintf("free_action %s", a.desc) +func (a *FreeAction) String() (s string) { + switch src := a.source.(type) { + case *Card: + s += fmt.Sprintf("%v: %s ", a.Controller(), src.Name) + default: + s += fmt.Sprintf("%s", src) } - return fmt.Sprintf("%v: %s free_action@%v", p.Controller(), p.Card().Name, a.targets) + s += " free_action" + if a.targets == nil || a.targets.RequireSelection() { + s += fmt.Sprintf(" %s", a.desc) + } else { + s += fmt.Sprintf("@%v", a.targets) + } + + return } var buyActionTargetDesc = TargetDesc{"store card", "?"} |
