From 03608a828e0776702fac2ed6c22a92b10b60e7ca Mon Sep 17 00:00:00 2001 From: Carlos Juniors Chiroque //CJ <135936478+Russell-CJ@users.noreply.github.com> Date: Sat, 24 Jan 2026 11:22:15 -0500 Subject: [PATCH 1/5] add barrel glow animation assets - Added the 'barrel_glow' folder containing the sprite sheet and animation resource. - Added a new AnimatedSprite2D node named 'BarrelGlow' to the FillingBarrel scene. - Configured the 'glowing' animation and set the correct offset to align with the barrel. feat: https://github.com/endlessm/threadbare/issues/1847 --- .../props/filling_barrel/filling_barrel.tscn | 80 ++++++++++++++++++- .../components/barrel_glow/barrel_glow.png | 3 + .../barrel_glow/barrel_glow.png.import | 40 ++++++++++ 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png create mode 100644 scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png.import diff --git a/scenes/game_elements/props/filling_barrel/filling_barrel.tscn b/scenes/game_elements/props/filling_barrel/filling_barrel.tscn index 60c880937a..3311157c9e 100644 --- a/scenes/game_elements/props/filling_barrel/filling_barrel.tscn +++ b/scenes/game_elements/props/filling_barrel/filling_barrel.tscn @@ -1,10 +1,82 @@ -[gd_scene load_steps=11 format=3 uid="uid://y8ha8abfyap2"] +[gd_scene load_steps=22 format=3 uid="uid://y8ha8abfyap2"] [ext_resource type="Script" uid="uid://be17wk85qlu28" path="res://scenes/game_elements/props/filling_barrel/components/filling_barrel.gd" id="1_md0e3"] +[ext_resource type="Texture2D" uid="uid://brranfy51i56n" path="res://scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png" id="3_8hqam"] [ext_resource type="SpriteFrames" uid="uid://dlsq0ke41s1yh" path="res://scenes/game_elements/props/filling_barrel/components/filling_barrel_sprite_frames.tres" id="3_o1oxn"] [ext_resource type="AudioStream" uid="uid://6tgopt072bfq" path="res://scenes/game_elements/props/filling_barrel/components/fill.wav" id="4_6inx0"] [ext_resource type="AudioStream" uid="uid://s7ne07cx0j72" path="res://scenes/game_elements/props/filling_barrel/components/complete.wav" id="5_3gtj0"] +[sub_resource type="AtlasTexture" id="AtlasTexture_ho6qg"] +atlas = ExtResource("3_8hqam") +region = Rect2(0, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ig56r"] +atlas = ExtResource("3_8hqam") +region = Rect2(128, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ompl8"] +atlas = ExtResource("3_8hqam") +region = Rect2(256, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0a20k"] +atlas = ExtResource("3_8hqam") +region = Rect2(384, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2evyj"] +atlas = ExtResource("3_8hqam") +region = Rect2(512, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i2u8c"] +atlas = ExtResource("3_8hqam") +region = Rect2(640, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fc6b6"] +atlas = ExtResource("3_8hqam") +region = Rect2(768, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_haw5m"] +atlas = ExtResource("3_8hqam") +region = Rect2(896, 0, 128, 128) + +[sub_resource type="AtlasTexture" id="AtlasTexture_j04m1"] +atlas = ExtResource("3_8hqam") +region = Rect2(1024, 0, 128, 128) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ftrfy"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_ho6qg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ig56r") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ompl8") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0a20k") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2evyj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i2u8c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fc6b6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_haw5m") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_j04m1") +}], +"loop": true, +"name": &"glowing", +"speed": 10.0 +}] + [sub_resource type="RectangleShape2D" id="RectangleShape2D_8tegq"] size = Vector2(52, 52) @@ -166,6 +238,12 @@ position = Vector2(0, -21) sprite_frames = ExtResource("3_o1oxn") animation = &"filling" +[node name="BarrelGlow" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_ftrfy") +animation = &"glowing" +frame_progress = 0.41853628 +offset = Vector2(0, -21) + [node name="HitBox" type="StaticBody2D" parent="."] unique_name_in_owner = true position = Vector2(2, -18) diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png new file mode 100644 index 0000000000..72a5085ca2 --- /dev/null +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc7196d40c17d46a59f9edf859b75b9ebb8e9a67f8e06818e1007ce5353fb54f +size 1563 diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png.import b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png.import new file mode 100644 index 0000000000..769174a684 --- /dev/null +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://brranfy51i56n" +path="res://.godot/imported/barrel_glow.png-05ec822d59b536030b7c5094e7b8b456.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_glow/barrel_glow.png" +dest_files=["res://.godot/imported/barrel_glow.png-05ec822d59b536030b7c5094e7b8b456.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 From 566ebecd6c5db9cb31067b5eed4e0e37f9d51ebd Mon Sep 17 00:00:00 2001 From: Carlos Juniors Chiroque //CJ <135936478+Russell-CJ@users.noreply.github.com> Date: Sat, 24 Jan 2026 11:33:20 -0500 Subject: [PATCH 2/5] adjust BarrelGlow offset and initial visibility - Set the Y offset to -21 to align correctly with the barrel sprite. - Set the initial visibility to false so it remains hidden until activated. fix: https://github.com/endlessm/threadbare/issues/1847 --- scenes/game_elements/props/filling_barrel/filling_barrel.tscn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scenes/game_elements/props/filling_barrel/filling_barrel.tscn b/scenes/game_elements/props/filling_barrel/filling_barrel.tscn index 3311157c9e..0b72b708fc 100644 --- a/scenes/game_elements/props/filling_barrel/filling_barrel.tscn +++ b/scenes/game_elements/props/filling_barrel/filling_barrel.tscn @@ -239,9 +239,10 @@ sprite_frames = ExtResource("3_o1oxn") animation = &"filling" [node name="BarrelGlow" type="AnimatedSprite2D" parent="."] +visible = false sprite_frames = SubResource("SpriteFrames_ftrfy") animation = &"glowing" -frame_progress = 0.41853628 +frame_progress = 0.44630986 offset = Vector2(0, -21) [node name="HitBox" type="StaticBody2D" parent="."] From 4a5192932d8bd78e1b747fedf84e927f40cd4d53 Mon Sep 17 00:00:00 2001 From: Carlos Juniors Chiroque //CJ <135936478+Russell-CJ@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:24:34 -0500 Subject: [PATCH 3/5] add BarrelUnlockSequence script - Added new component to handle sequential unlocking logic. - Implemented shuffle and locked state management. feat: https://github.com/endlessm/threadbare/issues/1847 --- .../components/barrel_unlock_sequence.gd | 46 +++++++++++++++++++ .../components/barrel_unlock_sequence.gd.uid | 1 + 2 files changed, 47 insertions(+) create mode 100644 scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd create mode 100644 scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd.uid diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd new file mode 100644 index 0000000000..5716cb04fb --- /dev/null +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: The Threadbare Authors +# SPDX-License-Identifier: MPL-2.0 +class_name BarrelUnlockSequence +extends Node + +@export var barrels: Array[FillingBarrel] +@export var auto_start: bool = true + +var current_target_index: int = 0 + + +func _ready() -> void: + if auto_start: + call_deferred("start_sequence") + + +func start_sequence() -> void: + randomize() + + if barrels.is_empty(): + push_warning("BarrelUnlockSequence: No barrels assigned.") + return + + barrels.shuffle() + + for barrel in barrels: + if not barrel.completed.is_connected(_on_barrel_completed): + barrel.completed.connect(_on_barrel_completed) + + # Initial state: all locked + barrel.set_locked_state(true) + + unlock_next_barrel() + + +func unlock_next_barrel() -> void: + if current_target_index < barrels.size(): + var target: FillingBarrel = barrels[current_target_index] + + if is_instance_valid(target): + target.set_locked_state(false) + + +func _on_barrel_completed() -> void: + current_target_index += 1 + unlock_next_barrel() diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd.uid b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd.uid new file mode 100644 index 0000000000..e91e94ca31 --- /dev/null +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd.uid @@ -0,0 +1 @@ +uid://en37d2lad0px From d233f8582f0c44ff23ab7e2bfbe7abb694a739d2 Mon Sep 17 00:00:00 2001 From: Carlos Juniors Chiroque //CJ <135936478+Russell-CJ@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:39:14 -0500 Subject: [PATCH 4/5] implement locking capability in FillingBarrel - Updated 'filling_barrel.gd' to ignore inputs when locked. - Added visual feedback handling dimmed color for locked state. feat: https://github.com/endlessm/threadbare/issues/1847 --- .../components/filling_barrel.gd | 22 +++++++++++++++++++ .../props/filling_barrel/filling_barrel.tscn | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scenes/game_elements/props/filling_barrel/components/filling_barrel.gd b/scenes/game_elements/props/filling_barrel/components/filling_barrel.gd index 90ef7c9723..f6ee155e8e 100644 --- a/scenes/game_elements/props/filling_barrel/components/filling_barrel.gd +++ b/scenes/game_elements/props/filling_barrel/components/filling_barrel.gd @@ -37,8 +37,11 @@ const FILLING_NAME_ANIMATION: StringName = &"filling" @export var color: Color: set = _set_color +var is_locked: bool = false + var _amount: int = 0 +@onready var barrel_glow: AnimatedSprite2D = $BarrelGlow @onready var animated_sprite_2d: AnimatedSprite2D = %AnimatedSprite2D @onready var animation_player: AnimationPlayer = %AnimationPlayer @onready var collision_shape_2d: CollisionShape2D = %CollisionShape2D @@ -70,10 +73,29 @@ func _ready() -> void: animated_sprite_2d.animation = FILLING_NAME_ANIMATION animated_sprite_2d.frame = 0 + if barrel_glow: + barrel_glow.visible = false + + +func set_locked_state(locked: bool) -> void: + is_locked = locked + + if is_locked: + modulate = Color(0.5, 0.5, 0.5, 1) + if barrel_glow: + barrel_glow.visible = false + else: + modulate = Color(1, 1, 1, 1) + if barrel_glow: + barrel_glow.visible = true + barrel_glow.play("glowing") + ## Increment the amount and play an animation. If completed, also play the completed ## animation and remove this barrel from the current scene. func increment(by: int = 1) -> void: + if is_locked: + return if _amount >= needed_amount: return animation_player.play(&"increment") diff --git a/scenes/game_elements/props/filling_barrel/filling_barrel.tscn b/scenes/game_elements/props/filling_barrel/filling_barrel.tscn index 0b72b708fc..507aac10f4 100644 --- a/scenes/game_elements/props/filling_barrel/filling_barrel.tscn +++ b/scenes/game_elements/props/filling_barrel/filling_barrel.tscn @@ -242,7 +242,7 @@ animation = &"filling" visible = false sprite_frames = SubResource("SpriteFrames_ftrfy") animation = &"glowing" -frame_progress = 0.44630986 +frame_progress = 0.55175865 offset = Vector2(0, -21) [node name="HitBox" type="StaticBody2D" parent="."] From 1c1ec84fcb9cc484f72797505bf10891e803a0c1 Mon Sep 17 00:00:00 2001 From: Carlos Juniors Chiroque //CJ <135936478+Russell-CJ@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:40:54 -0500 Subject: [PATCH 5/5] integrate sequential barrel mechanic - Added 'BarrelUnlockSequence' node to the level scene. - Configured barrels to unlock one by one in random order. feat: https://github.com/endlessm/threadbare/issues/1847 --- .../quest_003/2_ink_drinker_levels/ink_combat_round_6.tscn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_6.tscn b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_6.tscn index 68f09db5bd..8dae77d38e 100644 --- a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_6.tscn +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_6.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=34 format=4 uid="uid://biwvr6vxj6ykk"] +[gd_scene load_steps=35 format=4 uid="uid://biwvr6vxj6ykk"] [ext_resource type="PackedScene" uid="uid://2rbpl811wlv1" path="res://scenes/game_elements/props/background_music/background_music.tscn" id="1_7y6db"] [ext_resource type="TileSet" uid="uid://oynx002hv8tl" path="res://tiles/water.tres" id="1_16xyg"] @@ -6,6 +6,7 @@ [ext_resource type="TileSet" uid="uid://b8qnr0owsbhhn" path="res://tiles/exterior_floors.tres" id="2_g1en3"] [ext_resource type="TileSet" uid="uid://dfp36ffpanjq2" path="res://tiles/elevation.tres" id="2_s2t2y"] [ext_resource type="Script" uid="uid://cp54mgi54nywo" path="res://scenes/game_logic/fill_game_logic.gd" id="3_1a5yo"] +[ext_resource type="Script" uid="uid://en37d2lad0px" path="res://scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/components/barrel_unlock_sequence.gd" id="3_ihx08"] [ext_resource type="TileSet" uid="uid://bjx3gvah0ycl1" path="res://tiles/foam_2.tres" id="5_4co4a"] [ext_resource type="TileSet" uid="uid://do0ffypatd77h" path="res://tiles/bridges.tres" id="5_bl3l0"] [ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="5_pbtyo"] @@ -63,6 +64,10 @@ metadata/_custom_type_script = "uid://bgmwplmj3bfls" [node name="BackgroundMusic" parent="." instance=ExtResource("1_7y6db")] stream = ExtResource("2_1a5yo") +[node name="BarrelUnlockSequence" type="Node" parent="." node_paths=PackedStringArray("barrels")] +script = ExtResource("3_ihx08") +barrels = [NodePath("../OnTheGround/FillingBarrel"), NodePath("../OnTheGround/FillingBarrel2"), NodePath("../OnTheGround/FillingBarrel3")] + [node name="FillGameLogic" type="Node" parent="."] script = ExtResource("3_1a5yo") barrels_to_win = 3