Very bad implementation of shop and grenade

This commit is contained in:
Rendo 2025-12-09 10:46:13 +05:00
commit 3868af29e3
13 changed files with 166 additions and 3 deletions

View file

@ -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")