package game import ( "log" "strconv" "strings" ) type Artifact struct { PermanentBase Solid int } func NewArtifact(cardPath string, tile *Tile, owner *Player) *Artifact { card := NewCard(cardPath) a := &Artifact{NewPermanentBase(card, tile, owner), 0} tile.Permanent = a effects := card.getEffects() for _, e := range effects { if strings.HasPrefix(e, "Solid") { tokens := strings.Split(e, " ") var err error a.Solid, err = strconv.Atoi(tokens[1]) if err != nil { log.Fatalf("Invalid Solid definition %s\n", e) } } } return a } func (a *Artifact) Fight(p Permanent) { } func (a *Artifact) IsDestroyed() bool { return a.Damage >= a.Solid } func (a *Artifact) Attackable() bool { return a.Solid > 0 } func (a *Artifact) GetAvailActionPrototypes() []ActionPrototype { return []ActionPrototype{} }