sugary-panda (#1)

Reviewed-on: #1
Co-authored-by: Bryce <bryce@brycecovertoperations.com>
Co-committed-by: Bryce <bryce@brycecovertoperations.com>
This commit was merged in pull request #1.
This commit is contained in:
2026-04-28 22:05:11 -07:00
committed by notid
parent dee6216873
commit 639060fa7f
30 changed files with 2402 additions and 6 deletions

View File

@@ -476,5 +476,54 @@ func switch_camera(path):
func reset_camera():
var thing = ResetCamera.new()
return thing
class GiveItem:
extends ScriptNode
var item_id: String = ""
var text: String = ""
var subject: Node2D = null
var done = false
var started = false
func step_type():
return "GiveItem " + item_id
func init(scene):
super(scene)
func do(delta):
if not started:
started = true
if text:
await scene.find_child("dialogue").say(text)
InventoryManager.acquire_item(item_id)
done = true
func is_done():
return done
func interrupt():
done = true
class GiveItemDeferred:
extends GiveItem
var subject_name: String = ""
func init(scene):
super(scene)
subject = scene.get_node(subject_name)
func give_item(item_id: String, text: String = ""):
var step = GiveItem.new()
step.item_id = item_id
step.text = text
return step
func give_item_deferred(item_id: String, subject_name: String, text: String = ""):
var step = GiveItemDeferred.new()
step.item_id = item_id
step.subject_name = subject_name
step.text = text
return step
var current_script : ScriptGraph = null