beta-1.3/restructure-files (#2)
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
9
Entities/Map Objects/Chests/Bases/base_chest.tscn
Normal file
9
Entities/Map Objects/Chests/Bases/base_chest.tscn
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://cd3iyspcdg8m"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://0fsmtp1umvmp" path="res://Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd" id="1_6u2sl"]
|
||||
|
||||
[node name="Base Chest" type="StaticBody2D" unique_id=975880832 groups=["Treasure Chest Group"]]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_6u2sl")
|
||||
7
Entities/Map Objects/Chests/Bases/base_item_chest.tscn
Normal file
7
Entities/Map Objects/Chests/Bases/base_item_chest.tscn
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://cncm0c4dmosgs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dbuc0f87m24xf" path="res://Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd" id="1_mkt0u"]
|
||||
|
||||
[node name="Base Item Chest" type="StaticBody2D" unique_id=991903258]
|
||||
script = ExtResource("1_mkt0u")
|
||||
metadata/_custom_type_script = "uid://0fsmtp1umvmp"
|
||||
@@ -0,0 +1,105 @@
|
||||
[gd_scene format=3 uid="uid://byp273amg5ji8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Entities/Map Objects/Chests/Scripts/item_chest_01.gd" id="1_lp0kr"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn" id="2_iwcc8"]
|
||||
[ext_resource type="Texture2D" uid="uid://crf23tc55dxu" path="res://Assets/Spritesheets/Treasure Chests/Chest_Anim.png" id="3_iwcc8"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y3ooa"]
|
||||
size = Vector2(16, 6)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b5bus"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8m6gq"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2vpuu"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydixn"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wetyp"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hwpw4"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_clx0v"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t1w70"]
|
||||
atlas = ExtResource("3_iwcc8")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_0r744"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b5bus")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8m6gq")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2vpuu")
|
||||
}, {
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_ydixn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wetyp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hwpw4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_clx0v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t1w70")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t6vq7"]
|
||||
size = Vector2(8, 9)
|
||||
|
||||
[node name="Item Chest 01" type="StaticBody2D" unique_id=152271802 groups=["Treasure Chest Group"]]
|
||||
script = ExtResource("1_lp0kr")
|
||||
metadata/_custom_type_script = "uid://dbuc0f87m24xf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=192723247]
|
||||
position = Vector2(0, -3)
|
||||
shape = SubResource("RectangleShape2D_y3ooa")
|
||||
|
||||
[node name="Sprite" parent="." unique_id=1811986888 instance=ExtResource("2_iwcc8")]
|
||||
sprite_frames = SubResource("SpriteFrames_0r744")
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=406451066]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=124862139]
|
||||
position = Vector2(0, -9.5)
|
||||
shape = SubResource("RectangleShape2D_t6vq7")
|
||||
debug_color = Color(0.8351757, 0.36057177, 0.39313078, 0.41960785)
|
||||
@@ -0,0 +1,106 @@
|
||||
[gd_scene format=3 uid="uid://b7u4hlvuqiefn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvq13h8uyx572" path="res://Entities/Map Objects/Chests/Scripts/item_chest_01.gd" id="1_77oue"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3rqn611axsfk" path="res://Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn" id="2_jpeii"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcbk854sc3uud" path="res://Assets/Spritesheets/Home Decor/Metal_Chest_Anim.png" id="3_jpeii"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y3ooa"]
|
||||
size = Vector2(16, 6)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1k0b3"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydgix"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s4uuj"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f64hp"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xb452"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mmcbf"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_p1iln"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wsmdh"]
|
||||
atlas = ExtResource("3_jpeii")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_2qcbe"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1k0b3")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ydgix")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s4uuj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_f64hp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xb452")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mmcbf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_p1iln")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wsmdh")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t6vq7"]
|
||||
size = Vector2(8, 9)
|
||||
|
||||
[node name="Item Chest 02" type="StaticBody2D" unique_id=152271802 groups=["Treasure Chest Group"]]
|
||||
script = ExtResource("1_77oue")
|
||||
metadata/_custom_type_script = "uid://dbuc0f87m24xf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=192723247]
|
||||
position = Vector2(0, -3)
|
||||
shape = SubResource("RectangleShape2D_y3ooa")
|
||||
|
||||
[node name="Sprite" parent="." unique_id=1811986888 instance=ExtResource("2_jpeii")]
|
||||
sprite_frames = SubResource("SpriteFrames_2qcbe")
|
||||
animation = &"opening"
|
||||
|
||||
[node name="Interactable" type="Area2D" parent="." unique_id=406451066]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable" unique_id=124862139]
|
||||
position = Vector2(0, -9.5)
|
||||
shape = SubResource("RectangleShape2D_t6vq7")
|
||||
debug_color = Color(0.8351757, 0.36057177, 0.39313078, 0.41960785)
|
||||
14
Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd
Normal file
14
Entities/Map Objects/Chests/Scripts/Bases/chest_base.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends StaticBody2D
|
||||
class_name BaseChest
|
||||
|
||||
signal OpeningAnimationStarted
|
||||
|
||||
@export var is_open := false
|
||||
|
||||
# Public Methods
|
||||
func Open() -> void:
|
||||
is_open = true
|
||||
|
||||
|
||||
func OpenAlreadyOpened() -> void:
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://0fsmtp1umvmp
|
||||
4
Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd
Normal file
4
Entities/Map Objects/Chests/Scripts/Bases/item_chest.gd
Normal file
@@ -0,0 +1,4 @@
|
||||
extends BaseChest
|
||||
class_name BaseItemChest
|
||||
|
||||
@export var item_id: Enums.Items
|
||||
@@ -0,0 +1 @@
|
||||
uid://dbuc0f87m24xf
|
||||
33
Entities/Map Objects/Chests/Scripts/item_chest_01.gd
Normal file
33
Entities/Map Objects/Chests/Scripts/item_chest_01.gd
Normal file
@@ -0,0 +1,33 @@
|
||||
extends BaseItemChest
|
||||
|
||||
@onready var chest_01_sprite: AnimatedSprite2D = $"Sprite"
|
||||
|
||||
@export var is_locked := false
|
||||
@export var locked_message_dialogue_trigger: DialogueTrigger
|
||||
@export var already_opened_message_dialogue_trigger: DialogueTrigger
|
||||
|
||||
# Public Methods
|
||||
func Open() -> void:
|
||||
if is_locked:
|
||||
if locked_message_dialogue_trigger:
|
||||
locked_message_dialogue_trigger.Trigger()
|
||||
return
|
||||
|
||||
super.Open()
|
||||
|
||||
OpeningAnimationStarted.emit()
|
||||
chest_01_sprite.play("opening")
|
||||
|
||||
var item_name: String = Enums.Items.keys()[item_id]
|
||||
print(item_name)
|
||||
|
||||
|
||||
func OpenAlreadyOpened() -> void:
|
||||
if already_opened_message_dialogue_trigger:
|
||||
already_opened_message_dialogue_trigger.Trigger()
|
||||
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
if is_open:
|
||||
chest_01_sprite.play("opened")
|
||||
1
Entities/Map Objects/Chests/Scripts/item_chest_01.gd.uid
Normal file
1
Entities/Map Objects/Chests/Scripts/item_chest_01.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bvq13h8uyx572
|
||||
84
Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn
Normal file
84
Entities/Map Objects/Chests/Sprites/chest01_sprite.tscn
Normal file
@@ -0,0 +1,84 @@
|
||||
[gd_scene format=3 uid="uid://d3rqn611axsfk"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://crf23tc55dxu" path="res://Assets/Spritesheets/Treasure Chests/Chest_Anim.png" id="1_8m6gq"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b5bus"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8m6gq"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2vpuu"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ydixn"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wetyp"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hwpw4"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_clx0v"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t1w70"]
|
||||
atlas = ExtResource("1_8m6gq")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_sx0xc"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b5bus")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8m6gq")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"opened",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2vpuu")
|
||||
}, {
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_ydixn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wetyp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hwpw4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_clx0v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t1w70")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="Chest01 Sprite" type="AnimatedSprite2D" unique_id=1811986888]
|
||||
y_sort_enabled = true
|
||||
sprite_frames = SubResource("SpriteFrames_sx0xc")
|
||||
animation = &"closed"
|
||||
autoplay = "closed"
|
||||
offset = Vector2(0, -6)
|
||||
Reference in New Issue
Block a user