feat(client): GameState move targets — remove_item, reveal/gift tracking

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 12:34:33 -05:00
parent 9d2f93bbf2
commit 1d1ae37281
2 changed files with 49 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ var luck_base: int = 0
var stats: Dictionary = {} # {str, dex, con, fth, mag}
var npc_dispositions: Dictionary = {} # world-npc id -> int (100..100)
var inventory: Dictionary = {} # item_id -> qty
var revealed_topics: Dictionary = {} # topic_id -> true
var gifts_given: Dictionary = {} # item_id -> true (idempotency for give_item)
func set_luck(v: int) -> void:
@@ -29,3 +31,27 @@ func set_npc_disposition(id: String, v: int) -> void:
func add_item(item_id: String, qty: int) -> void:
inventory[item_id] = int(inventory.get(item_id, 0)) + qty
func remove_item(item_id: String, qty: int) -> void:
var left := int(inventory.get(item_id, 0)) - qty
if left > 0:
inventory[item_id] = left
else:
inventory.erase(item_id)
func mark_revealed(topic_id: String) -> void:
revealed_topics[topic_id] = true
func is_revealed(topic_id: String) -> bool:
return revealed_topics.has(topic_id)
func mark_gift_given(item_id: String) -> void:
gifts_given[item_id] = true
func is_gift_given(item_id: String) -> bool:
return gifts_given.has(item_id)