mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Leo - Train pickup function
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user