Initial commit (1/2)
This commit is contained in:
commit
3411c5796d
66 changed files with 2261 additions and 0 deletions
16
scenes/menus/BuyMenuRockets.gd
Normal file
16
scenes/menus/BuyMenuRockets.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extends BuyMenuButton
|
||||
|
||||
@export var RocketsAmount : float = 5
|
||||
|
||||
@onready var RocketPrice : float = Price / RocketsAmount
|
||||
|
||||
func bought_action():
|
||||
if PlayerShip.Hull.Ammunition["Rockets"] == PlayerShip.Hull.MaxAmmunition["Rockets"]: PlayerShip.Money += Price
|
||||
else:
|
||||
if PlayerShip.Hull.Ammunition["Rockets"] + RocketsAmount > PlayerShip.Hull.MaxAmmunition["Rockets"]:
|
||||
var RocketsLeft = PlayerShip.Hull.MaxAmmunition["Rockets"] - PlayerShip.Hull.Ammunition["Rockets"]
|
||||
for i in range(RocketsLeft + 1):
|
||||
PlayerShip.Money += RocketPrice
|
||||
PlayerShip.Hull.Ammunition["Rockets"] = PlayerShip.Hull.MaxAmmunition["Rockets"]
|
||||
else:
|
||||
PlayerShip.Hull.Ammunition["Rockets"] += RocketsAmount
|
||||
Loading…
Add table
Add a link
Reference in a new issue