Leo - Train pickup function

This commit is contained in:
2022-12-10 20:44:43 +01:00
parent 977a451752
commit 8ef7cc2507
2 changed files with 20 additions and 5 deletions

View File

@@ -33,3 +33,15 @@ func is_dead():
game_over.emit()
return true
return false
func on_pickup(type, amount):
for s in STORAGES:
if s.currentType == type:
if s.currentStashValue + amount <= s.maxStashValue:
s.currentStashValue += amount
else:
s.currentStashValue = s.maxStashValue
return