Check if the attacked base is an enemy base or not and update the label according to this
This commit is contained in:
parent
d189f799ca
commit
880d2ef7c4
@ -51,8 +51,12 @@ class Base: GKEntity{
|
||||
self.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(self.unitCount)"
|
||||
|
||||
if base.component(ofType: TeamComponent.self)?.unitcountLabel.text != "" {
|
||||
if base.ownershipPlayer != self.ownershipPlayer {
|
||||
base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(abs(base.unitCount - units * 2))"
|
||||
} else {
|
||||
base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)"
|
||||
}
|
||||
}
|
||||
DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID,
|
||||
toBase: base.baseID,
|
||||
unitCount: units)
|
||||
|
Loading…
Reference in New Issue
Block a user