12 lines
428 B
GDScript
12 lines
428 B
GDScript
extends BuyMenuButton
|
|
|
|
func bought_action():
|
|
if PlayerShip.Hull.HP >= PlayerShip.Hull.MaxHP:
|
|
PlayerShip.Hull.HP = PlayerShip.Hull.MaxHP
|
|
PlayerShip.Money += Price
|
|
return
|
|
PlayerShip.Hull.HP += 1
|
|
while(PlayerShip.Hull.HP < PlayerShip.Hull.MaxHP and PlayerShip.Money >= Price):
|
|
PlayerShip.Hull.HP += 1
|
|
PlayerShip.Money -= Price
|
|
if PlayerShip.Hull.HP > PlayerShip.Hull.MaxHP: PlayerShip.Hull.HP = PlayerShip.Hull.MaxHP
|