diff --git a/addons/escoria-core/game/core-scripts/esc_location.gd b/addons/escoria-core/game/core-scripts/esc_location.gd new file mode 100644 index 00000000..27b3e4c9 --- /dev/null +++ b/addons/escoria-core/game/core-scripts/esc_location.gd @@ -0,0 +1,37 @@ +# A simple node extending Position2D with a global ID so that it can be +# referenced in ESC Scripts. +extends Position2D +class_name ESCLocation + +# The global ID of this item +export(String) var global_id + +# If true, player orients towards 'interaction_direction' as +# player character arrives. +export(bool) var player_orients_on_arrival = true + +# Let the player turn to this direction when the player arrives +# at the item +export(int) var interaction_direction + + +# Used by "is" keyword to check whether a node's class_name +# is the same as p_classname. +# +# ## Parameters +# +# p_classname: String class to compare against +func is_class(p_classname: String) -> bool: + return p_classname == "ESCLocation" + + +# Ready function +func _ready(): + if not self.global_id.empty(): + escoria.object_manager.register_object( + ESCObject.new( + self.global_id, + self + ), + true + ) diff --git a/addons/escoria-core/game/escoria.gd b/addons/escoria-core/game/escoria.gd index 9f506b29..e4cd68c4 100644 --- a/addons/escoria-core/game/escoria.gd +++ b/addons/escoria-core/game/escoria.gd @@ -172,8 +172,12 @@ func do(action: String, params: Array = []) -> void: var object = self.object_manager.get_object(params[1]) if object: - var target_position: Vector2 = \ - object.node.interact_position + var target_position: Vector2 + if object.node is ESCLocation: + target_position = object.node.global_position + else: + target_position = object.node.interact_position + var is_fast: bool = false if params.size() > 2 and params[2] == true: is_fast = true diff --git a/game/rooms/room01/esc/room01.esc b/game/rooms/room01/esc/room01.esc index 4ae5447e..d04b04fd 100755 --- a/game/rooms/room01/esc/room01.esc +++ b/game/rooms/room01/esc/room01.esc @@ -12,3 +12,4 @@ :ready set_sound_state bg_music res://game/sfx/contemplation.ogg true +walk player r1_destination_point diff --git a/game/rooms/room01/room01.tscn b/game/rooms/room01/room01.tscn index 06437eb7..db766f70 100644 --- a/game/rooms/room01/room01.tscn +++ b/game/rooms/room01/room01.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://game/rooms/room01/walkable_area.tscn" type="PackedScene" id=1] [ext_resource path="res://game/rooms/room01/background.tscn" type="PackedScene" id=2] @@ -6,6 +6,7 @@ [ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=5] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=7] [node name="room1" type="Node2D"] script = ExtResource( 6 ) @@ -63,6 +64,7 @@ polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1225.47, 353.99 ) +script = ExtResource( 7 ) [node name="item" type="Area2D" parent="Hotspots"] position = Vector2( -217.19, 0 ) @@ -78,6 +80,8 @@ polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028 [node name="Position2D" type="Position2D" parent="Hotspots/item"] position = Vector2( 671.798, 373.035 ) +script = ExtResource( 7 ) +global_id = "r1_left_object_interaction" [node name="Line2D" type="Line2D" parent="Hotspots/item"] position = Vector2( 0, -267.828 ) @@ -111,6 +115,8 @@ polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028 [node name="Position2D" type="Position2D" parent="Hotspots/item2"] position = Vector2( 671.798, 373.035 ) +script = ExtResource( 7 ) +global_id = "r2_left_object_interaction" [node name="Line2D" type="Line2D" parent="Hotspots/item2"] position = Vector2( -4.23779, -267.828 ) @@ -132,3 +138,11 @@ __meta__ = { [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 437.649 ) +script = ExtResource( 7 ) +global_id = "r1_start" + +[node name="destination_point" type="Position2D" parent="."] +position = Vector2( 476.984, 487.146 ) +script = ExtResource( 7 ) +global_id = "r1_destination_point" +interaction_direction = 4 diff --git a/game/rooms/room02/room02.tscn b/game/rooms/room02/room02.tscn index 9dac7bcc..5137fe45 100644 --- a/game/rooms/room02/room02.tscn +++ b/game/rooms/room02/room02.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://game/rooms/room02/walkable_area.tscn" type="PackedScene" id=1] [ext_resource path="res://game/rooms/room02/background.tscn" type="PackedScene" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://game/rooms/room02/button/button.tscn" type="PackedScene" id=5] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=7] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=8] [node name="room2" type="Node2D"] script = ExtResource( 6 ) @@ -45,6 +46,7 @@ polygon = PoolVector2Array( 870.974, 538.342, 827.536, 353.995, 1181.4, 357.174, [node name="action_pos" type="Position2D" parent="Hotspots/r_platform"] position = Vector2( 430.893, 451.052 ) +script = ExtResource( 8 ) [node name="r_door" type="Area2D" parent="Hotspots"] script = ExtResource( 7 ) @@ -60,6 +62,7 @@ polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1225.47, 353.99 ) +script = ExtResource( 8 ) [node name="l_door" type="Area2D" parent="Hotspots"] script = ExtResource( 7 ) @@ -75,6 +78,7 @@ polygon = PoolVector2Array( -1.37926, 443.158, 7.96461, 122.796, 84.0504, 77.411 [node name="Position2D" type="Position2D" parent="Hotspots/l_door"] position = Vector2( 52.1462, 384.691 ) +script = ExtResource( 8 ) [node name="button_right" parent="Hotspots" instance=ExtResource( 5 )] position = Vector2( 958.107, 176.401 ) @@ -84,6 +88,7 @@ dialog_color = Color( 0, 1, 0.109804, 1 ) [node name="Position2D" type="Position2D" parent="Hotspots/button_right"] position = Vector2( 29.4302, 195.411 ) +script = ExtResource( 8 ) __meta__ = { "_editor_description_": "" } @@ -96,9 +101,12 @@ dialog_color = Color( 0, 1, 0.109804, 1 ) [node name="Position2D" type="Position2D" parent="Hotspots/button_left"] position = Vector2( 24.6681, 196.998 ) +script = ExtResource( 8 ) __meta__ = { "_editor_description_": "" } [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 437.649 ) +script = ExtResource( 8 ) +global_id = "r2_player_start" diff --git a/game/rooms/room03/room03.tscn b/game/rooms/room03/room03.tscn index 1bcdfbb1..587ad7ad 100644 --- a/game/rooms/room03/room03.tscn +++ b/game/rooms/room03/room03.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://game/rooms/room03/walkable_area.tscn" type="PackedScene" id=1] [ext_resource path="res://game/rooms/room03/background.tscn" type="PackedScene" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=5] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] [ext_resource path="res://game/items/escitems/button.tscn" type="PackedScene" id=7] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=8] [node name="room3" type="Node2D"] script = ExtResource( 6 ) @@ -47,6 +48,7 @@ __meta__ = { [node name="Position2D" type="Position2D" parent="Hotspots/r_platform"] position = Vector2( 430.893, 451.052 ) +script = ExtResource( 8 ) __meta__ = { "_editor_description_": "" } @@ -67,6 +69,7 @@ polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1225.47, 353.99 ) +script = ExtResource( 8 ) [node name="l_door" type="Area2D" parent="Hotspots"] script = ExtResource( 5 ) @@ -84,6 +87,7 @@ polygon = PoolVector2Array( -2.71457, 437.818, 6.6293, 121.462, 89.3893, 74.7422 [node name="Position2D" type="Position2D" parent="Hotspots/l_door"] position = Vector2( 44.1375, 384.691 ) +script = ExtResource( 8 ) [node name="button" parent="Hotspots" instance=ExtResource( 7 )] global_id = "r3_button" @@ -91,6 +95,7 @@ esc_script = "res://game/rooms/room03/esc/button.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button"] position = Vector2( 347.767, 378.011 ) +script = ExtResource( 8 ) __meta__ = { "_editor_description_": "" } @@ -109,3 +114,4 @@ __meta__ = { [node name="player_start" type="Position2D" parent="."] position = Vector2( 63.3074, 444.653 ) +script = ExtResource( 8 ) diff --git a/game/rooms/room04/room04.tscn b/game/rooms/room04/room04.tscn index 3b6c1a61..d7f87d93 100644 --- a/game/rooms/room04/room04.tscn +++ b/game/rooms/room04/room04.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] [ext_resource path="res://game/rooms/room04/assets/background.png" type="Texture" id=7] [ext_resource path="res://game/rooms/room04/assets/depth_reduced.png" type="Texture" id=8] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=9] [sub_resource type="NavigationPolygon" id=1] vertices = PoolVector2Array( 371.757, 688.152, 542.371, 788.052, 2.46706, 794.786, 11.4468, 698.255, 189.918, 682.54, 1564.36, 574.459, 1578.66, 529.011, 1635.23, 551.638, 1624.42, 800.399, 1536.87, 579.274, 1012.68, 786.929, 1197.79, 675.666, 908.294, 488.354, 996.968, 451.313, 600.739, 456.925, 673.699, 490.599, 127.06, 573.661, 23.7938, 614.07, 42.8757, 527.64, 125.717, 528.797 ) @@ -69,6 +70,7 @@ __meta__ = { [node name="player_start" type="Position2D" parent="."] position = Vector2( 82.9282, 347.615 ) +script = ExtResource( 9 ) [node name="Hotspots" type="Node2D" parent="."] @@ -84,6 +86,7 @@ polygon = PoolVector2Array( 29.1046, 292.156, 31.0151, 76.8949, 147.177, 74.4792 [node name="Position2D" type="Position2D" parent="Hotspots/l_door"] position = Vector2( 83.6298, 279.703 ) +script = ExtResource( 9 ) [node name="r_door" type="Area2D" parent="Hotspots"] script = ExtResource( 5 ) @@ -97,3 +100,4 @@ polygon = PoolVector2Array( 1567.92, 294.848, 1573.21, 92.4902, 1657.34, 129.485 [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1611.46, 301.017 ) +script = ExtResource( 9 ) diff --git a/game/rooms/room05/room05.tscn b/game/rooms/room05/room05.tscn index cdd33d13..6347badd 100644 --- a/game/rooms/room05/room05.tscn +++ b/game/rooms/room05/room05.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1] [ext_resource path="res://game/rooms/room05/background.tscn" type="PackedScene" id=2] @@ -10,6 +10,7 @@ [ext_resource path="res://game/items/escitems/r5_wrench.tscn" type="PackedScene" id=8] [ext_resource path="res://game/items/escitems/r5_empty_sheet.tscn" type="PackedScene" id=9] [ext_resource path="res://game/items/escitems/r5_pen.tscn" type="PackedScene" id=10] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=11] [sub_resource type="NavigationPolygon" id=1] vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 129.634, 615.792, 1143.08, 613.35, -9.16094, 803.802, 84.5821, 654.06, -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698 ) @@ -100,6 +101,7 @@ polygon = PoolVector2Array( 0.328762, 440.897, 1.85199, 119.926, 85.9517, 74.621 [node name="Position2D" type="Position2D" parent="Hotspots/l_door"] position = Vector2( 37.4521, 392.045 ) +script = ExtResource( 11 ) [node name="r_door" type="Area2D" parent="Hotspots"] position = Vector2( -1, 0 ) @@ -115,6 +117,7 @@ polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1225.47, 353.99 ) +script = ExtResource( 11 ) [node name="item_wall" parent="Hotspots" instance=ExtResource( 5 )] position = Vector2( 2.37842, -254.49 ) @@ -123,8 +126,9 @@ esc_script = "res://game/rooms/room05/esc/wall_item.esc" tooltip_name = "Item on the wall" default_action = "look" -[node name="Position2D2" type="Position2D" parent="Hotspots/item_wall"] +[node name="Position2D" type="Position2D" parent="Hotspots/item_wall"] position = Vector2( 620.135, 613.652 ) +script = ExtResource( 11 ) __meta__ = { "_editor_description_": "" } @@ -135,13 +139,14 @@ interaction_direction = 2 [node name="Position2D" type="Position2D" parent="Hotspots/wrench"] position = Vector2( -77.4207, 0 ) +script = ExtResource( 11 ) [node name="pen" parent="Hotspots" instance=ExtResource( 10 )] position = Vector2( 909.908, 443.451 ) [node name="empty_sheet" parent="Hotspots" instance=ExtResource( 9 )] position = Vector2( 1059.84, 440.932 ) -dialog_color = Color( 1, 1, 1, 1 ) [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 437.649 ) +script = ExtResource( 11 ) diff --git a/game/rooms/room06/room06.tscn b/game/rooms/room06/room06.tscn index c862edfe..85d08181 100644 --- a/game/rooms/room06/room06.tscn +++ b/game/rooms/room06/room06.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1] [ext_resource path="res://game/rooms/room06/background.tscn" type="PackedScene" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] [ext_resource path="res://game/characters/worker/worker.tscn" type="PackedScene" id=7] [ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=8] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=9] [sub_resource type="NavigationPolygon" id=1] vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 129.634, 615.792, 1143.08, 613.35, -9.16094, 803.802, 84.5821, 654.06, -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698 ) @@ -61,6 +62,7 @@ esc_script = "res://game/rooms/room06/esc/left_exit.esc" [node name="Position2D" type="Position2D" parent="Hotspots/l_exit"] position = Vector2( 37.4521, 392.045 ) +script = ExtResource( 9 ) __meta__ = { "_editor_description_": "" } @@ -70,6 +72,7 @@ esc_script = "res://game/rooms/room06/esc/r6_door.esc" [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1180.52, 395.193 ) +script = ExtResource( 9 ) __meta__ = { "_editor_description_": "" } @@ -79,8 +82,10 @@ position = Vector2( 480, 430 ) esc_script = "res://game/rooms/room06/esc/worker.esc" interaction_direction = 2 -[node name="Position2D2" type="Position2D" parent="Hotspots/worker"] +[node name="Position2D" type="Position2D" parent="Hotspots/worker"] position = Vector2( -157.528, -1.62589 ) +script = ExtResource( 9 ) [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 437.649 ) +script = ExtResource( 9 ) diff --git a/game/rooms/room07/room07.tscn b/game/rooms/room07/room07.tscn index 1ea91422..2318558d 100644 --- a/game/rooms/room07/room07.tscn +++ b/game/rooms/room07/room07.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=2] +[gd_scene load_steps=17 format=2] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1] [ext_resource path="res://game/rooms/room07/background.tscn" type="PackedScene" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=5] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=7] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=8] [sub_resource type="NavigationPolygon" id=1] vertices = PoolVector2Array( 1976.63, 640.557, 1987.95, 588.863, 2070.07, 622.872, 2066.3, 799.721, 1015.72, 626.818, 1956.81, 616.096, -9.16094, 803.802, -6.44019, 711.297, 911.239, 554.152, 991.239, 554.152, 858.566, 628.405, 741.099, 620.468, 84.5821, 654.06, 3.15687, 646.051, 59.2201, 628.698, 129.634, 615.792 ) @@ -149,6 +150,7 @@ polygon = PoolVector2Array( 0.328762, 440.897, 1.85199, 119.926, 85.9517, 74.621 [node name="Position2D" type="Position2D" parent="Hotspots/l_exit"] position = Vector2( 37.4521, 392.045 ) +script = ExtResource( 8 ) [node name="r_exit" type="Area2D" parent="Hotspots"] position = Vector2( 0, 1409.59 ) @@ -168,6 +170,7 @@ polygon = PoolVector2Array( 1982.34, 349.116, 1980.1, 46.0513, 2081.12, 86.4599, [node name="Position2D" type="Position2D" parent="Hotspots/r_exit"] position = Vector2( 2038.8, 347.193 ) +script = ExtResource( 8 ) __meta__ = { "_editor_description_": "" } @@ -217,6 +220,7 @@ polygon = PoolVector2Array( 831.375, 344.577, 829.788, 19.1602, 1058.37, 19.1602 [node name="Position2D" type="Position2D" parent="Hotspots/lower_stairs"] position = Vector2( 953.985, 315.526 ) +script = ExtResource( 8 ) [node name="upper_stairs" type="Area2D" parent="Hotspots"] position = Vector2( 1347.64, 473.026 ) @@ -233,6 +237,7 @@ polygon = PoolVector2Array( 1221.86, -804.627, 1220.52, -1158.36, 1450.46, -1134 [node name="Position2D" type="Position2D" parent="Hotspots/upper_stairs"] position = Vector2( 27.5337, 131.767 ) +script = ExtResource( 8 ) [node name="button_camera_push" parent="Hotspots" instance=ExtResource( 3 )] position = Vector2( -167.43, 1463.23 ) @@ -241,6 +246,7 @@ esc_script = "res://game/rooms/room07/esc/button_push.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_camera_push"] position = Vector2( 343.048, 300.613 ) +script = ExtResource( 8 ) __meta__ = { "_editor_description_": "" } @@ -263,6 +269,7 @@ esc_script = "res://game/rooms/room07/esc/button_shift.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_camera_shift"] position = Vector2( 350.258, 301.616 ) +script = ExtResource( 8 ) [node name="Label" type="Label" parent="Hotspots/button_camera_shift"] margin_left = 305.626 @@ -282,6 +289,7 @@ esc_script = "res://game/rooms/room07/esc/button_follow.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_camera_follow"] position = Vector2( 350.258, 301.616 ) +script = ExtResource( 8 ) [node name="Label" type="Label" parent="Hotspots/button_camera_follow"] margin_left = 305.626 @@ -301,6 +309,7 @@ esc_script = "res://game/rooms/room07/esc/button_zoom.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_camera_zoom"] position = Vector2( 350.258, 301.616 ) +script = ExtResource( 8 ) [node name="Label" type="Label" parent="Hotspots/button_camera_zoom"] margin_left = 305.626 @@ -320,6 +329,7 @@ esc_script = "res://game/rooms/room07/esc/button_set_pos.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_camera_set_pos"] position = Vector2( 350.258, 301.616 ) +script = ExtResource( 8 ) [node name="Label" type="Label" parent="Hotspots/button_camera_set_pos"] margin_left = 292.919 @@ -431,3 +441,4 @@ anims/red = SubResource( 8 ) [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 1847.24 ) +script = ExtResource( 8 ) diff --git a/game/rooms/room08/room08.tscn b/game/rooms/room08/room08.tscn index 3f7b5a66..4cc85ecd 100644 --- a/game/rooms/room08/room08.tscn +++ b/game/rooms/room08/room08.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2] @@ -6,6 +6,7 @@ [ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=5] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=7] [sub_resource type="NavigationPolygon" id=1] vertices = PoolVector2Array( 1143.08, 613.35, 1267.68, 669.029, 1275.03, 799.721, -9.16094, 803.802, -6.44019, 711.297, 84.5821, 654.06, 742.298, 623.672, 581.028, 613.592, 583.548, 574.535, 707.02, 574.535, 714.58, 611.072, 3.15687, 646.051, 59.2201, 628.698, 129.634, 615.792, 530.631, 612.332, 550.79, 623.672, 783.875, 609.812 ) @@ -141,6 +142,7 @@ polygon = PoolVector2Array( 2.93237, 447.051, 2.93237, 127.051, 88.9324, 71.0505 [node name="Position2D" type="Position2D" parent="Hotspots/l_door"] position = Vector2( 45.47, 383.99 ) +script = ExtResource( 7 ) [node name="m_door" type="Area2D" parent="Hotspots"] script = ExtResource( 5 ) @@ -158,6 +160,7 @@ polygon = PoolVector2Array( 557.522, 348.813, 551.222, 42.6524, 743.99, 43.9123, [node name="Position2D" type="Position2D" parent="Hotspots/m_door"] position = Vector2( 653.466, 366.589 ) +script = ExtResource( 7 ) [node name="door" type="Polygon2D" parent="Hotspots/m_door"] color = Color( 0.4, 0.501961, 1, 1 ) @@ -186,6 +189,7 @@ shape = SubResource( 4 ) [node name="Position2D" type="Position2D" parent="Hotspots/r8_mini_puzzle_button"] position = Vector2( 474.801, 369.29 ) +script = ExtResource( 7 ) [node name="button_puzzle" type="Label" parent="Hotspots/r8_mini_puzzle_button"] margin_left = 445.617 @@ -218,6 +222,7 @@ shape = SubResource( 4 ) [node name="Position2D" type="Position2D" parent="Hotspots/r8_reset_puzzle_button"] position = Vector2( 474.801, 369.29 ) +script = ExtResource( 7 ) [node name="reset_puzzle" type="Label" parent="Hotspots/r8_reset_puzzle_button"] margin_left = 441.128 @@ -232,3 +237,4 @@ __meta__ = { [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 437.649 ) +script = ExtResource( 7 ) diff --git a/game/rooms/room09/room09.tscn b/game/rooms/room09/room09.tscn index 9e60aa63..14b76805 100644 --- a/game/rooms/room09/room09.tscn +++ b/game/rooms/room09/room09.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1] [ext_resource path="res://game/rooms/room09/background.tscn" type="PackedScene" id=2] @@ -11,6 +11,7 @@ [ext_resource path="res://game/rooms/room09/r_door.tscn" type="PackedScene" id=9] [ext_resource path="res://game/items/textures/genericItem_color_127.png" type="Texture" id=10] [ext_resource path="res://game/items/escitems/r9_bottle.tscn" type="PackedScene" id=11] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=12] [sub_resource type="NavigationPolygon" id=1] vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 1143.08, 613.35, -9.16094, 803.802, -6.44019, 711.297, 846.646, 637.49, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 864.626, 613.518, 428.618, 640.487, 386.666, 618.012, 129.634, 615.792 ) @@ -79,6 +80,7 @@ polygon = PoolVector2Array( 0.328762, 440.897, 1.85199, 119.926, 85.9517, 74.621 [node name="Position2D" type="Position2D" parent="Hotspots/l_door"] position = Vector2( 37.4521, 392.045 ) +script = ExtResource( 12 ) [node name="r_door" parent="Hotspots" instance=ExtResource( 9 )] global_id = "r9_r_exit" @@ -86,6 +88,7 @@ esc_script = "res://game/rooms/room09/esc/right_exit.esc" [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1198.65, 391.058 ) +script = ExtResource( 12 ) [node name="r9_closet_left" parent="Hotspots" instance=ExtResource( 5 )] position = Vector2( 435.233, 64.1518 ) @@ -95,6 +98,7 @@ tooltip_name = "Left closet" [node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_left"] position = Vector2( 69.9246, 318.898 ) +script = ExtResource( 12 ) [node name="bottle_left" parent="Hotspots/r9_closet_left" instance=ExtResource( 11 )] visible = false @@ -105,6 +109,7 @@ dont_apply_terrain_scaling = true [node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_left/bottle_left"] position = Vector2( -26.727, 543.448 ) +script = ExtResource( 12 ) [node name="r9_closet_middle" parent="Hotspots" instance=ExtResource( 5 )] position = Vector2( 572.963, 65.2113 ) @@ -114,6 +119,7 @@ tooltip_name = "Middle closet" [node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_middle"] position = Vector2( 65.6867, 317.839 ) +script = ExtResource( 12 ) [node name="bottle_middle" parent="Hotspots/r9_closet_middle" instance=ExtResource( 11 )] visible = false @@ -124,6 +130,7 @@ dont_apply_terrain_scaling = true [node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_middle/bottle_middle"] position = Vector2( -26.727, 543.448 ) +script = ExtResource( 12 ) [node name="r9_closet_right" parent="Hotspots" instance=ExtResource( 5 )] position = Vector2( 710.693, 66.2707 ) @@ -133,6 +140,7 @@ tooltip_name = "Right closet" [node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_right"] position = Vector2( 64.6273, 316.779 ) +script = ExtResource( 12 ) [node name="bottle_right" parent="Hotspots/r9_closet_right" instance=ExtResource( 11 )] visible = false @@ -143,6 +151,7 @@ dont_apply_terrain_scaling = true [node name="Position2D" type="Position2D" parent="Hotspots/r9_closet_right/bottle_right"] position = Vector2( -26.727, 543.448 ) +script = ExtResource( 12 ) [node name="button" parent="Hotspots" instance=ExtResource( 8 )] position = Vector2( 240.688, 160.459 ) @@ -151,6 +160,7 @@ esc_script = "res://game/rooms/room09/esc/button_reset.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button"] position = Vector2( 30.204, 209.54 ) +script = ExtResource( 12 ) [node name="Label" type="Label" parent="Hotspots/button"] margin_left = -15.5154 @@ -190,6 +200,8 @@ anims/set_bottle = SubResource( 2 ) [node name="Position2D" type="Position2D" parent="Hotspots/stand"] position = Vector2( 1043.27, 359.243 ) +script = ExtResource( 12 ) [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 437.649 ) +script = ExtResource( 12 ) diff --git a/game/rooms/room10/room10.tscn b/game/rooms/room10/room10.tscn index 4a7b3e8b..f122a74f 100644 --- a/game/rooms/room10/room10.tscn +++ b/game/rooms/room10/room10.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1] [ext_resource path="res://game/rooms/room10/background.tscn" type="PackedScene" id=2] [ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=3] [ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=5] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6] [ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=7] [ext_resource path="res://game/rooms/room02/button/button.tscn" type="PackedScene" id=8] @@ -61,12 +62,14 @@ polygon = PoolVector2Array( 0.328762, 440.897, 1.85199, 119.926, 85.9517, 74.621 [node name="Position2D" type="Position2D" parent="Hotspots/l_door"] position = Vector2( 37.4521, 392.045 ) +script = ExtResource( 5 ) [node name="r_door" parent="Hotspots" instance=ExtResource( 9 )] esc_script = "res://game/rooms/room10/esc/right_exit.esc" [node name="Position2D" type="Position2D" parent="Hotspots/r_door"] position = Vector2( 1198.65, 391.058 ) +script = ExtResource( 5 ) [node name="button_stop_bg_music" parent="Hotspots" instance=ExtResource( 8 )] position = Vector2( 243.165, 154.97 ) @@ -75,6 +78,7 @@ esc_script = "res://game/rooms/room10/esc/button_stop_bg_music.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_stop_bg_music"] position = Vector2( 22.6786, 212.927 ) +script = ExtResource( 5 ) [node name="Label" type="Label" parent="Hotspots/button_stop_bg_music"] margin_left = -8.81946 @@ -94,6 +98,7 @@ esc_script = "res://game/rooms/room10/esc/button_play_bg_music.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_play_bg_music"] position = Vector2( 22.6786, 212.927 ) +script = ExtResource( 5 ) [node name="Label" type="Label" parent="Hotspots/button_play_bg_music"] margin_left = -8.81946 @@ -113,6 +118,7 @@ esc_script = "res://game/rooms/room10/esc/button_play_snd.esc" [node name="Position2D" type="Position2D" parent="Hotspots/button_play_sound"] position = Vector2( 22.6786, 212.927 ) +script = ExtResource( 5 ) [node name="Label" type="Label" parent="Hotspots/button_play_sound"] margin_left = -8.81946 @@ -127,3 +133,4 @@ __meta__ = { [node name="player_start" type="Position2D" parent="."] position = Vector2( 76.7617, 437.649 ) +script = ExtResource( 5 ) diff --git a/game/ui/commons/options/options.gd b/game/ui/commons/options/options.gd index 333759e5..41d2fc62 100644 --- a/game/ui/commons/options/options.gd +++ b/game/ui/commons/options/options.gd @@ -18,7 +18,7 @@ func initialize_options(p_settings): $options/music_volume.value = p_settings["music_volume"] -func greyout_other_languages(except_lang: String) -> void: +func greyout_other_languages(_except_lang: String) -> void: pass diff --git a/project.godot b/project.godot index 0f775b0c..d89d35de 100644 --- a/project.godot +++ b/project.godot @@ -204,6 +204,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc_item.gd" }, { +"base": "Position2D", +"class": "ESCLocation", +"language": "GDScript", +"path": "res://addons/escoria-core/game/core-scripts/esc_location.gd" +}, { "base": "Object", "class": "ESCLogger", "language": "GDScript", @@ -494,6 +499,7 @@ _global_script_class_icons={ "ESCInventoryItem": "", "ESCInventoryManager": "", "ESCItem": "", +"ESCLocation": "", "ESCLogger": "", "ESCMovable": "", "ESCObject": "",