Leo - storage finished2.0

This commit is contained in:
2022-12-10 13:09:57 +01:00
parent 7d8127e151
commit 797396b4f2
9 changed files with 26 additions and 20 deletions

View File

@@ -5,5 +5,5 @@ class_name Bin
@onready var train = get_parent() as Train
#------------Methods-------------#
func interact():
func interact(player):
train.get_node("CharacterBody3D").inventory = 0

View File

@@ -15,7 +15,7 @@ func _ready():
currentStashValue = 1
currentState = STATE.INACTIVE
#TODO: FINISH
func interact():
func interact(player):
if currentState == STATE.INACTIVE:
#TODO: RELOADING

View File

@@ -15,7 +15,7 @@ func _ready():
currentStashValue = 100
currentState = STATE.RUNNING
#TODO: FINISH
func interact():
func interact(player):
if currentState == STATE.RUNNING:
if (train.current_speed + refuelRate) <= maxSpeed:
train.current_speed += refuelRate

View File

@@ -20,7 +20,7 @@ enum MODULE_TYPE {CANNON, STEERING, ENGINE, STORAGE}
#------------Methods-------------#
func interact():
func interact(player):
pass

View File

@@ -11,11 +11,12 @@ func _ready():
var root = get_tree().root.get_child(0)
root.ammo_pickup.connect(_on_signal_storing)
maxStashValue = 5
currentStashValue = 0
func interact():
currentStashValue = 5
func interact(player):
if currentStashValue >= 1:
currentStashValue -= 1
player.fill_inventory(currentType)
return
func _on_signal_storing():