add base system

This commit is contained in:
2026-04-11 18:40:28 +02:00
parent ecaa3704d7
commit adaa9eda98
35 changed files with 689 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
extends Node
signal on_collectible_unlocked(collectible_id: String)
#TODO -> assign library resource to game_state
var library: CollectibleLibrary = preload("res://core/photo_mode/collectible_library.tres")
var unlocked_ids: Array[String] = ['cane']
func unlock_photo(collectible_id: String) -> void:
if not collectible_id in unlocked_ids:
unlocked_ids.append(collectible_id)
var new_collectible = get_collectible_by_id(collectible_id)
if new_collectible:
on_collectible_unlocked.emit(collectible_id)
func get_collectible_by_id(id: String) -> CollectibleResource:
for collectible in library.collectibles:
if collectible.id == id:
return collectible
return null
func get_all_collectibles() -> Array[CollectibleResource]:
return library.collectibles
func get_unlocked_collectible_ids() -> Array[String]:
return unlocked_ids