From 701f0bfee903aefcd99d07a74e23e86b95f12377 Mon Sep 17 00:00:00 2001 From: PfandBoss <68470553+PfandBoss@users.noreply.github.com> Date: Sat, 10 Dec 2022 03:18:55 +0100 Subject: [PATCH] idc --- Storage.tscn | 7 +++++++ scripts/Modules/Storage.gd | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 Storage.tscn diff --git a/Storage.tscn b/Storage.tscn new file mode 100644 index 0000000..ae3b755 --- /dev/null +++ b/Storage.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=3 uid="uid://1sr52olklfyy"] + +[ext_resource type="Script" path="res://scripts/Modules/Storage.gd" id="1_guwoh"] + +[node name="Storage" type="Node"] +script = ExtResource("1_guwoh") +currentType = 0 diff --git a/scripts/Modules/Storage.gd b/scripts/Modules/Storage.gd index bf5142d..54f8ac7 100644 --- a/scripts/Modules/Storage.gd +++ b/scripts/Modules/Storage.gd @@ -9,15 +9,15 @@ enum TYPE {AMMO, GUNPOWDER, FUEL} #------------Methods-------------# func _ready(): var root = get_tree().root.get_child(0) - root.shooting.connect(_on_signal_storing) + root.ammo_pickup.connect(_on_signal_storing) maxStashValue = 5 currentStashValue = 0 func interact(): if currentStashValue >= 1: - currentStashValue -= 1 + --currentStashValue return func _on_signal_storing(): if currentStashValue < maxStashValue: - currentStashValue += 1 + ++currentStashValue return