Deleted ESCHotspot (use ESCItem instead)

Moved duplicated movement code from ESCPlayer and ESCItem/ESCHotspot to its own script.
Added talking animations management.
Fixed bug: character was turning to last_direction after talking, if coming from another direction than speaking direction.
Continued removing unfree stuff.
This commit is contained in:
Julian Murgia
2021-01-12 23:05:23 +01:00
parent 933122f085
commit ff56816205
73 changed files with 1211 additions and 1652 deletions

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=13 format=2]
[gd_scene load_steps=12 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room5/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=3]
[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://game/rooms/room5/item_wall/item_wall.tscn" type="PackedScene" id=5]
[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]
[ext_resource path="res://game/items/escitems/wrench_escitem.tscn" type="PackedScene" id=8]
@@ -15,36 +16,6 @@ vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.87
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 ) ]
[sub_resource type="Animation" id=2]
resource_name = "state_round"
tracks/0/type = "value"
tracks/0/path = NodePath("Line2D:points")
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": [ PoolVector2Array( 556, 496.828, 543, 476.828, 532, 438.828, 543, 411.828, 560, 384.828, 590, 363.828, 617, 357.828, 655, 367.828, 684, 386.828, 695, 411.828, 701.536, 444.836, 698, 481.828, 683, 499.828, 658, 515.828, 619.997, 526.348, 584, 515.828, 558, 497.828 ) ]
}
[sub_resource type="Animation" id=3]
resource_name = "state_square"
tracks/0/type = "value"
tracks/0/path = NodePath("Line2D:points")
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": [ 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 ) ]
}
[node name="room5" type="Node2D"]
script = ExtResource( 6 )
__meta__ = {
@@ -53,6 +24,7 @@ __meta__ = {
global_id = "room5"
esc_script = "res://game/rooms/room5/esc/room5.esc"
player_scene = ExtResource( 4 )
camera_limits = [ Rect2( 0, 0, 1289, 555 ) ]
[node name="background" parent="." instance=ExtResource( 2 )]
@@ -64,6 +36,7 @@ margin_left = 142.828
margin_top = 492.556
margin_right = 366.828
margin_bottom = 506.556
custom_fonts/font = ExtResource( 3 )
text = "Pickup & use on background object"
__meta__ = {
"_edit_use_anchors_": false
@@ -78,12 +51,30 @@ margin_left = 142.828
margin_top = 492.556
margin_right = 366.828
margin_bottom = 506.556
custom_fonts/font = ExtResource( 3 )
text = "Pickup & combine together in enventory
Note: you can combine in both directions"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="background"]
margin_left = 297.669
margin_top = 137.488
margin_right = 514.669
margin_bottom = 151.488
custom_fonts/font = ExtResource( 3 )
text = "Look at this object multiple times"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="room_label" type="Label" parent="background"]
margin_right = 62.0
margin_bottom = 16.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 5"
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
@@ -97,16 +88,11 @@ __meta__ = {
[node name="Hotspots" type="Node2D" parent="."]
[node name="l_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
script = ExtResource( 7 )
global_id = "r5_l_exit"
is_exit = true
esc_script = "res://game/rooms/room5/esc/left_exit.esc"
is_interactive = true
player_orients_on_arrival = true
interaction_direction = 0
tooltip_name = "Exit"
default_action = ""
combine_if_action_used_among = PoolStringArray( )
is_exit = true
tooltip_name = "Left exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 37.4521, 392.045 )
@@ -120,16 +106,11 @@ position = Vector2( 37.4521, 392.045 )
[node name="r_door" type="Area2D" parent="Hotspots"]
position = Vector2( -1, 0 )
script = ExtResource( 3 )
script = ExtResource( 7 )
global_id = "r5_r_exit"
is_exit = true
esc_script = "res://game/rooms/room5/esc/right_exit.esc"
is_interactive = true
player_orients_on_arrival = true
interaction_direction = 0
tooltip_name = "Exit"
default_action = ""
combine_if_action_used_among = PoolStringArray( )
is_exit = true
tooltip_name = "Right exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1224.47, 353.99 )
@@ -141,42 +122,43 @@ 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 )
[node name="item_wall" type="Sprite" parent="Hotspots"]
script = ExtResource( 7 )
[node name="item_wall" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( 2.37842, -254.49 )
global_id = "r5_wall_item"
esc_script = "res://game/rooms/room5/esc/wall_item.esc"
tooltip_name = "Item on the wall"
default_action = "look"
combine_if_action_used_among = PoolStringArray( "use" )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 657, 377 )
}
[node name="Line2D" type="Line2D" parent="Hotspots/item_wall"]
position = Vector2( 0, -267.828 )
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 )
[node name="Position2D2" type="Position2D" parent="Hotspots/item_wall"]
position = Vector2( 620.135, 613.652 )
__meta__ = {
"_editor_description_": ""
}
[node name="Area2D" type="Area2D" parent="Hotspots/item_wall"]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/item_wall/Area2D"]
polygon = PoolVector2Array( 528, 85, 529, 264, 708, 263, 706, 85 )
[node name="Position2D" type="Position2D" parent="Hotspots/item_wall"]
position = Vector2( 657, 377 )
[node name="animation" type="AnimationPlayer" parent="Hotspots/item_wall"]
anims/state_round = SubResource( 2 )
anims/state_square = SubResource( 3 )
[node name="wrench" parent="Hotspots" instance=ExtResource( 8 )]
position = Vector2( 257.269, 435.892 )
interaction_direction = 2
interact_positions = {
"default": Vector2( 179.848, 435.892 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/wrench"]
position = Vector2( -77.4207, 0 )
[node name="pen" parent="Hotspots" instance=ExtResource( 10 )]
position = Vector2( 909.908, 443.451 )
interact_positions = {
"default": Vector2( 909.908, 443.451 )
}
[node name="empty_sheet" parent="Hotspots" instance=ExtResource( 9 )]
position = Vector2( 1059.84, 440.932 )
interact_positions = {
"default": Vector2( 1059.84, 440.932 )
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )