This commit is contained in:
PfandBoss
2022-12-10 02:35:47 +01:00
parent fce9eff26e
commit c76634285b
9 changed files with 16 additions and 18 deletions

View File

@@ -0,0 +1,23 @@
extends Module
class_name Storage
enum TYPE {AMMO, GUNPOWDER, FUEL}
@export var currentType: TYPE
#------------Methods-------------#
func _ready():
var root = get_tree().root.get_child(0)
root.shooting.connect(_on_signal_storing)
maxStashValue = 5
currentStashValue = 0
func interact():
if currentStashValue >= 1:
--currentStashValue
return
func _on_signal_storing():
if currentStashValue < maxStashValue:
++currentStashValue
return