diff options
Diffstat (limited to 'apworld/client')
| -rw-r--r-- | apworld/client/main.gd | 1 | ||||
| -rw-r--r-- | apworld/client/paintingAuto.gd | 43 |
2 files changed, 44 insertions, 0 deletions
| diff --git a/apworld/client/main.gd b/apworld/client/main.gd index e1f9610..3a62f81 100644 --- a/apworld/client/main.gd +++ b/apworld/client/main.gd | |||
| @@ -43,6 +43,7 @@ func _ready(): | |||
| 43 | installScriptExtension(runtime.load_script("keyHolderChecker.gd")) | 43 | installScriptExtension(runtime.load_script("keyHolderChecker.gd")) |
| 44 | installScriptExtension(runtime.load_script("keyHolderResetterListener.gd")) | 44 | installScriptExtension(runtime.load_script("keyHolderResetterListener.gd")) |
| 45 | installScriptExtension(runtime.load_script("painting.gd")) | 45 | installScriptExtension(runtime.load_script("painting.gd")) |
| 46 | installScriptExtension(runtime.load_script("paintingAuto.gd")) | ||
| 46 | installScriptExtension(runtime.load_script("panel.gd")) | 47 | installScriptExtension(runtime.load_script("panel.gd")) |
| 47 | installScriptExtension(runtime.load_script("pauseMenu.gd")) | 48 | installScriptExtension(runtime.load_script("pauseMenu.gd")) |
| 48 | installScriptExtension(runtime.load_script("player.gd")) | 49 | installScriptExtension(runtime.load_script("player.gd")) |
| diff --git a/apworld/client/paintingAuto.gd b/apworld/client/paintingAuto.gd new file mode 100644 index 0000000..553c2c9 --- /dev/null +++ b/apworld/client/paintingAuto.gd | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | extends "res://scripts/nodes/paintingAuto.gd" | ||
| 2 | |||
| 3 | var item_id | ||
| 4 | var item_amount | ||
| 5 | |||
| 6 | |||
| 7 | func _ready(): | ||
| 8 | var node_path = String( | ||
| 9 | get_tree().get_root().get_node("scene").get_path_to(self).get_concatenated_names() | ||
| 10 | ) | ||
| 11 | |||
| 12 | var gamedata = global.get_node("Gamedata") | ||
| 13 | var door_id = gamedata.get_door_for_map_node_path(global.map, node_path) | ||
| 14 | if door_id != null: | ||
| 15 | var ap = global.get_node("Archipelago") | ||
| 16 | var item_lock = ap.get_item_id_for_door(door_id) | ||
| 17 | |||
| 18 | if item_lock != null: | ||
| 19 | item_id = item_lock[0] | ||
| 20 | item_amount = item_lock[1] | ||
| 21 | |||
| 22 | self.senders = [] | ||
| 23 | self.senderGroup = [] | ||
| 24 | self.nested = false | ||
| 25 | self.complete_at = 0 | ||
| 26 | self.max_length = 0 | ||
| 27 | self.excludeSenders = [] | ||
| 28 | |||
| 29 | call_deferred("_readier") | ||
| 30 | |||
| 31 | super._ready() | ||
| 32 | |||
| 33 | if item_id != null and activate_on_sender_complete: | ||
| 34 | enabled = false | ||
| 35 | if not hide_particles: | ||
| 36 | get_node("Hinge/paintingColliders/TeleportParticles").emitting = false | ||
| 37 | |||
| 38 | |||
| 39 | func _readier(): | ||
| 40 | var ap = global.get_node("Archipelago") | ||
| 41 | |||
| 42 | if ap.client.getItemAmount(item_id) >= item_amount: | ||
| 43 | handleTriggered() | ||
