cap healing health
This commit is contained in:
parent
527042daa8
commit
2cbef76a37
3
robot.go
3
robot.go
@ -286,6 +286,9 @@ func (r *Robot) Tick(g *game) {
|
|||||||
r.RepairCounter -= delta
|
r.RepairCounter -= delta
|
||||||
if r.RepairCounter < 0 {
|
if r.RepairCounter < 0 {
|
||||||
r.Health += g.repair_hp
|
r.Health += g.repair_hp
|
||||||
|
if r.Health > r.Stats.Hp {
|
||||||
|
r.Health = r.Stats.Hp
|
||||||
|
}
|
||||||
r.RepairCounter = g.repair_rate
|
r.RepairCounter = g.repair_rate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user