Very bad implementation of shop and grenade
This commit is contained in:
parent
e9f4c6e5f8
commit
3868af29e3
13 changed files with 166 additions and 3 deletions
|
|
@ -5,3 +5,11 @@ extends Button
|
|||
func _ready() -> void:
|
||||
icon = weapon.preview
|
||||
text = str(weapon.cost)
|
||||
|
||||
func _pressed() -> void:
|
||||
var player_data = Session.get_player_data()
|
||||
if player_data["money"] >= weapon.cost:
|
||||
var player: Player = Session.player_nodes[multiplayer.get_unique_id()]
|
||||
|
||||
player_data["money"] -= weapon.cost
|
||||
player.get_node("WeaponSystem").add(weapon.weapon_system_scene.instantiate(),"ability_first")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue