Fixed bug where walk action initiated by ESC would never call finished().

Also removed call to inexisting function in ESCInventoryContainer.
This commit is contained in:
Julian Murgia
2021-01-28 13:32:14 +01:00
parent 14e85edba7
commit e6f4af74a8
51 changed files with 1515 additions and 35 deletions

View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 28.6442, 29.8513 )
[node name="button_right" type="Area2D"]
script = ExtResource( 1 )
tooltip_name = "Button"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 971.212, 150.721 )
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 971.212, 150.721 )
shape = SubResource( 1 )

View File

@@ -84,16 +84,7 @@ position = Vector2( 52.1462, 384.691 )
global_id = "r2_button_right"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 971.212, 150.721 )
}
[node name="button_left" parent="Hotspots/button_right" instance=ExtResource( 5 )]
visible = false
position = Vector2( -625.523, 0 )
global_id = "r2_button"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 971.212, 150.721 )
"default": Vector2( 337.299, 370.025 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button_right"]
@@ -102,8 +93,16 @@ __meta__ = {
"_editor_description_": ""
}
[node name="Position2D2" type="Position2D" parent="Hotspots/button_right"]
position = Vector2( 337.299, 370.025 )
[node name="button_left" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( -625.523, 0 )
global_id = "r2_button"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 345.689, 150.721 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button_left"]
position = Vector2( 962.822, 370.025 )
__meta__ = {
"_editor_description_": ""
}

View File

@@ -18,4 +18,4 @@
#set_active r5_pen false
#set_global i/r5_empty_sheet true
#set_active r5_empty_sheet false
inventory_add r5_filled_sheet
#inventory_add r5_filled_sheet

View File

@@ -1,2 +1,2 @@
:exit_scene
#change_scene "res://game/rooms/room9/room9.tscn"
change_scene "res://game/rooms/room9/room9.tscn"

View File

@@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escbackground.gd" type="Script" id=1]
[node name="background" type="TextureRect"]
margin_right = 1289.0
margin_bottom = 555.0
mouse_filter = 2
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="l_platform" type="Line2D" parent="."]
position = Vector2( 2, -266 )
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
[node name="l_door" type="Line2D" parent="."]
position = Vector2( 0, -266 )
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
__meta__ = {
"_editor_description_": ""
}
[node name="r_door" type="Line2D" parent="."]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1271.64, 671.735, 1188.64, 624.843 )

View File

@@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[node name="magical_closet" type="Area2D"]
script = ExtResource( 1 )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": null
}
[node name="Line2D" type="Line2D" parent="."]

View File

@@ -0,0 +1,5 @@
# Magical closet: the object is always in the LAST opened closet
:open

View File

@@ -0,0 +1,2 @@
:exit_scene
change_scene "res://game/rooms/room7/room7.tscn"

9
game/rooms/room9/esc/room9.esc Executable file
View File

@@ -0,0 +1,9 @@
# :SETUP is called EVERY TIME the room is loaded
# :READY is called only the FIRST TIME the room is loaded
:setup
:ready

View File

@@ -0,0 +1,85 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[sub_resource type="Animation" id=1]
resource_name = "state_round"
tracks/0/type = "value"
tracks/0/path = NodePath("square:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("round:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=2]
resource_name = "state_square"
tracks/0/type = "value"
tracks/0/path = NodePath("square:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("round:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[node name="item_wall" type="Area2D"]
script = ExtResource( 1 )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 0, 0 )
}
[node name="square" type="Line2D" parent="."]
points = PoolVector2Array( 531, 527.828, 532, 483.828, 532.586, 445.745, 533.262, 401.771, 534, 353.828, 575.992, 355.093, 617.954, 356.357, 660.945, 357.652, 700, 358.828, 700.786, 402.832, 701.536, 444.836, 702.286, 486.841, 703, 526.828, 659.007, 526.574, 619.997, 526.348, 574.998, 526.088, 530, 525.828 )
__meta__ = {
"_editor_description_": ""
}
[node name="round" type="Line2D" parent="."]
visible = false
points = PoolVector2Array( 559.845, 508.706, 537.622, 482.513, 532.586, 445.745, 537.622, 414.255, 551.908, 384.095, 578.101, 366.633, 617.954, 356.357, 659.058, 363.458, 677.313, 375.364, 692.393, 399.175, 701.918, 441.241, 694.774, 484.101, 677.313, 504.737, 652.708, 518.23, 622.548, 526.167, 586.038, 518.23, 558.258, 506.324 )
__meta__ = {
"_editor_description_": ""
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2( 0, 265.2 )
polygon = PoolVector2Array( 528, 85, 529, 264, 708, 263, 706, 85 )
[node name="animation" type="AnimationPlayer" parent="."]
anims/state_round = SubResource( 1 )
anims/state_square = SubResource( 2 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/empty_sheet.png-76792812151af35ec4a677d2674810fc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/empty_sheet.png"
dest_files=[ "res://.import/empty_sheet.png-76792812151af35ec4a677d2674810fc.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/filled_sheet.png-b2986fedd542821915ec877a570a0934.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/filled_sheet.png"
dest_files=[ "res://.import/filled_sheet.png-b2986fedd542821915ec877a570a0934.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/pen.png-185eba49da7d77d331c5119550be859c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/pen.png"
dest_files=[ "res://.import/pen.png-185eba49da7d77d331c5119550be859c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/wrench.png-cd78241d27aa0dc800a83edce9459724.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/wrench.png"
dest_files=[ "res://.import/wrench.png-cd78241d27aa0dc800a83edce9459724.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@@ -0,0 +1,83 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room9/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/escroom.gd" type="Script" id=6]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=7]
[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 )
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 5, 0, 3, 6, 7 ), PoolIntArray( 7, 6, 8, 9, 10 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 1143.08, 613.35, 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, -9.16094, 803.802 ) ]
[node name="room9" type="Node2D"]
script = ExtResource( 6 )
__meta__ = {
"_edit_vertical_guides_": [ ]
}
global_id = "room9"
esc_script = "res://game/rooms/room9/esc/room9.esc"
player_scene = ExtResource( 4 )
camera_limits = [ Rect2( 0, 0, 1289, 555 ) ]
[node name="background" parent="." instance=ExtResource( 2 )]
[node name="room_label" type="Label" parent="background"]
margin_right = 62.0
margin_bottom = 16.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 9"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
[node name="platform" type="NavigationPolygonInstance" parent="walkable_area"]
position = Vector2( 6.73163, -264.779 )
navpoly = SubResource( 1 )
__meta__ = {
"_editor_description_": ""
}
[node name="Hotspots" type="Node2D" parent="."]
[node name="l_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 7 )
global_id = "r9_l_exit"
esc_script = "res://game/rooms/room9/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 37.4521, 392.045 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/l_door"]
polygon = PoolVector2Array( 0.328762, 440.897, 1.85199, 119.926, 85.9517, 74.6212, 87.1409, 377.869 )
[node name="Position2D" type="Position2D" parent="Hotspots/l_door"]
position = Vector2( 37.4521, 392.045 )
[node name="r_door" type="Area2D" parent="Hotspots"]
position = Vector2( -1, 0 )
script = ExtResource( 7 )
global_id = "r9_r_exit"
is_exit = true
tooltip_name = "Right exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1224.47, 353.99 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1225.47, 353.99 )
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )

View File

@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[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 )
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 5, 0, 3, 6, 7 ), PoolIntArray( 7, 6, 8, 9, 10 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 1143.08, 613.35, 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, -9.16094, 803.802 ) ]
[node name="walkable_area" type="Navigation2D"]
script = ExtResource( 1 )
[node name="platform" type="NavigationPolygonInstance" parent="."]
position = Vector2( 6.73163, -264.779 )
navpoly = SubResource( 1 )
__meta__ = {
"_editor_description_": ""
}

View File

@@ -1,7 +1,7 @@
:start
# 1/ Simple scene
#change_scene res://game/rooms/room1/room1.tscn
change_scene res://game/rooms/room1/room1.tscn
# 2/ Button bridge
#change_scene res://game/rooms/room2/room2.tscn
@@ -16,7 +16,7 @@
#change_scene res://game/rooms/room5/room5.tscn
# 6/ character room
change_scene res://game/rooms/room6/room6.tscn
#change_scene res://game/rooms/room6/room6.tscn
# 7/ long room with camera shift to object 2 if look on object 1
# and stairs with camera shift too
@@ -24,3 +24,6 @@ change_scene res://game/rooms/room6/room6.tscn
# 8/ puzzle in superposed scene
#change_scene res://game/rooms/room8/room8.tscn
# 9/ Indy4 3 closets
#change_scene res://game/rooms/room9/room9.tscn

View File

@@ -37,6 +37,3 @@ func remove_item(inventory_item : ESCInventoryItem):
remove_child(node_to_remove)
node_to_remove.queue_free()
func _on_gui_input(event : InputEvent, inventory_item : ESCInventoryItem):
if event is InputEventMouseButton and event.is_pressed():
inventory_item._on_inventory_item_pressed()

View File

@@ -35,6 +35,3 @@ func remove_item(inventory_item : ESCInventoryItem):
remove_child(node_to_remove)
node_to_remove.queue_free()
#func _on_gui_input(event : InputEvent, inventory_item : ESCInventoryItem):
# if event is InputEventMouseButton and event.is_pressed():
# inventory_item._on_inventory_item_pressed()