diff options
Diffstat (limited to 'go/game/unit.go')
| -rw-r--r-- | go/game/unit.go | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/go/game/unit.go b/go/game/unit.go index bc9cad3f..5b071d7b 100644 --- a/go/game/unit.go +++ b/go/game/unit.go @@ -11,7 +11,7 @@ const ( ) type Unit struct { - PermanentBase + permanentBase Health int Movement Movement Attack Attack @@ -45,7 +45,7 @@ func NewUnit(card *Card, tile *Tile, owner *Player) *Unit { } u := &Unit{ - PermanentBase: NewPermanentBase(card, tile, owner), + permanentBase: newPermanentBase(card, tile, owner), Health: card.Values["health"].(int), Movement: movement, Attack: attack, @@ -94,7 +94,7 @@ func (u *Unit) move(s *State, tile *Tile) { } if u.containingPerm != nil { - RemovePermanentFromPile(u.containingPerm, u) + removePermanentFromPile(u.containingPerm, u) } else { leaveTile(u) } @@ -158,7 +158,7 @@ func (u *Unit) AttackableEnemyPermanents(m *Map) []Permanent { return permanents } -func (u *Unit) Fight(p Permanent) { +func (u *Unit) fight(p Permanent) { r := DistanceBetweenPermanents(p, u) DealDamage(u, p, u.Attack.DamageInRange(r)) } @@ -176,9 +176,6 @@ func (u *Unit) HasFullAction() bool { return len(u.FullActions) > 0 } -func (u *Unit) FullAction() { -} - func (u *Unit) AvailSlowActions() (actions []Action) { if u.AvailMoveActions > 0 && u.Movement != INVALID_MOVEMENT() { actions = append(actions, NewMoveAction(u)) @@ -229,7 +226,7 @@ func (u *Unit) AvailActions() (actions []Action) { } func (u *Unit) onPile(containing Permanent) { - u.PermanentBase.onPile(containing) + u.permanentBase.onPile(containing) if baseUnit, ok := containing.(*Unit); ok { baseUnitAttackRange := baseUnit.Attack.MaxRange() for r, a := range u.Attack.attacks { @@ -243,7 +240,7 @@ func (u *Unit) onPile(containing Permanent) { } func (u *Unit) onUnpile(containing Permanent) { - u.PermanentBase.onUnpile(u) + u.permanentBase.onUnpile(u) if baseUnit, ok := containing.(*Unit); ok { for r, a := range baseUnit.Attack.attacks { if a == u.Attack.attacks[r] { @@ -273,11 +270,11 @@ func (u *Unit) removeFullAction(tag string) { } } -func (u *Unit) AddDamage(damage int) { +func (u *Unit) addDamage(damage int) { if u.Marks(UnitMarks.Ward) > 0 { u.adjustMarks(UnitMarks.Ward, -1) return } - u.PermanentBase.AddDamage(damage) + u.permanentBase.addDamage(damage) } |
