From dd87611f77d02de622c045d4a6fe6c307448a8aa Mon Sep 17 00:00:00 2001 From: Non0w Date: Fri, 16 Oct 2020 23:55:36 +0200 Subject: [PATCH] Refacto interactions and add a light switch --- jrpg/characters/basic_enemy.tres | 2 +- jrpg/characters/player.tres | 2 +- jrpg/scenes/TestLVL.tscn | 69 ++++++------ jrpg/scenes/entities/Enemy.tscn | 15 ++- jrpg/scenes/entities/Pickup.tscn | 1 - jrpg/scenes/entities/Player.tscn | 29 +++-- jrpg/scenes/entities/Switch.tscn | 101 ++++++++++++++++++ .../{entities => }/camera/camera_orbit.gd | 0 .../{entities => }/data/character_data.gd | 0 jrpg/scripts/entities/area_script_trigger.gd | 13 +++ .../interactions/basis_interaction.gd | 16 --- .../interactions/talk_interaction.gd | 8 -- jrpg/scripts/entities/enemy.gd | 88 --------------- jrpg/scripts/entities/npc.gd | 8 +- jrpg/scripts/entities/pickup.gd | 5 +- jrpg/scripts/entities/player.gd | 32 ++---- jrpg/scripts/entities/switch.gd | 23 ++++ jrpg/scripts/entities/utils/trigger_relay.gd | 6 ++ jrpg/scripts/levels/script_trigger.gd | 9 -- jrpg/scripts/levels/spawner.gd | 7 +- jrpg/scripts/misc/test_level.gd | 4 + .../{entities => }/model/player_infos.gd | 0 project.godot | 22 ++-- 23 files changed, 248 insertions(+), 212 deletions(-) create mode 100644 jrpg/scenes/entities/Switch.tscn rename jrpg/scripts/{entities => }/camera/camera_orbit.gd (100%) rename jrpg/scripts/{entities => }/data/character_data.gd (100%) create mode 100644 jrpg/scripts/entities/area_script_trigger.gd delete mode 100644 jrpg/scripts/entities/components/interactions/basis_interaction.gd delete mode 100644 jrpg/scripts/entities/components/interactions/talk_interaction.gd delete mode 100644 jrpg/scripts/entities/enemy.gd create mode 100644 jrpg/scripts/entities/switch.gd create mode 100644 jrpg/scripts/entities/utils/trigger_relay.gd delete mode 100644 jrpg/scripts/levels/script_trigger.gd rename jrpg/scripts/{entities => }/model/player_infos.gd (100%) diff --git a/jrpg/characters/basic_enemy.tres b/jrpg/characters/basic_enemy.tres index f99b3cd..7eb3461 100644 --- a/jrpg/characters/basic_enemy.tres +++ b/jrpg/characters/basic_enemy.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" load_steps=4 format=2] -[ext_resource path="res://jrpg/scripts/entities/data/character_data.gd" type="Script" id=1] +[ext_resource path="res://jrpg/scripts/data/character_data.gd" type="Script" id=1] [ext_resource path="res://jrpg/scenes/entities/Enemy.tscn" type="PackedScene" id=2] [ext_resource path="res://jrpg/yarn_scripts/npc_debug.yarn" type="Resource" id=3] diff --git a/jrpg/characters/player.tres b/jrpg/characters/player.tres index 701f73d..3083f6a 100644 --- a/jrpg/characters/player.tres +++ b/jrpg/characters/player.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" load_steps=3 format=2] -[ext_resource path="res://jrpg/scripts/entities/data/character_data.gd" type="Script" id=1] +[ext_resource path="res://jrpg/scripts/data/character_data.gd" type="Script" id=1] [ext_resource path="res://jrpg/scenes/entities/Player.tscn" type="PackedScene" id=2] [resource] diff --git a/jrpg/scenes/TestLVL.tscn b/jrpg/scenes/TestLVL.tscn index e21d0cb..e3870f9 100644 --- a/jrpg/scenes/TestLVL.tscn +++ b/jrpg/scenes/TestLVL.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=31 format=2] +[gd_scene load_steps=32 format=2] [ext_resource path="res://jrpg/scripts/levels/spawner.gd" type="Script" id=1] [ext_resource path="res://jrpg/yarn_scripts/test_start.yarn" type="Resource" id=2] @@ -10,19 +10,20 @@ [ext_resource path="res://jrpg/models/nature/dirt.material" type="Material" id=8] [ext_resource path="res://jrpg/models/nature/grass.material" type="Material" id=9] [ext_resource path="res://jrpg/models/nature/_defaultMat.material" type="Material" id=10] -[ext_resource path="res://jrpg/scripts/levels/script_trigger.gd" type="Script" id=11] +[ext_resource path="res://jrpg/scripts/entities/area_script_trigger.gd" type="Script" id=11] [ext_resource path="res://jrpg/characters/basic_enemy.tres" type="Resource" id=12] [ext_resource path="res://jrpg/yarn_scripts/all_coins_picked_up_script.yarn" type="Resource" id=13] [ext_resource path="res://jrpg/models/nature/river/WaterPlane.tscn" type="PackedScene" id=14] [ext_resource path="res://jrpg/scripts/misc/test_level.gd" type="Script" id=15] [ext_resource path="res://jrpg/models/nature/river/water.tres" type="Material" id=16] +[ext_resource path="res://jrpg/scenes/entities/Switch.tscn" type="PackedScene" id=17] -[sub_resource type="PlaneMesh" id=16] +[sub_resource type="PlaneMesh" id=1] size = Vector2( 600, 600 ) subdivide_width = 200 subdivide_depth = 200 -[sub_resource type="ArrayMesh" id=3] +[sub_resource type="ArrayMesh" id=2] resource_name = "rock_smallFlatC" surfaces/0 = { "aabb": AABB( -0.235189, -2.59437e-16, -0.180173, 0.470379, 0.064944, 0.360347 ), @@ -49,10 +50,10 @@ surfaces/1 = { "vertex_count": 27 } -[sub_resource type="ConcavePolygonShape" id=4] +[sub_resource type="ConcavePolygonShape" id=3] data = PoolVector3Array( 0.1906, 0, -0.1328, 0.2352, 0, 0.0007, 0.207, 0.0649, 0.0006, 0.207, 0.0649, 0.0006, 0.1677, 0.0649, -0.1169, 0.1906, 0, -0.1328, 0.0678, 0.0325, 0.1694, 0.0722, 0, 0.1802, -0.1659, 0, 0.1209, -0.1659, 0, 0.1209, -0.146, 0.0649, 0.1064, 0.0678, 0.0325, 0.1694, -0.146, 0.0649, 0.1064, 0.0024, 0.0649, 0.1434, 0.0678, 0.0325, 0.1694, 0.1483, 0.0649, -0.1217, 0.0967, 0.0649, -0.1217, 0.1165, 0.0419, -0.1373, -0.0993, 0, -0.1802, -0.2352, 0, -0.0346, -0.1659, 0, 0.1209, -0.1659, 0, 0.1209, 0.0722, 0, 0.1802, -0.0993, 0, -0.1802, 0.0722, 0, 0.1802, 0.0777, 0, -0.1177, -0.0993, 0, -0.1802, 0.0722, 0, 0.1802, 0.2352, 0, 0.0007, 0.0777, 0, -0.1177, 0.2352, 0, 0.0007, 0.1263, 0, -0.1488, 0.0777, 0, -0.1177, 0.2352, 0, 0.0007, 0.1906, 0, -0.1328, 0.1263, 0, -0.1488, 0.0683, 0.0649, -0.1036, 0.0777, 0, -0.1177, 0.1263, 0, -0.1488, 0.1263, 0, -0.1488, 0.1165, 0.0419, -0.1373, 0.0683, 0.0649, -0.1036, 0.1165, 0.0419, -0.1373, 0.0967, 0.0649, -0.1217, 0.0683, 0.0649, -0.1036, -0.1472, 0.0649, -0.0945, -0.217, 0.0419, -0.0319, -0.2352, 0, -0.0346, -0.2352, 0, -0.0346, -0.0993, 0, -0.1802, -0.1472, 0.0649, -0.0945, -0.0993, 0, -0.1802, -0.0873, 0.0649, -0.1586, -0.1472, 0.0649, -0.0945, -0.1472, 0.0649, -0.0945, -0.1984, 0.0649, -0.0111, -0.217, 0.0419, -0.0319, 0.1058, 0.0649, 0.112, 0.0678, 0.0325, 0.1694, 0.0024, 0.0649, 0.1434, 0.2352, 0, 0.0007, 0.0722, 0, 0.1802, 0.0678, 0.0325, 0.1694, 0.0678, 0.0325, 0.1694, 0.1058, 0.0649, 0.112, 0.2352, 0, 0.0007, 0.1058, 0.0649, 0.112, 0.207, 0.0649, 0.0006, 0.2352, 0, 0.0007, -0.0993, 0, -0.1802, 0.0777, 0, -0.1177, 0.0683, 0.0649, -0.1036, 0.0683, 0.0649, -0.1036, -0.0873, 0.0649, -0.1586, -0.0993, 0, -0.1802, -0.146, 0.0649, 0.1064, -0.1659, 0, 0.1209, -0.2352, 0, -0.0346, -0.2352, 0, -0.0346, -0.1984, 0.0649, -0.0111, -0.146, 0.0649, 0.1064, -0.2352, 0, -0.0346, -0.217, 0.0419, -0.0319, -0.1984, 0.0649, -0.0111, 0.1165, 0.0419, -0.1373, 0.1263, 0, -0.1488, 0.1906, 0, -0.1328, 0.1906, 0, -0.1328, 0.1677, 0.0649, -0.1169, 0.1165, 0.0419, -0.1373, 0.1677, 0.0649, -0.1169, 0.1483, 0.0649, -0.1217, 0.1165, 0.0419, -0.1373, -0.146, 0.0649, 0.1064, -0.1984, 0.0649, -0.0111, -0.1472, 0.0649, -0.0945, -0.1472, 0.0649, -0.0945, -0.0873, 0.0649, -0.1586, -0.146, 0.0649, 0.1064, -0.0873, 0.0649, -0.1586, 0.0024, 0.0649, 0.1434, -0.146, 0.0649, 0.1064, -0.0873, 0.0649, -0.1586, 0.0683, 0.0649, -0.1036, 0.0024, 0.0649, 0.1434, 0.0683, 0.0649, -0.1036, 0.1058, 0.0649, 0.112, 0.0024, 0.0649, 0.1434, 0.0683, 0.0649, -0.1036, 0.0967, 0.0649, -0.1217, 0.1058, 0.0649, 0.112, 0.0967, 0.0649, -0.1217, 0.1483, 0.0649, -0.1217, 0.1058, 0.0649, 0.112, 0.1483, 0.0649, -0.1217, 0.207, 0.0649, 0.0006, 0.1058, 0.0649, 0.112, 0.1483, 0.0649, -0.1217, 0.1677, 0.0649, -0.1169, 0.207, 0.0649, 0.0006 ) -[sub_resource type="ArrayMesh" id=5] +[sub_resource type="ArrayMesh" id=4] resource_name = "rock_tallB" surfaces/0 = { "aabb": AABB( -0.382394, -5.41434e-16, -0.385019, 0.764788, 0.88378, 0.770037 ), @@ -91,10 +92,10 @@ surfaces/2 = { "vertex_count": 60 } -[sub_resource type="ConcavePolygonShape" id=6] +[sub_resource type="ConcavePolygonShape" id=5] data = PoolVector3Array( 0.2055, 0.4526, -0.0499, 0.1917, 0.3212, -0.0776, 0.2192, 0.3212, -0.0776, 0.2348, 0.4526, -0.0499, 0.2055, 0.4526, -0.0499, 0.2192, 0.3212, -0.0776, 0.2192, 0.3212, -0.0776, 0.2685, 0.1968, -0.1039, 0.2348, 0.4526, -0.0499, -0.1349, 0.1732, 0.337, -0.1172, 0, 0.3768, -0.294, 0, 0.3768, -0.294, 0, 0.3768, -0.2763, 0.1732, 0.337, -0.1349, 0.1732, 0.337, -0.1616, 0.6099, -0.1529, -0.2671, 0.6099, 0.0299, -0.3266, 0, 0.0299, -0.3266, 0, 0.0299, -0.3093, 0, -0.0001, -0.1616, 0.6099, -0.1529, -0.3093, 0, -0.0001, -0.2284, 0.2484, -0.0982, -0.1616, 0.6099, -0.1529, -0.2284, 0.2484, -0.0982, -0.1792, 0.2484, -0.1834, -0.1616, 0.6099, -0.1529, 0.049, 0.6099, 0.0586, -0.0119, 0.6099, 0.164, -0.0283, 0.8838, 0.1355, -0.0283, 0.8838, 0.1355, 0.0161, 0.8838, 0.0586, 0.049, 0.6099, 0.0586, -0.1171, 0.8838, -0.0183, -0.1335, 0.6099, -0.0468, -0.0119, 0.6099, -0.0468, -0.0119, 0.6099, -0.0468, -0.0283, 0.8838, -0.0183, -0.1171, 0.8838, -0.0183, -0.1647, 0.368, 0.2698, -0.1552, 0.1732, 0.2914, -0.2561, 0.1732, 0.2914, -0.2561, 0.1732, 0.2914, -0.2465, 0.368, 0.2698, -0.1647, 0.368, 0.2698, -0.2516, 0.368, 0.0975, -0.2873, 0.368, 0.1779, -0.3065, 0.1732, 0.1779, -0.3065, 0.1732, 0.1779, -0.2708, 0.1732, 0.0974, -0.2516, 0.368, 0.0975, 0.2065, 0.1768, 0.1904, 0.2904, 0, 0.2461, 0.112, 0, 0.385, 0.112, 0, 0.385, 0.0908, 0.1768, 0.2805, 0.2065, 0.1768, 0.1904, 0.1595, 0.4526, 0.011, 0.1704, 0.4526, 0.0299, 0.155, 0.6099, 0.0299, 0.155, 0.6099, 0.0299, 0.0495, 0.6099, -0.1529, 0.1595, 0.4526, 0.011, 0.0495, 0.6099, -0.1529, 0.1517, 0.3212, -0.0247, 0.1595, 0.4526, 0.011, 0.0495, 0.6099, -0.1529, 0.0636, 0.3212, -0.1773, 0.1517, 0.3212, -0.0247, 0.2869, 0.4526, 0.0787, 0.3824, 0, 0.1506, 0.3105, 0, 0.1714, 0.3105, 0, 0.1714, 0.2146, 0.1768, 0.1602, 0.2869, 0.4526, 0.0787, 0.2146, 0.1768, 0.1602, 0.1527, 0.1768, 0.1781, 0.2869, 0.4526, 0.0787, 0.1527, 0.1768, 0.1781, 0.1445, 0.4526, 0.1199, 0.2869, 0.4526, 0.0787, 0.0207, 0.3212, -0.2766, -0.0233, 0, -0.3529, 0.2215, 0, -0.3529, 0.2215, 0, -0.3529, 0.1774, 0.3212, -0.2766, 0.0207, 0.3212, -0.2766, 0.0495, 0.6099, 0.2127, 0.0706, 0.1768, 0.2493, 0.058, 0.1768, 0.2493, 0.058, 0.1768, 0.2493, -0.1484, 0.368, 0.2331, 0.0495, 0.6099, 0.2127, -0.1484, 0.368, 0.2331, -0.1734, 0.368, 0.2331, 0.0495, 0.6099, 0.2127, -0.1734, 0.368, 0.2331, -0.1616, 0.6099, 0.2127, 0.0495, 0.6099, 0.2127, -0.1366, 0.1732, 0.2496, -0.1484, 0.368, 0.2331, 0.058, 0.1768, 0.2493, -0.096, 0.1732, 0.2496, -0.1366, 0.1732, 0.2496, 0.058, 0.1768, 0.2493, -0.096, 0.1732, 0.2496, 0.058, 0.1768, 0.2493, -0.0364, 0, 0.2642, -0.0364, 0, 0.2642, -0.0672, 0, 0.2642, -0.096, 0.1732, 0.2496, 0.2215, 0, -0.3529, 0.3439, 0, -0.1409, 0.2558, 0.3212, -0.1409, 0.2558, 0.3212, -0.1409, 0.1774, 0.3212, -0.2766, 0.2215, 0, -0.3529, -0.1171, 0.8838, 0.1355, -0.1335, 0.6099, 0.164, -0.1944, 0.6099, 0.0586, -0.1944, 0.6099, 0.0586, -0.1615, 0.8838, 0.0586, -0.1171, 0.8838, 0.1355, 0.3824, 0, 0.035, 0.3824, 0, 0.1506, 0.2869, 0.4526, 0.0787, 0.2869, 0.4526, 0.0787, 0.2869, 0.4526, 0.057, 0.3824, 0, 0.035, -0.2284, 0.2484, -0.0982, -0.3093, 0, -0.0001, -0.3601, 0, -0.0836, -0.3601, 0, -0.0836, -0.2336, 0.2484, -0.1068, -0.2284, 0.2484, -0.0982, -0.1171, 0.8838, -0.0183, -0.1615, 0.8838, 0.0586, -0.1944, 0.6099, 0.0586, -0.1944, 0.6099, 0.0586, -0.1335, 0.6099, -0.0468, -0.1171, 0.8838, -0.0183, -0.2336, 0.2484, -0.1068, -0.3601, 0, -0.0836, -0.309, 0, -0.3614, -0.309, 0, -0.3614, -0.2072, 0.2484, -0.2508, -0.2336, 0.2484, -0.1068, 0.1445, 0.4526, 0.1199, 0.1527, 0.1768, 0.1781, 0.1118, 0.1768, 0.1781, 0.1118, 0.1768, 0.1781, 0.1185, 0.4526, 0.1199, 0.1445, 0.4526, 0.1199, -0.1616, 0.6099, 0.2127, -0.1734, 0.368, 0.2331, -0.2516, 0.368, 0.0975, -0.2516, 0.368, 0.0975, -0.2671, 0.6099, 0.0299, -0.1616, 0.6099, 0.2127, -0.2516, 0.368, 0.0975, -0.2708, 0.1732, 0.0974, -0.2671, 0.6099, 0.0299, -0.2708, 0.1732, 0.0974, -0.2937, 0.1732, 0.0577, -0.2671, 0.6099, 0.0299, -0.2937, 0.1732, 0.0577, -0.321, 0, 0.0397, -0.2671, 0.6099, 0.0299, -0.321, 0, 0.0397, -0.3266, 0, 0.0299, -0.2671, 0.6099, 0.0299, 0.1118, 0.1768, 0.1781, 0.0706, 0.1768, 0.2493, 0.0495, 0.6099, 0.2127, 0.0495, 0.6099, 0.2127, 0.1185, 0.4526, 0.1199, 0.1118, 0.1768, 0.1781, 0.0495, 0.6099, 0.2127, 0.155, 0.6099, 0.0299, 0.1185, 0.4526, 0.1199, 0.155, 0.6099, 0.0299, 0.1704, 0.4526, 0.0299, 0.1185, 0.4526, 0.1199, -0.2465, 0.368, 0.2698, -0.2561, 0.1732, 0.2914, -0.3065, 0.1732, 0.1779, -0.3065, 0.1732, 0.1779, -0.2873, 0.368, 0.1779, -0.2465, 0.368, 0.2698, -0.0758, 0.1473, -0.192, -0.1248, 0.2484, -0.1834, -0.1517, 0.2484, -0.2563, -0.1517, 0.2484, -0.2563, -0.0453, 0, -0.3149, -0.0758, 0.1473, -0.192, -0.1517, 0.2484, -0.2563, -0.0711, 0, -0.385, -0.0453, 0, -0.3149, -0.0283, 0.8838, 0.1355, -0.0119, 0.6099, 0.164, -0.1335, 0.6099, 0.164, -0.1335, 0.6099, 0.164, -0.1171, 0.8838, 0.1355, -0.0283, 0.8838, 0.1355, 0.3824, 0, 0.035, 0.2869, 0.4526, 0.057, 0.2348, 0.4526, -0.0499, 0.2348, 0.4526, -0.0499, 0.3183, 0, -0.0966, 0.3824, 0, 0.035, 0.2348, 0.4526, -0.0499, 0.2685, 0.1968, -0.1039, 0.3183, 0, -0.0966, -0.2072, 0.2484, -0.2508, -0.309, 0, -0.3614, -0.0711, 0, -0.385, -0.0711, 0, -0.385, -0.1517, 0.2484, -0.2563, -0.2072, 0.2484, -0.2508, 0.3105, 0, 0.1714, 0.2904, 0, 0.2461, 0.2065, 0.1768, 0.1904, 0.2065, 0.1768, 0.1904, 0.2146, 0.1768, 0.1602, 0.3105, 0, 0.1714, -0.1616, 0.6099, -0.1529, -0.1792, 0.2484, -0.1834, -0.1248, 0.2484, -0.1834, -0.1248, 0.2484, -0.1834, -0.0366, 0.3212, -0.1773, -0.1616, 0.6099, -0.1529, -0.0366, 0.3212, -0.1773, 0.0636, 0.3212, -0.1773, -0.1616, 0.6099, -0.1529, 0.0636, 0.3212, -0.1773, 0.0495, 0.6099, -0.1529, -0.1616, 0.6099, -0.1529, -0.0366, 0.3212, -0.1773, -0.1248, 0.2484, -0.1834, -0.0758, 0.1473, -0.192, -0.0119, 0.6099, -0.0468, 0.049, 0.6099, 0.0586, 0.0161, 0.8838, 0.0586, 0.0161, 0.8838, 0.0586, -0.0283, 0.8838, -0.0183, -0.0119, 0.6099, -0.0468, 0.0908, 0.1768, 0.2805, 0.112, 0, 0.385, -0.0198, 0, 0.3497, -0.0198, 0, 0.3497, 0.0626, 0.1768, 0.2729, 0.0908, 0.1768, 0.2805, 0.3439, 0, -0.1409, 0.3183, 0, -0.0966, 0.2685, 0.1968, -0.1039, 0.2558, 0.3212, -0.1409, 0.3439, 0, -0.1409, 0.2685, 0.1968, -0.1039, 0.2685, 0.1968, -0.1039, 0.2192, 0.3212, -0.0776, 0.2558, 0.3212, -0.1409, -0.2763, 0.1732, 0.337, -0.294, 0, 0.3768, -0.3824, 0, 0.1779, -0.3824, 0, 0.1779, -0.347, 0.1732, 0.1779, -0.2763, 0.1732, 0.337, -0.0672, 0, 0.2642, -0.1172, 0, 0.3768, -0.1349, 0.1732, 0.337, -0.1349, 0.1732, 0.337, -0.096, 0.1732, 0.2496, -0.0672, 0, 0.2642, -0.1366, 0.1732, 0.2496, -0.1552, 0.1732, 0.2914, -0.1647, 0.368, 0.2698, -0.1647, 0.368, 0.2698, -0.1484, 0.368, 0.2331, -0.1366, 0.1732, 0.2496, 0.2055, 0.4526, -0.0499, 0.1595, 0.4526, 0.011, 0.1517, 0.3212, -0.0247, 0.1517, 0.3212, -0.0247, 0.1917, 0.3212, -0.0776, 0.2055, 0.4526, -0.0499, 0.0626, 0.1768, 0.2729, -0.0198, 0, 0.3497, -0.0364, 0, 0.2642, -0.0364, 0, 0.2642, 0.058, 0.1768, 0.2493, 0.0626, 0.1768, 0.2729, -0.2937, 0.1732, 0.0577, -0.347, 0.1732, 0.1779, -0.3824, 0, 0.1779, -0.3824, 0, 0.1779, -0.321, 0, 0.0397, -0.2937, 0.1732, 0.0577, 0.0207, 0.3212, -0.2766, -0.0366, 0.3212, -0.1773, -0.0758, 0.1473, -0.192, -0.0758, 0.1473, -0.192, -0.0453, 0, -0.3149, 0.0207, 0.3212, -0.2766, -0.0453, 0, -0.3149, -0.0233, 0, -0.3529, 0.0207, 0.3212, -0.2766, 0.1445, 0.4526, 0.1199, 0.1185, 0.4526, 0.1199, 0.1704, 0.4526, 0.0299, 0.1704, 0.4526, 0.0299, 0.2869, 0.4526, 0.0787, 0.1445, 0.4526, 0.1199, 0.1704, 0.4526, 0.0299, 0.2055, 0.4526, -0.0499, 0.2869, 0.4526, 0.0787, 0.2055, 0.4526, -0.0499, 0.2348, 0.4526, -0.0499, 0.2869, 0.4526, 0.0787, 0.2348, 0.4526, -0.0499, 0.2869, 0.4526, 0.057, 0.2869, 0.4526, 0.0787, 0.2055, 0.4526, -0.0499, 0.1704, 0.4526, 0.0299, 0.1595, 0.4526, 0.011, -0.2763, 0.1732, 0.337, -0.347, 0.1732, 0.1779, -0.3065, 0.1732, 0.1779, -0.3065, 0.1732, 0.1779, -0.2561, 0.1732, 0.2914, -0.2763, 0.1732, 0.337, -0.2561, 0.1732, 0.2914, -0.1349, 0.1732, 0.337, -0.2763, 0.1732, 0.337, -0.2561, 0.1732, 0.2914, -0.1552, 0.1732, 0.2914, -0.1349, 0.1732, 0.337, -0.1552, 0.1732, 0.2914, -0.1366, 0.1732, 0.2496, -0.1349, 0.1732, 0.337, -0.1366, 0.1732, 0.2496, -0.096, 0.1732, 0.2496, -0.1349, 0.1732, 0.337, -0.3065, 0.1732, 0.1779, -0.347, 0.1732, 0.1779, -0.2937, 0.1732, 0.0577, -0.2937, 0.1732, 0.0577, -0.2708, 0.1732, 0.0974, -0.3065, 0.1732, 0.1779, -0.1616, 0.6099, 0.2127, -0.2671, 0.6099, 0.0299, -0.1944, 0.6099, 0.0586, -0.1944, 0.6099, 0.0586, -0.1335, 0.6099, 0.164, -0.1616, 0.6099, 0.2127, -0.1335, 0.6099, 0.164, 0.0495, 0.6099, 0.2127, -0.1616, 0.6099, 0.2127, -0.1335, 0.6099, 0.164, -0.0119, 0.6099, 0.164, 0.0495, 0.6099, 0.2127, -0.0119, 0.6099, 0.164, 0.049, 0.6099, 0.0586, 0.0495, 0.6099, 0.2127, -0.1944, 0.6099, 0.0586, -0.2671, 0.6099, 0.0299, -0.1616, 0.6099, -0.1529, -0.1616, 0.6099, -0.1529, -0.1335, 0.6099, -0.0468, -0.1944, 0.6099, 0.0586, -0.1616, 0.6099, -0.1529, 0.0495, 0.6099, -0.1529, -0.1335, 0.6099, -0.0468, 0.0495, 0.6099, -0.1529, 0.0495, 0.6099, 0.2127, 0.049, 0.6099, 0.0586, 0.0495, 0.6099, -0.1529, -0.0119, 0.6099, -0.0468, -0.1335, 0.6099, -0.0468, 0.0495, 0.6099, -0.1529, 0.049, 0.6099, 0.0586, -0.0119, 0.6099, -0.0468, 0.0495, 0.6099, -0.1529, 0.155, 0.6099, 0.0299, 0.0495, 0.6099, 0.2127, 0.0636, 0.3212, -0.1773, -0.0366, 0.3212, -0.1773, 0.0207, 0.3212, -0.2766, 0.0207, 0.3212, -0.2766, 0.1774, 0.3212, -0.2766, 0.0636, 0.3212, -0.1773, 0.1774, 0.3212, -0.2766, 0.1517, 0.3212, -0.0247, 0.0636, 0.3212, -0.1773, 0.1774, 0.3212, -0.2766, 0.1917, 0.3212, -0.0776, 0.1517, 0.3212, -0.0247, 0.1774, 0.3212, -0.2766, 0.2558, 0.3212, -0.1409, 0.1917, 0.3212, -0.0776, 0.2558, 0.3212, -0.1409, 0.2192, 0.3212, -0.0776, 0.1917, 0.3212, -0.0776, -0.1171, 0.8838, 0.1355, -0.1615, 0.8838, 0.0586, -0.1171, 0.8838, -0.0183, -0.1171, 0.8838, -0.0183, -0.0283, 0.8838, 0.1355, -0.1171, 0.8838, 0.1355, -0.1171, 0.8838, -0.0183, -0.0283, 0.8838, -0.0183, -0.0283, 0.8838, 0.1355, -0.0283, 0.8838, -0.0183, 0.0161, 0.8838, 0.0586, -0.0283, 0.8838, 0.1355, -0.2465, 0.368, 0.2698, -0.2873, 0.368, 0.1779, -0.2516, 0.368, 0.0975, -0.2516, 0.368, 0.0975, -0.1734, 0.368, 0.2331, -0.2465, 0.368, 0.2698, -0.1734, 0.368, 0.2331, -0.1647, 0.368, 0.2698, -0.2465, 0.368, 0.2698, -0.1734, 0.368, 0.2331, -0.1484, 0.368, 0.2331, -0.1647, 0.368, 0.2698, 0.0626, 0.1768, 0.2729, 0.058, 0.1768, 0.2493, 0.0706, 0.1768, 0.2493, 0.0706, 0.1768, 0.2493, 0.0908, 0.1768, 0.2805, 0.0626, 0.1768, 0.2729, 0.0706, 0.1768, 0.2493, 0.1118, 0.1768, 0.1781, 0.0908, 0.1768, 0.2805, 0.1118, 0.1768, 0.1781, 0.2065, 0.1768, 0.1904, 0.0908, 0.1768, 0.2805, 0.1118, 0.1768, 0.1781, 0.1527, 0.1768, 0.1781, 0.2065, 0.1768, 0.1904, 0.1527, 0.1768, 0.1781, 0.2146, 0.1768, 0.1602, 0.2065, 0.1768, 0.1904, -0.2284, 0.2484, -0.0982, -0.2336, 0.2484, -0.1068, -0.2072, 0.2484, -0.2508, -0.2072, 0.2484, -0.2508, -0.1792, 0.2484, -0.1834, -0.2284, 0.2484, -0.0982, -0.2072, 0.2484, -0.2508, -0.1517, 0.2484, -0.2563, -0.1792, 0.2484, -0.1834, -0.1517, 0.2484, -0.2563, -0.1248, 0.2484, -0.1834, -0.1792, 0.2484, -0.1834, -0.3093, 0, -0.0001, -0.3266, 0, 0.0299, -0.321, 0, 0.0397, -0.309, 0, -0.3614, -0.3601, 0, -0.0836, -0.3093, 0, -0.0001, -0.321, 0, 0.0397, -0.3824, 0, 0.1779, -0.294, 0, 0.3768, -0.294, 0, 0.3768, -0.3093, 0, -0.0001, -0.321, 0, 0.0397, -0.294, 0, 0.3768, -0.309, 0, -0.3614, -0.3093, 0, -0.0001, -0.294, 0, 0.3768, -0.0711, 0, -0.385, -0.309, 0, -0.3614, -0.294, 0, 0.3768, -0.1172, 0, 0.3768, -0.0711, 0, -0.385, -0.1172, 0, 0.3768, -0.0672, 0, 0.2642, -0.0711, 0, -0.385, -0.0672, 0, 0.2642, -0.0453, 0, -0.3149, -0.0711, 0, -0.385, -0.0672, 0, 0.2642, -0.0364, 0, 0.2642, -0.0453, 0, -0.3149, -0.0364, 0, 0.2642, -0.0233, 0, -0.3529, -0.0453, 0, -0.3149, -0.0364, 0, 0.2642, -0.0198, 0, 0.3497, -0.0233, 0, -0.3529, -0.0198, 0, 0.3497, 0.2215, 0, -0.3529, -0.0233, 0, -0.3529, -0.0198, 0, 0.3497, 0.112, 0, 0.385, 0.2215, 0, -0.3529, 0.112, 0, 0.385, 0.2904, 0, 0.2461, 0.2215, 0, -0.3529, 0.2904, 0, 0.2461, 0.3183, 0, -0.0966, 0.2215, 0, -0.3529, 0.3183, 0, -0.0966, 0.3439, 0, -0.1409, 0.2215, 0, -0.3529, 0.2904, 0, 0.2461, 0.3105, 0, 0.1714, 0.3183, 0, -0.0966, 0.3183, 0, -0.0966, 0.3105, 0, 0.1714, 0.3824, 0, 0.1506, 0.3824, 0, 0.1506, 0.3824, 0, 0.035, 0.3183, 0, -0.0966 ) -[sub_resource type="ArrayMesh" id=7] +[sub_resource type="ArrayMesh" id=6] resource_name = "rock_smallE" surfaces/0 = { "aabb": AABB( -0.1804, 0, -0.156231, 0.3608, 0.256168, 0.312462 ), @@ -121,10 +122,10 @@ surfaces/1 = { "vertex_count": 63 } -[sub_resource type="ConcavePolygonShape" id=8] +[sub_resource type="ConcavePolygonShape" id=7] data = PoolVector3Array( 0.07, 0.1768, -0.0191, 0.0294, 0.1768, 0.0511, 0.0185, 0.2562, 0.0321, 0.0185, 0.2562, 0.0321, 0.0481, 0.2562, -0.0191, 0.07, 0.1768, -0.0191, 0.0185, 0.2562, 0.0321, 0.0294, 0.1768, 0.0511, -0.0517, 0.1768, 0.0511, -0.0517, 0.1768, 0.0511, -0.0429, 0.2402, 0.036, 0.0185, 0.2562, 0.0321, -0.0429, 0.2402, 0.036, 0.0026, 0.2562, 0.0321, 0.0185, 0.2562, 0.0321, -0.0111, 0.2562, -0.0704, -0.0555, 0.2562, -0.0448, -0.0489, 0.1966, -0.0847, 0.0906, 0.1768, 0.0869, 0.074, 0.1445, 0.1281, -0.0132, 0.1768, 0.1219, 0.0294, 0.1768, -0.0894, 0.07, 0.1768, -0.0191, 0.0481, 0.2562, -0.0191, 0.0481, 0.2562, -0.0191, 0.0185, 0.2562, -0.0704, 0.0294, 0.1768, -0.0894, -0.0902, 0, -0.1562, -0.1804, 0, 0, -0.0902, 0, 0.1562, -0.0902, 0, 0.1562, 0.0902, 0, -0.1562, -0.0902, 0, -0.1562, -0.0902, 0, 0.1562, 0.0902, 0, 0.1562, 0.0902, 0, -0.1562, 0.0902, 0, 0.1562, 0.1804, 0, 0, 0.0902, 0, -0.1562, -0.0429, 0.2402, 0.036, -0.0517, 0.1768, 0.0511, -0.0922, 0.1768, -0.0191, -0.0922, 0.1768, -0.0191, -0.0624, 0.2562, -0.0054, -0.0429, 0.2402, 0.036, -0.0922, 0.1768, -0.0191, -0.0703, 0.2562, -0.0191, -0.0624, 0.2562, -0.0054, -0.0489, 0.1966, -0.0847, -0.0517, 0.1768, -0.0894, 0.0294, 0.1768, -0.0894, 0.0294, 0.1768, -0.0894, 0.0185, 0.2562, -0.0704, -0.0489, 0.1966, -0.0847, 0.0185, 0.2562, -0.0704, -0.0111, 0.2562, -0.0704, -0.0489, 0.1966, -0.0847, -0.0704, 0.1768, -0.1219, -0.0902, 0, -0.1562, 0.0902, 0, -0.1562, 0.0902, 0, -0.1562, 0.084, 0.0549, -0.1456, -0.0704, 0.1768, -0.1219, 0.084, 0.0549, -0.1456, 0.0388, 0.1768, -0.1219, -0.0704, 0.1768, -0.1219, 0.0902, 0, -0.1562, 0.1804, 0, 0, 0.1407, 0.1768, 0, 0.1407, 0.1768, 0, 0.0906, 0.1768, -0.0869, 0.0902, 0, -0.1562, 0.0906, 0.1768, -0.0869, 0.084, 0.0549, -0.1456, 0.0902, 0, -0.1562, 0.0906, 0.1768, -0.0869, 0.0388, 0.1768, -0.1219, 0.084, 0.0549, -0.1456, -0.1219, 0.1768, -0.0326, -0.1261, 0.1768, 0.0252, -0.154, 0.1176, 0, -0.0704, 0.1768, 0.1219, -0.0902, 0, 0.1562, -0.1804, 0, 0, -0.1804, 0, 0, -0.1261, 0.1768, 0.0252, -0.0704, 0.1768, 0.1219, -0.1804, 0, 0, -0.154, 0.1176, 0, -0.1261, 0.1768, 0.0252, -0.1219, 0.1768, -0.0326, -0.154, 0.1176, 0, -0.1804, 0, 0, -0.1804, 0, 0, -0.0902, 0, -0.1562, -0.1219, 0.1768, -0.0326, -0.0902, 0, -0.1562, -0.0704, 0.1768, -0.1219, -0.1219, 0.1768, -0.0326, 0.0026, 0.2562, 0.0321, -0.0429, 0.2402, 0.036, -0.0624, 0.2562, -0.0054, -0.0555, 0.2562, -0.0448, -0.0703, 0.2562, -0.0191, -0.0922, 0.1768, -0.0191, -0.0922, 0.1768, -0.0191, -0.0517, 0.1768, -0.0894, -0.0555, 0.2562, -0.0448, -0.0517, 0.1768, -0.0894, -0.0489, 0.1966, -0.0847, -0.0555, 0.2562, -0.0448, 0.1804, 0, 0, 0.0902, 0, 0.1562, 0.074, 0.1445, 0.1281, 0.074, 0.1445, 0.1281, 0.0906, 0.1768, 0.0869, 0.1804, 0, 0, 0.0906, 0.1768, 0.0869, 0.1407, 0.1768, 0, 0.1804, 0, 0, 0.074, 0.1445, 0.1281, 0.0902, 0, 0.1562, -0.0902, 0, 0.1562, -0.0902, 0, 0.1562, -0.0704, 0.1768, 0.1219, 0.074, 0.1445, 0.1281, -0.0704, 0.1768, 0.1219, -0.0132, 0.1768, 0.1219, 0.074, 0.1445, 0.1281, -0.0624, 0.2562, -0.0054, -0.0703, 0.2562, -0.0191, -0.0555, 0.2562, -0.0448, -0.0555, 0.2562, -0.0448, 0.0026, 0.2562, 0.0321, -0.0624, 0.2562, -0.0054, -0.0555, 0.2562, -0.0448, -0.0111, 0.2562, -0.0704, 0.0026, 0.2562, 0.0321, -0.0111, 0.2562, -0.0704, 0.0185, 0.2562, -0.0704, 0.0026, 0.2562, 0.0321, 0.0185, 0.2562, -0.0704, 0.0185, 0.2562, 0.0321, 0.0026, 0.2562, 0.0321, 0.0185, 0.2562, -0.0704, 0.0481, 0.2562, -0.0191, 0.0185, 0.2562, 0.0321, -0.0704, 0.1768, 0.1219, -0.1261, 0.1768, 0.0252, -0.1219, 0.1768, -0.0326, -0.1219, 0.1768, -0.0326, -0.0922, 0.1768, -0.0191, -0.0704, 0.1768, 0.1219, -0.0922, 0.1768, -0.0191, -0.0517, 0.1768, 0.0511, -0.0704, 0.1768, 0.1219, -0.0517, 0.1768, 0.0511, -0.0132, 0.1768, 0.1219, -0.0704, 0.1768, 0.1219, -0.0517, 0.1768, 0.0511, 0.0294, 0.1768, 0.0511, -0.0132, 0.1768, 0.1219, 0.0294, 0.1768, 0.0511, 0.0906, 0.1768, 0.0869, -0.0132, 0.1768, 0.1219, 0.0294, 0.1768, 0.0511, 0.07, 0.1768, -0.0191, 0.0906, 0.1768, 0.0869, -0.0922, 0.1768, -0.0191, -0.1219, 0.1768, -0.0326, -0.0704, 0.1768, -0.1219, -0.0704, 0.1768, -0.1219, -0.0517, 0.1768, -0.0894, -0.0922, 0.1768, -0.0191, -0.0704, 0.1768, -0.1219, 0.0388, 0.1768, -0.1219, -0.0517, 0.1768, -0.0894, 0.0388, 0.1768, -0.1219, 0.0294, 0.1768, -0.0894, -0.0517, 0.1768, -0.0894, 0.0388, 0.1768, -0.1219, 0.07, 0.1768, -0.0191, 0.0294, 0.1768, -0.0894, 0.0388, 0.1768, -0.1219, 0.0906, 0.1768, -0.0869, 0.07, 0.1768, -0.0191, 0.0906, 0.1768, -0.0869, 0.0906, 0.1768, 0.0869, 0.07, 0.1768, -0.0191, 0.0906, 0.1768, -0.0869, 0.1407, 0.1768, 0, 0.0906, 0.1768, 0.0869 ) -[sub_resource type="ArrayMesh" id=9] +[sub_resource type="ArrayMesh" id=8] resource_name = "rock_smallA" surfaces/0 = { "aabb": AABB( -0.0647542, 0.191224, -0.0802612, 0.132341, 9.99868e-06, 0.129747 ), @@ -151,10 +152,10 @@ surfaces/1 = { "vertex_count": 39 } -[sub_resource type="ConcavePolygonShape" id=10] +[sub_resource type="ConcavePolygonShape" id=9] data = PoolVector3Array( -0.0107, 0.1912, 0.0495, -0.0648, 0.1912, 0.0107, -0.0388, 0.1912, -0.0803, -0.0388, 0.1912, -0.0803, 0.0525, 0.1912, -0.0803, -0.0107, 0.1912, 0.0495, 0.0525, 0.1912, -0.0803, 0.0676, 0.1912, -0.0288, -0.0107, 0.1912, 0.0495, 0.1804, 0, 0, 0, 0, 0.1804, -0.0107, 0.1912, 0.0495, -0.0107, 0.1912, 0.0495, 0.0676, 0.1912, -0.0288, 0.1804, 0, 0, -0.0388, 0.1912, -0.0803, -0.1143, 0, -0.1804, 0.1275, 0, -0.1804, 0.1275, 0, -0.1804, 0.0525, 0.1912, -0.0803, -0.0388, 0.1912, -0.0803, -0.0648, 0.1912, 0.0107, -0.1804, 0, 0.051, -0.1143, 0, -0.1804, -0.1143, 0, -0.1804, -0.0388, 0.1912, -0.0803, -0.0648, 0.1912, 0.0107, -0.0107, 0.1912, 0.0495, 0, 0, 0.1804, -0.1804, 0, 0.051, -0.1804, 0, 0.051, -0.0648, 0.1912, 0.0107, -0.0107, 0.1912, 0.0495, -0.1143, 0, -0.1804, -0.1804, 0, 0.051, 0, 0, 0.1804, 0, 0, 0.1804, 0.1275, 0, -0.1804, -0.1143, 0, -0.1804, 0, 0, 0.1804, 0.1804, 0, 0, 0.1275, 0, -0.1804, 0.1275, 0, -0.1804, 0.1804, 0, 0, 0.0676, 0.1912, -0.0288, 0.0676, 0.1912, -0.0288, 0.0525, 0.1912, -0.0803, 0.1275, 0, -0.1804 ) -[sub_resource type="ArrayMesh" id=11] +[sub_resource type="ArrayMesh" id=10] resource_name = "rock_largeD" surfaces/0 = { "aabb": AABB( -0.534388, -8.5727e-16, -0.515142, 1.06879, 0.56826, 1.03028 ), @@ -193,10 +194,10 @@ surfaces/2 = { "vertex_count": 24 } -[sub_resource type="ConcavePolygonShape" id=12] +[sub_resource type="ConcavePolygonShape" id=11] data = PoolVector3Array( 0.5344, 0.3122, -0.1561, 0.3668, 0.5683, -0.1162, 0.2286, 0.5683, -0.2966, 0.2286, 0.5683, -0.2966, 0.5344, 0.2354, -0.2337, 0.5344, 0.3122, -0.1561, 0.2286, 0.5683, -0.2966, 0.3652, 0.2354, -0.4545, 0.5344, 0.2354, -0.2337, 0.1302, 0.2354, -0.5151, 0.1034, 0, -0.4177, 0.2914, 0, -0.3692, 0.2914, 0, -0.3692, 0.3652, 0.2354, -0.4545, 0.1302, 0.2354, -0.5151, 0.0362, 0.5683, 0.3143, 0.0599, 0.2354, 0.5151, -0.4441, 0.2354, 0.2336, -0.4441, 0.2354, 0.2336, -0.2813, 0.5683, 0.1369, 0.0362, 0.5683, 0.3143, 0.1401, 0.5683, 0.152, 0.1927, 0.4018, 0.319, 0.0922, 0.5683, 0.2773, -0.2906, 0.5683, -0.1718, -0.3381, 0.5683, -0.0761, -0.5344, 0.2354, -0.1045, -0.5344, 0.2354, -0.1045, -0.3514, 0.2354, -0.4729, -0.2906, 0.5683, -0.1718, -0.3514, 0.2354, -0.4729, -0.2872, 0.4018, -0.3905, -0.2906, 0.5683, -0.1718, -0.2872, 0.4018, -0.3905, -0.3514, 0.2354, -0.4729, 0.1302, 0.2354, -0.5151, 0.1302, 0.2354, -0.5151, 0.0805, 0.5683, -0.3348, -0.2872, 0.4018, -0.3905, 0.0805, 0.5683, -0.3348, -0.0712, 0.5683, -0.3215, -0.2872, 0.4018, -0.3905, 0.0551, 0.1474, 0.4745, -0.1545, 0, 0.294, -0.3561, 0, 0.1814, -0.3561, 0, 0.1814, -0.4441, 0.2354, 0.2336, 0.0551, 0.1474, 0.4745, -0.4441, 0.2354, 0.2336, 0.0599, 0.2354, 0.5151, 0.0551, 0.1474, 0.4745, 0.5344, 0.2354, -0.2337, 0.5076, 0.0815, -0.1498, 0.4897, 0.2354, -0.0954, -0.0712, 0.5683, -0.3215, -0.2906, 0.5683, -0.1718, -0.2872, 0.4018, -0.3905, -0.5344, 0.2354, -0.1045, -0.4441, 0.2354, 0.2336, -0.3561, 0, 0.1814, -0.3561, 0, 0.1814, -0.4283, 0, -0.0891, -0.5344, 0.2354, -0.1045, 0.5344, 0.2354, -0.2337, 0.4897, 0.2354, -0.0954, 0.5344, 0.3122, -0.1561, 0.2914, 0, -0.3692, 0.4669, 0, -0.14, 0.5076, 0.0815, -0.1498, 0.5076, 0.0815, -0.1498, 0.5344, 0.2354, -0.2337, 0.2914, 0, -0.3692, 0.5344, 0.2354, -0.2337, 0.3652, 0.2354, -0.4545, 0.2914, 0, -0.3692, -0.3167, 0.1177, -0.4284, -0.118, 0, -0.3982, 0.1034, 0, -0.4177, 0.1034, 0, -0.4177, 0.1302, 0.2354, -0.5151, -0.3167, 0.1177, -0.4284, 0.1302, 0.2354, -0.5151, -0.3514, 0.2354, -0.4729, -0.3167, 0.1177, -0.4284, 0.0805, 0.5683, -0.3348, 0.1302, 0.2354, -0.5151, 0.3652, 0.2354, -0.4545, 0.3652, 0.2354, -0.4545, 0.2286, 0.5683, -0.2966, 0.0805, 0.5683, -0.3348, 0.2119, 0.2354, 0.1174, 0.2374, 0.2354, 0.3977, 0.1927, 0.4018, 0.319, 0.1927, 0.4018, 0.319, 0.1401, 0.5683, 0.152, 0.2119, 0.2354, 0.1174, 0.1401, 0.5683, 0.152, 0.132, 0.5683, 0.0637, 0.2119, 0.2354, 0.1174, -0.2813, 0.5683, 0.1369, -0.4441, 0.2354, 0.2336, -0.5344, 0.2354, -0.1045, -0.5344, 0.2354, -0.1045, -0.3381, 0.5683, -0.0761, -0.2813, 0.5683, 0.1369, 0.0551, 0.1474, 0.4745, 0.1101, 0, 0.3649, -0.1545, 0, 0.294, -0.5344, 0.2354, -0.1045, -0.4283, 0, -0.0891, -0.3551, 0, -0.2365, -0.3551, 0, -0.2365, -0.3514, 0.2354, -0.4729, -0.5344, 0.2354, -0.1045, -0.3551, 0, -0.2365, -0.3167, 0.1177, -0.4284, -0.3514, 0.2354, -0.4729, 0.5344, 0.3122, -0.1561, 0.4897, 0.2354, -0.0954, 0.2119, 0.2354, 0.1174, 0.2119, 0.2354, 0.1174, 0.132, 0.5683, 0.0637, 0.5344, 0.3122, -0.1561, 0.132, 0.5683, 0.0637, 0.3668, 0.5683, -0.1162, 0.5344, 0.3122, -0.1561, 0.5076, 0.0815, -0.1498, 0.4669, 0, -0.14, 0.1688, 0, 0.0884, 0.1688, 0, 0.0884, 0.2119, 0.2354, 0.1174, 0.5076, 0.0815, -0.1498, 0.2119, 0.2354, 0.1174, 0.4897, 0.2354, -0.0954, 0.5076, 0.0815, -0.1498, 0.1927, 0.4018, 0.319, 0.2374, 0.2354, 0.3977, 0.0599, 0.2354, 0.5151, 0.0599, 0.2354, 0.5151, 0.0362, 0.5683, 0.3143, 0.1927, 0.4018, 0.319, 0.0362, 0.5683, 0.3143, 0.0922, 0.5683, 0.2773, 0.1927, 0.4018, 0.319, 0.2374, 0.2354, 0.3977, 0.1891, 0, 0.3126, 0.1101, 0, 0.3649, 0.1101, 0, 0.3649, 0.0551, 0.1474, 0.4745, 0.2374, 0.2354, 0.3977, 0.0551, 0.1474, 0.4745, 0.0599, 0.2354, 0.5151, 0.2374, 0.2354, 0.3977, -0.118, 0, -0.3982, -0.3167, 0.1177, -0.4284, -0.3551, 0, -0.2365, 0.1891, 0, 0.3126, 0.2374, 0.2354, 0.3977, 0.2119, 0.2354, 0.1174, 0.2119, 0.2354, 0.1174, 0.1688, 0, 0.0884, 0.1891, 0, 0.3126, -0.3551, 0, -0.2365, -0.4283, 0, -0.0891, -0.3561, 0, 0.1814, -0.3561, 0, 0.1814, -0.1545, 0, 0.294, -0.3551, 0, -0.2365, -0.1545, 0, 0.294, -0.118, 0, -0.3982, -0.3551, 0, -0.2365, -0.1545, 0, 0.294, 0.1101, 0, 0.3649, -0.118, 0, -0.3982, 0.1101, 0, 0.3649, 0.1034, 0, -0.4177, -0.118, 0, -0.3982, 0.1101, 0, 0.3649, 0.1688, 0, 0.0884, 0.1034, 0, -0.4177, 0.1688, 0, 0.0884, 0.2914, 0, -0.3692, 0.1034, 0, -0.4177, 0.1688, 0, 0.0884, 0.4669, 0, -0.14, 0.2914, 0, -0.3692, 0.1891, 0, 0.3126, 0.1688, 0, 0.0884, 0.1101, 0, 0.3649, 0.1401, 0.5683, 0.152, 0.0922, 0.5683, 0.2773, 0.132, 0.5683, 0.0637, 0.0805, 0.5683, -0.3348, 0.132, 0.5683, 0.0637, 0.0922, 0.5683, 0.2773, 0.0805, 0.5683, -0.3348, 0.0922, 0.5683, 0.2773, 0.0362, 0.5683, 0.3143, -0.0712, 0.5683, -0.3215, 0.0805, 0.5683, -0.3348, 0.0362, 0.5683, 0.3143, -0.0712, 0.5683, -0.3215, 0.0362, 0.5683, 0.3143, -0.2813, 0.5683, 0.1369, -0.2906, 0.5683, -0.1718, -0.0712, 0.5683, -0.3215, -0.2813, 0.5683, 0.1369, -0.2813, 0.5683, 0.1369, -0.3381, 0.5683, -0.0761, -0.2906, 0.5683, -0.1718, 0.0805, 0.5683, -0.3348, 0.2286, 0.5683, -0.2966, 0.132, 0.5683, 0.0637, 0.2286, 0.5683, -0.2966, 0.3668, 0.5683, -0.1162, 0.132, 0.5683, 0.0637, -0.4441, 0.2354, 0.2336, -0.5344, 0.2354, -0.1045, -0.3514, 0.2354, -0.4729, -0.3514, 0.2354, -0.4729, 0.0599, 0.2354, 0.5151, -0.4441, 0.2354, 0.2336, -0.3514, 0.2354, -0.4729, 0.1302, 0.2354, -0.5151, 0.0599, 0.2354, 0.5151, 0.1302, 0.2354, -0.5151, 0.2374, 0.2354, 0.3977, 0.0599, 0.2354, 0.5151, 0.1302, 0.2354, -0.5151, 0.2119, 0.2354, 0.1174, 0.2374, 0.2354, 0.3977, 0.2119, 0.2354, 0.1174, 0.1302, 0.2354, -0.5151, 0.3652, 0.2354, -0.4545, 0.3652, 0.2354, -0.4545, 0.4897, 0.2354, -0.0954, 0.2119, 0.2354, 0.1174, 0.3652, 0.2354, -0.4545, 0.5344, 0.2354, -0.2337, 0.4897, 0.2354, -0.0954 ) -[sub_resource type="ArrayMesh" id=13] +[sub_resource type="ArrayMesh" id=12] resource_name = "rock_largeC" surfaces/0 = { "aabb": AABB( -0.532205, -2.70717e-16, -0.507831, 1.06441, 0.321112, 1.01566 ), @@ -223,10 +224,10 @@ surfaces/1 = { "vertex_count": 24 } -[sub_resource type="ConcavePolygonShape" id=14] +[sub_resource type="ConcavePolygonShape" id=13] data = PoolVector3Array( -0.2022, 0.1046, -0.5078, -0.1617, 0, -0.4063, 0.286, 0, -0.2931, 0.286, 0, -0.2931, 0.3575, 0.1046, -0.3664, -0.2022, 0.1046, -0.5078, -0.2022, 0.1046, -0.5078, -0.3432, 0.1046, -0.3484, -0.2746, 0, -0.2787, -0.2746, 0, -0.2787, -0.1617, 0, -0.4063, -0.2022, 0.1046, -0.5078, 0.3575, 0.1046, -0.3664, 0.286, 0, -0.2931, 0.4258, 0, -0.0505, 0.4258, 0, -0.0505, 0.5322, 0.1046, -0.0631, 0.3575, 0.1046, -0.3664, 0.3607, 0, 0.2721, 0.4508, 0.1046, 0.3401, 0.5322, 0.1046, -0.0631, 0.5322, 0.1046, -0.0631, 0.4258, 0, -0.0505, 0.3607, 0, 0.2721, -0.2461, 0.1046, -0.0843, -0.1969, 0, -0.0674, -0.2746, 0, -0.2787, -0.2746, 0, -0.2787, -0.3432, 0.1046, -0.3484, -0.2461, 0.1046, -0.0843, -0.4258, 0, 0.2304, -0.5322, 0.1046, 0.288, -0.2461, 0.1046, 0.5078, -0.2461, 0.1046, 0.5078, -0.1969, 0, 0.4063, -0.4258, 0, 0.2304, -0.2461, 0.1732, -0.0843, -0.5322, 0.1732, 0.288, -0.5322, 0.1046, 0.288, -0.5322, 0.1046, 0.288, -0.2461, 0.1046, -0.0843, -0.2461, 0.1732, -0.0843, -0.2162, 0.3211, -0.2195, -0.3432, 0.1732, -0.3484, -0.2022, 0.1732, -0.5078, -0.2022, 0.1732, -0.5078, -0.1274, 0.3211, -0.3199, -0.2162, 0.3211, -0.2195, -0.2022, 0.1732, -0.5078, -0.2022, 0.1046, -0.5078, 0.3575, 0.1046, -0.3664, 0.3575, 0.1046, -0.3664, 0.3575, 0.1732, -0.3664, -0.2022, 0.1732, -0.5078, -0.3432, 0.1732, -0.3484, -0.2461, 0.1732, -0.0843, -0.2461, 0.1046, -0.0843, -0.2461, 0.1046, -0.0843, -0.3432, 0.1046, -0.3484, -0.3432, 0.1732, -0.3484, -0.2162, 0.3211, -0.2195, -0.1551, 0.3211, -0.0531, -0.2461, 0.1732, -0.0843, -0.2461, 0.1732, -0.0843, -0.3432, 0.1732, -0.3484, -0.2162, 0.3211, -0.2195, 0.3575, 0.1046, -0.3664, 0.5322, 0.1046, -0.0631, 0.5322, 0.1732, -0.0631, 0.5322, 0.1732, -0.0631, 0.3575, 0.1732, -0.3664, 0.3575, 0.1046, -0.3664, -0.2022, 0.1732, -0.5078, -0.3432, 0.1732, -0.3484, -0.3432, 0.1046, -0.3484, -0.3432, 0.1046, -0.3484, -0.2022, 0.1046, -0.5078, -0.2022, 0.1732, -0.5078, 0.4508, 0.1732, 0.3401, 0.4508, 0.1046, 0.3401, -0.0034, 0.1046, 0.5055, -0.0034, 0.1046, 0.5055, -0.0034, 0.1732, 0.5055, 0.4508, 0.1732, 0.3401, -0.2461, 0.1046, -0.0843, -0.5322, 0.1046, 0.288, -0.4258, 0, 0.2304, -0.4258, 0, 0.2304, -0.1969, 0, -0.0674, -0.2461, 0.1046, -0.0843, -0.2461, 0.1732, 0.5078, -0.2461, 0.1046, 0.5078, -0.5322, 0.1046, 0.288, -0.5322, 0.1046, 0.288, -0.5322, 0.1732, 0.288, -0.2461, 0.1732, 0.5078, -0.1617, 0, -0.4063, -0.2746, 0, -0.2787, -0.1969, 0, -0.0674, -0.1969, 0, -0.0674, -0.1969, 0, 0.4063, -0.1617, 0, -0.4063, -0.1969, 0, 0.4063, -0.0028, 0, 0.4044, -0.1617, 0, -0.4063, -0.0028, 0, 0.4044, 0.286, 0, -0.2931, -0.1617, 0, -0.4063, -0.0028, 0, 0.4044, 0.3607, 0, 0.2721, 0.286, 0, -0.2931, 0.3607, 0, 0.2721, 0.4258, 0, -0.0505, 0.286, 0, -0.2931, -0.1969, 0, 0.4063, -0.1969, 0, -0.0674, -0.4258, 0, 0.2304, -0.2461, 0.1732, 0.5078, -0.5322, 0.1732, 0.288, -0.4337, 0.2471, 0.2347, -0.4337, 0.2471, 0.2347, -0.2452, 0.3211, 0.2507, -0.2461, 0.1732, 0.5078, -0.2452, 0.3211, 0.2507, -0.1551, 0.3211, 0.3199, -0.2461, 0.1732, 0.5078, 0.5322, 0.1046, -0.0631, 0.4508, 0.1046, 0.3401, 0.4508, 0.1732, 0.3401, 0.4508, 0.1732, 0.3401, 0.5322, 0.1732, -0.0631, 0.5322, 0.1046, -0.0631, 0.4508, 0.1046, 0.3401, 0.3607, 0, 0.2721, -0.0028, 0, 0.4044, -0.0028, 0, 0.4044, -0.0034, 0.1046, 0.5055, 0.4508, 0.1046, 0.3401, -0.0034, 0.1732, 0.5055, -0.2461, 0.1732, 0.5078, -0.1551, 0.3211, 0.3199, -0.1551, 0.3211, 0.3199, -0.0022, 0.3211, 0.3185, -0.0034, 0.1732, 0.5055, 0.4508, 0.1732, 0.3401, 0.284, 0.3211, 0.2142, 0.3353, 0.3211, -0.0398, 0.3353, 0.3211, -0.0398, 0.5322, 0.1732, -0.0631, 0.4508, 0.1732, 0.3401, -0.1274, 0.3211, -0.3199, -0.2022, 0.1732, -0.5078, 0.3575, 0.1732, -0.3664, 0.3575, 0.1732, -0.3664, 0.2252, 0.3211, -0.2308, -0.1274, 0.3211, -0.3199, -0.0034, 0.1046, 0.5055, -0.0028, 0, 0.4044, -0.1969, 0, 0.4063, -0.1969, 0, 0.4063, -0.2461, 0.1046, 0.5078, -0.0034, 0.1046, 0.5055, -0.4337, 0.2471, 0.2347, -0.5322, 0.1732, 0.288, -0.2461, 0.1732, -0.0843, -0.2461, 0.1732, -0.0843, -0.2452, 0.3211, 0.0642, -0.4337, 0.2471, 0.2347, -0.2461, 0.1732, -0.0843, -0.1551, 0.3211, -0.0531, -0.2452, 0.3211, 0.0642, 0.4508, 0.1732, 0.3401, -0.0034, 0.1732, 0.5055, -0.0022, 0.3211, 0.3185, -0.0022, 0.3211, 0.3185, 0.284, 0.3211, 0.2142, 0.4508, 0.1732, 0.3401, -0.2452, 0.3211, 0.0642, -0.2452, 0.3211, 0.2507, -0.4337, 0.2471, 0.2347, 0.3353, 0.3211, -0.0398, 0.2252, 0.3211, -0.2308, 0.3575, 0.1732, -0.3664, 0.3575, 0.1732, -0.3664, 0.5322, 0.1732, -0.0631, 0.3353, 0.3211, -0.0398, -0.0034, 0.1732, 0.5055, -0.0034, 0.1046, 0.5055, -0.2461, 0.1046, 0.5078, -0.2461, 0.1046, 0.5078, -0.2461, 0.1732, 0.5078, -0.0034, 0.1732, 0.5055, -0.1551, 0.3211, 0.3199, -0.2452, 0.3211, 0.2507, -0.2452, 0.3211, 0.0642, -0.2452, 0.3211, 0.0642, -0.1551, 0.3211, -0.0531, -0.1551, 0.3211, 0.3199, -0.1551, 0.3211, -0.0531, -0.0022, 0.3211, 0.3185, -0.1551, 0.3211, 0.3199, -0.1551, 0.3211, -0.0531, -0.1274, 0.3211, -0.3199, -0.0022, 0.3211, 0.3185, -0.1274, 0.3211, -0.3199, 0.2252, 0.3211, -0.2308, -0.0022, 0.3211, 0.3185, 0.2252, 0.3211, -0.2308, 0.284, 0.3211, 0.2142, -0.0022, 0.3211, 0.3185, 0.2252, 0.3211, -0.2308, 0.3353, 0.3211, -0.0398, 0.284, 0.3211, 0.2142, -0.1274, 0.3211, -0.3199, -0.1551, 0.3211, -0.0531, -0.2162, 0.3211, -0.2195 ) -[sub_resource type="SphereShape" id=15] +[sub_resource type="SphereShape" id=14] radius = 5.11979 [node name="TestLVL" type="Spatial"] @@ -242,7 +243,7 @@ shadow_enabled = true [node name="WaterPlane" parent="." instance=ExtResource( 14 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.47593, 0 ) -mesh = SubResource( 16 ) +mesh = SubResource( 1 ) material/0 = ExtResource( 16 ) [node name="rock_smallFlatC2" type="Spatial" parent="."] @@ -254,14 +255,14 @@ transform = Transform( 1, 0, 0, 0, 0.452005, 0, 0, 0, 1, 0, -0.0247138, 0 ) [node name="rock_smallFlatC" type="MeshInstance" parent="rock_smallFlatC2/tmpParent"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0 ) use_in_baked_light = true -mesh = SubResource( 3 ) +mesh = SubResource( 2 ) material/0 = null material/1 = null [node name="StaticBody" type="StaticBody" parent="rock_smallFlatC2/tmpParent/rock_smallFlatC"] [node name="CollisionShape" type="CollisionShape" parent="rock_smallFlatC2/tmpParent/rock_smallFlatC/StaticBody"] -shape = SubResource( 4 ) +shape = SubResource( 3 ) [node name="Rocks" type="Spatial" parent="rock_smallFlatC2"] transform = Transform( 0.0190459, 0, 0, 0, 0.0571707, 0, 0, 0, 0.0190459, 0.285688, -0.0144457, -0.285688 ) @@ -274,14 +275,14 @@ transform = Transform( 5.65286, 0, 0, 0, 5.65286, 0, 0, 0, 5.65286, -12.9201, 0. [node name="rock_smallFlatC" type="MeshInstance" parent="rock_smallFlatC2/Rocks/rock_smallFlatC/tmpParent"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0 ) use_in_baked_light = true -mesh = SubResource( 3 ) +mesh = SubResource( 2 ) material/0 = null material/1 = null [node name="StaticBody" type="StaticBody" parent="rock_smallFlatC2/Rocks/rock_smallFlatC/tmpParent/rock_smallFlatC"] [node name="CollisionShape" type="CollisionShape" parent="rock_smallFlatC2/Rocks/rock_smallFlatC/tmpParent/rock_smallFlatC/StaticBody"] -shape = SubResource( 4 ) +shape = SubResource( 3 ) [node name="rock_tallB" type="Spatial" parent="rock_smallFlatC2/Rocks"] transform = Transform( 5.65286, 0, 0, 0, 5.65286, 0, 0, 0, 5.65286, -14.2025, 0.258005, 11.2607 ) @@ -291,7 +292,7 @@ transform = Transform( 5.65286, 0, 0, 0, 5.65286, 0, 0, 0, 5.65286, -14.2025, 0. [node name="rock_tallB" type="MeshInstance" parent="rock_smallFlatC2/Rocks/rock_tallB/tmpParent"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0 ) use_in_baked_light = true -mesh = SubResource( 5 ) +mesh = SubResource( 4 ) material/0 = null material/1 = null material/2 = null @@ -299,7 +300,7 @@ material/2 = null [node name="StaticBody" type="StaticBody" parent="rock_smallFlatC2/Rocks/rock_tallB/tmpParent/rock_tallB"] [node name="CollisionShape" type="CollisionShape" parent="rock_smallFlatC2/Rocks/rock_tallB/tmpParent/rock_tallB/StaticBody"] -shape = SubResource( 6 ) +shape = SubResource( 5 ) [node name="rock_smallE" type="Spatial" parent="rock_smallFlatC2/Rocks"] transform = Transform( 6.85371, 0, 0, 0, 6.85371, 0, 0, 0, 6.85371, -18.3314, 2.34693e-07, 17.6131 ) @@ -309,14 +310,14 @@ transform = Transform( 6.85371, 0, 0, 0, 6.85371, 0, 0, 0, 6.85371, -18.3314, 2. [node name="rock_smallE" type="MeshInstance" parent="rock_smallFlatC2/Rocks/rock_smallE/tmpParent"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0 ) use_in_baked_light = true -mesh = SubResource( 7 ) +mesh = SubResource( 6 ) material/0 = null material/1 = null [node name="StaticBody" type="StaticBody" parent="rock_smallFlatC2/Rocks/rock_smallE/tmpParent/rock_smallE"] [node name="CollisionShape" type="CollisionShape" parent="rock_smallFlatC2/Rocks/rock_smallE/tmpParent/rock_smallE/StaticBody"] -shape = SubResource( 8 ) +shape = SubResource( 7 ) [node name="rock_smallA" type="Spatial" parent="rock_smallFlatC2/Rocks"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -18.5467, -3.72529e-09, 13.5098 ) @@ -326,14 +327,14 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -18.5467, -3.72529e-09, 13.509 [node name="rock_smallA" type="MeshInstance" parent="rock_smallFlatC2/Rocks/rock_smallA/tmpParent"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0 ) use_in_baked_light = true -mesh = SubResource( 9 ) +mesh = SubResource( 8 ) material/0 = null material/1 = null [node name="StaticBody" type="StaticBody" parent="rock_smallFlatC2/Rocks/rock_smallA/tmpParent/rock_smallA"] [node name="CollisionShape" type="CollisionShape" parent="rock_smallFlatC2/Rocks/rock_smallA/tmpParent/rock_smallA/StaticBody"] -shape = SubResource( 10 ) +shape = SubResource( 9 ) [node name="rock_largeD" type="Spatial" parent="rock_smallFlatC2/Rocks"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -17.8118, 1.11759e-08, 11.9321 ) @@ -343,7 +344,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -17.8118, 1.11759e-08, 11.9321 [node name="rock_largeD" type="MeshInstance" parent="rock_smallFlatC2/Rocks/rock_largeD/tmpParent"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0 ) use_in_baked_light = true -mesh = SubResource( 11 ) +mesh = SubResource( 10 ) material/0 = null material/1 = null material/2 = null @@ -351,7 +352,7 @@ material/2 = null [node name="StaticBody" type="StaticBody" parent="rock_smallFlatC2/Rocks/rock_largeD/tmpParent/rock_largeD"] [node name="CollisionShape" type="CollisionShape" parent="rock_smallFlatC2/Rocks/rock_largeD/tmpParent/rock_largeD/StaticBody"] -shape = SubResource( 12 ) +shape = SubResource( 11 ) [node name="rock_largeC" type="Spatial" parent="rock_smallFlatC2/Rocks"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -10.9969, -2.27243e-07, 12.2947 ) @@ -361,14 +362,14 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -10.9969, -2.27243e-07, 12.294 [node name="rock_largeC" type="MeshInstance" parent="rock_smallFlatC2/Rocks/rock_largeC/tmpParent"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0 ) use_in_baked_light = true -mesh = SubResource( 13 ) +mesh = SubResource( 12 ) material/0 = null material/1 = null [node name="StaticBody" type="StaticBody" parent="rock_smallFlatC2/Rocks/rock_largeC/tmpParent/rock_largeC"] [node name="CollisionShape" type="CollisionShape" parent="rock_smallFlatC2/Rocks/rock_largeC/tmpParent/rock_largeC/StaticBody"] -shape = SubResource( 14 ) +shape = SubResource( 13 ) [node name="Spawners" type="Spatial" parent="."] @@ -413,4 +414,8 @@ script = ExtResource( 11 ) yarnScript = ExtResource( 4 ) [node name="CollisionShape" type="CollisionShape" parent="Triggers/Event1"] -shape = SubResource( 15 ) +shape = SubResource( 14 ) + +[node name="Switch" parent="." instance=ExtResource( 17 )] +transform = Transform( 1, 0, 0, 0, 0.0600904, 0.998193, 0, -0.998193, 0.0600904, 7.74067, -0.485543, -28.5048 ) +[connection signal="switch" from="Switch" to="." method="_on_Switch_switch"] diff --git a/jrpg/scenes/entities/Enemy.tscn b/jrpg/scenes/entities/Enemy.tscn index eb214f0..d631022 100644 --- a/jrpg/scenes/entities/Enemy.tscn +++ b/jrpg/scenes/entities/Enemy.tscn @@ -1,11 +1,16 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://jrpg/models/chars/Zombie_Male.glb" type="PackedScene" id=1] [ext_resource path="res://jrpg/scripts/entities/npc.gd" type="Script" id=2] +[ext_resource path="res://jrpg/scripts/entities/utils/trigger_relay.gd" type="Script" id=3] [sub_resource type="CapsuleShape" id=1] radius = 0.5 +[sub_resource type="CapsuleShape" id=2] +radius = 0.543022 +height = 0.89044 + [node name="Enemy" type="KinematicBody"] script = ExtResource( 2 ) @@ -17,4 +22,12 @@ shape = SubResource( 1 ) transform = Transform( 0.65, 0, 0, 0, 0.65, 0, 0, 0, 0.65, 0, 0, 0 ) [node name="Timer" type="Timer" parent="."] + +[node name="InteractableArea" type="Area" parent="."] +script = ExtResource( 3 ) + +[node name="CollisionShape" type="CollisionShape" parent="InteractableArea"] +transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 1, 0 ) +shape = SubResource( 2 ) [connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] +[connection signal="on_interact" from="InteractableArea" to="." method="on_interact"] diff --git a/jrpg/scenes/entities/Pickup.tscn b/jrpg/scenes/entities/Pickup.tscn index 711f64b..be3fcd3 100644 --- a/jrpg/scenes/entities/Pickup.tscn +++ b/jrpg/scenes/entities/Pickup.tscn @@ -21,6 +21,5 @@ material/1 = ExtResource( 4 ) [node name="CollisionShape" type="CollisionShape" parent="."] shape = SubResource( 1 ) -[connection signal="body_entered" from="." to="." method="_on_Pickup_body_entered"] [editable path="coinGold"] diff --git a/jrpg/scenes/entities/Player.tscn b/jrpg/scenes/entities/Player.tscn index 8aa4247..67d0970 100644 --- a/jrpg/scenes/entities/Player.tscn +++ b/jrpg/scenes/entities/Player.tscn @@ -1,13 +1,21 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://jrpg/models/chars/Casual2_Female.glb" type="PackedScene" id=1] -[ext_resource path="res://jrpg/scripts/entities/camera/camera_orbit.gd" type="Script" id=3] +[ext_resource path="res://jrpg/scripts/camera/camera_orbit.gd" type="Script" id=3] [ext_resource path="res://jrpg/scripts/entities/player.gd" type="Script" id=4] [sub_resource type="CapsuleShape" id=1] radius = 0.5 -[node name="Player" type="KinematicBody"] +[sub_resource type="CapsuleShape" id=2] +radius = 0.628143 +height = 0.985831 + +[sub_resource type="SphereShape" id=3] + +[node name="Player" type="KinematicBody" groups=[ +"Player", +]] script = ExtResource( 4 ) [node name="Casual2_Female" parent="." instance=ExtResource( 1 )] @@ -26,9 +34,16 @@ transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, -1, 1, current = true far = 329.0 -[node name="InteractRayCast" type="RayCast" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.3, 1, 0.2 ) -enabled = true -cast_to = Vector3( 0, 0, 1.7 ) +[node name="TouchableArea" type="Area" parent="."] + +[node name="CollisionShape" type="CollisionShape" parent="TouchableArea"] +transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 1.12047, 0 ) +shape = SubResource( 2 ) + +[node name="InteractorArea" type="Area" parent="."] + +[node name="CollisionShape" type="CollisionShape" parent="InteractorArea"] +transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 1.12047, 0.99678 ) +shape = SubResource( 3 ) [editable path="Casual2_Female"] diff --git a/jrpg/scenes/entities/Switch.tscn b/jrpg/scenes/entities/Switch.tscn new file mode 100644 index 0000000..cf2c3ee --- /dev/null +++ b/jrpg/scenes/entities/Switch.tscn @@ -0,0 +1,101 @@ +[gd_scene load_steps=10 format=2] + +[ext_resource path="res://jrpg/scripts/entities/switch.gd" type="Script" id=1] +[ext_resource path="res://jrpg/scripts/entities/utils/trigger_relay.gd" type="Script" id=2] + +[sub_resource type="BoxShape" id=1] +extents = Vector3( 0.25, 0.25, 0.25 ) + +[sub_resource type="CubeMesh" id=2] +size = Vector3( 0.5, 0.2, 0.5 ) + +[sub_resource type="CubeMesh" id=3] +size = Vector3( 0.2, 0.159, 0.287 ) + +[sub_resource type="SpatialMaterial" id=4] +albedo_color = Color( 1, 0, 0, 1 ) + +[sub_resource type="Animation" id=5] +tracks/0/type = "value" +tracks/0/path = NodePath("Model/MeshInstance2:material/0:albedo_color") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 1 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Color( 1, 0, 0, 1 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Model/MeshInstance2:rotation_degrees") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 1 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Vector3( -22, 0, 0 ) ] +} + +[sub_resource type="Animation" id=6] +tracks/0/type = "value" +tracks/0/path = NodePath("Model/MeshInstance2:material/0:albedo_color") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 1 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Color( 0, 1, 0.505882, 1 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Model/MeshInstance2:rotation_degrees") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 1 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Vector3( 22, 0, 0 ) ] +} + +[sub_resource type="SphereShape" id=7] +radius = 0.5 + +[node name="Switch" type="KinematicBody"] +script = ExtResource( 1 ) + +[node name="CollisionShape" type="CollisionShape" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.15, 0 ) +shape = SubResource( 1 ) + +[node name="Model" type="Spatial" parent="."] + +[node name="MeshInstance" type="MeshInstance" parent="Model"] +mesh = SubResource( 2 ) +material/0 = null + +[node name="MeshInstance2" type="MeshInstance" parent="Model"] +transform = Transform( 1, 0, 0, 0, 0.927184, 0.374607, 0, -0.374607, 0.927184, 0, 0.0918144, 0 ) +mesh = SubResource( 3 ) +material/0 = SubResource( 4 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/Off = SubResource( 5 ) +anims/On = SubResource( 6 ) + +[node name="InteractableArea" type="Area" parent="."] +script = ExtResource( 2 ) + +[node name="CollisionShape" type="CollisionShape" parent="InteractableArea"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.35, 0 ) +shape = SubResource( 7 ) +[connection signal="on_interact" from="InteractableArea" to="." method="on_interact"] diff --git a/jrpg/scripts/entities/camera/camera_orbit.gd b/jrpg/scripts/camera/camera_orbit.gd similarity index 100% rename from jrpg/scripts/entities/camera/camera_orbit.gd rename to jrpg/scripts/camera/camera_orbit.gd diff --git a/jrpg/scripts/entities/data/character_data.gd b/jrpg/scripts/data/character_data.gd similarity index 100% rename from jrpg/scripts/entities/data/character_data.gd rename to jrpg/scripts/data/character_data.gd diff --git a/jrpg/scripts/entities/area_script_trigger.gd b/jrpg/scripts/entities/area_script_trigger.gd new file mode 100644 index 0000000..be17e1f --- /dev/null +++ b/jrpg/scripts/entities/area_script_trigger.gd @@ -0,0 +1,13 @@ +extends Area + +export var yarnScript : Resource + +var enabled := false + +func enable(): + enabled = true + +func on_touch(body): + if enabled: + EventDispatcher.emit_signal("trigger_script", yarnScript) + enabled = false diff --git a/jrpg/scripts/entities/components/interactions/basis_interaction.gd b/jrpg/scripts/entities/components/interactions/basis_interaction.gd deleted file mode 100644 index 39bb5f2..0000000 --- a/jrpg/scripts/entities/components/interactions/basis_interaction.gd +++ /dev/null @@ -1,16 +0,0 @@ -extends Node - -class_name BasisInteraction - -export var auto_connect_on_ready := true - -func _ready(): - init() - if auto_connect_on_ready: - get_parent().connect("on_interact", self, "on_interact") - -func init(): - pass - -func on_interact(): - print("interact") diff --git a/jrpg/scripts/entities/components/interactions/talk_interaction.gd b/jrpg/scripts/entities/components/interactions/talk_interaction.gd deleted file mode 100644 index 81f844c..0000000 --- a/jrpg/scripts/entities/components/interactions/talk_interaction.gd +++ /dev/null @@ -1,8 +0,0 @@ -extends BasisInteraction - -class_name TalkInteraction - -var yarn_script : Resource - -func on_interact(): - EventDispatcher.emit_signal("trigger_script", yarn_script) diff --git a/jrpg/scripts/entities/enemy.gd b/jrpg/scripts/entities/enemy.gd deleted file mode 100644 index 3ad54c9..0000000 --- a/jrpg/scripts/entities/enemy.gd +++ /dev/null @@ -1,88 +0,0 @@ -extends KinematicBody - -# stats -var curHp : int = 3 -var maxHp : int = 3 - -# attacking -var damage : int = 1 -var attackDist : float = 1.5 -var attackRate : float = 1.0 - -# physics -var moveSpeed : float = 2.5 -var gravity : float = 15.0 - -# vectors -var vel : Vector3 = Vector3() - -# components -onready var timer = get_node("Timer") -export var player_path : NodePath -onready var player = get_node(player_path) -onready var anim = get_node("Zombie_Male/AnimationPlayer") - -func _ready (): - # set the timer wait time - timer.wait_time = attackRate - timer.start() - -# called every "attackRate" seconds -func _on_Timer_timeout (): - - # if we're within the attack distance - attack the player - if translation.distance_to(player.translation) <= attackDist: - anim.play("Punch") - player.take_damage(damage) - -# called 60 times a second -func _physics_process (delta): - - # get the distance from us to the player - var dist = translation.distance_to(player.translation) - - # if we're outside of the attack distance, chase after the player - if dist > attackDist: - # calculate the direction between us and the player - var dir = (player.translation - translation).normalized() - vel.x = dir.x - vel.z = dir.z - - # gravity - vel.y -= gravity * delta - - # TODO better - look_at(player.translation, Vector3.UP) - rotation_degrees.x = 0 - rotation_degrees.y = rotation_degrees.y + 180 - rotation_degrees.z = 0 - - # move towards the player - vel = move_and_slide(vel, Vector3.UP) - - if is_on_floor(): - if anim.current_animation != "Punch" and anim.current_animation != "RecieveHit": - if vel.length_squared() > 0: - anim.play("Walk") - else: - anim.play("Idle") - else: - anim.play("RecieveHit") - - -# called when the player deals damage to us -func take_damage (damageToTake): - - curHp -= damageToTake - - anim.play("RecieveHit") - - # if our health reaches 0 - die - if curHp <= 0: - die() - -# called when our health reaches 0 -func die (): - - # destroy the node - queue_free() diff --git a/jrpg/scripts/entities/npc.gd b/jrpg/scripts/entities/npc.gd index 85fd0ed..cebabf5 100644 --- a/jrpg/scripts/entities/npc.gd +++ b/jrpg/scripts/entities/npc.gd @@ -1,4 +1,8 @@ extends Node -signal on_interact -signal on_attack +class_name NPC + +var yarn_script : Resource + +func on_interact(): + EventDispatcher.emit_signal("trigger_script", yarn_script) diff --git a/jrpg/scripts/entities/pickup.gd b/jrpg/scripts/entities/pickup.gd index d16c009..e78af96 100644 --- a/jrpg/scripts/entities/pickup.gd +++ b/jrpg/scripts/entities/pickup.gd @@ -7,13 +7,12 @@ var rotateSpeed : float = 5.0 # called every frame func _process (delta): - # rotate along the Y axis rotate_y(rotateSpeed * delta) -func _on_Pickup_body_entered(body): +func on_touch(body : KinematicBody): # is this the player? If so give them gold - if body.name == "Player": + if body.is_in_group("Player"): body.give_gold(goldToGive) emit_signal("picked_up") queue_free() diff --git a/jrpg/scripts/entities/player.gd b/jrpg/scripts/entities/player.gd index 69db13a..edb73ba 100644 --- a/jrpg/scripts/entities/player.gd +++ b/jrpg/scripts/entities/player.gd @@ -23,6 +23,9 @@ func _process(delta): # attack input if Controller.player_input_enabled and is_on_floor() and Input.is_action_just_pressed("interact"): try_interact() + + for area in $TouchableArea.get_overlapping_areas(): + try_touch(area) # called every physics step (60 times a second) func _physics_process (delta): @@ -108,33 +111,16 @@ func die (): # reload the scene get_tree().reload_current_scene() -## called when we press the attack button -#func try_attack(): -# # if we're not ready to attack, return -# if OS.get_ticks_msec() - lastAttackTime < attackRate * 1000: -# return -# -# # set the last attack time to now -# lastAttackTime = OS.get_ticks_msec() -# -# # play the animation -# anim.stop() -# anim.play("Punch") -# -# # is the ray cast colliding with an enemy? -# if attackCast.is_colliding(): -# if attackCast.get_collider().has_method("take_damage"): -# attackCast.get_collider().take_damage(damage) -# if attackCast.get_collider().has_signal("on_interact"): -# attackCast.get_collider().emit_signal("on_interact") - +func try_touch(area): + if area.has_method("on_touch"): + area.on_touch(self) # called when we press the interact button func try_interact(): # is the ray cast colliding with an enemy? - if interactCast.is_colliding(): + for area in $InteractorArea.get_overlapping_areas(): # play the animation anim.stop() anim.play("Idle") - if interactCast.get_collider().has_signal("on_interact"): - interactCast.get_collider().emit_signal("on_interact") + if area.has_method("on_interact"): + area.on_interact() diff --git a/jrpg/scripts/entities/switch.gd b/jrpg/scripts/entities/switch.gd new file mode 100644 index 0000000..e54f50d --- /dev/null +++ b/jrpg/scripts/entities/switch.gd @@ -0,0 +1,23 @@ +extends KinematicBody + +signal switch + +export var initial_state := false + +var activated := false + +func _ready(): + activated = initial_state + update_view() + emit_signal("switch", activated) + +func on_interact(): + activated = !activated + update_view() + emit_signal("switch", activated) + +func update_view(): + if activated: + $AnimationPlayer.play("On") + else: + $AnimationPlayer.play("Off") diff --git a/jrpg/scripts/entities/utils/trigger_relay.gd b/jrpg/scripts/entities/utils/trigger_relay.gd new file mode 100644 index 0000000..ffd7934 --- /dev/null +++ b/jrpg/scripts/entities/utils/trigger_relay.gd @@ -0,0 +1,6 @@ +extends Node + +signal on_interact() + +func on_interact(): + emit_signal("on_interact") diff --git a/jrpg/scripts/levels/script_trigger.gd b/jrpg/scripts/levels/script_trigger.gd deleted file mode 100644 index a1b7edd..0000000 --- a/jrpg/scripts/levels/script_trigger.gd +++ /dev/null @@ -1,9 +0,0 @@ -extends Area - -export var yarnScript : Resource - -func enable(): - self.connect("body_entered", self, "_on_TriggerArea_body_entered") - -func _on_TriggerArea_body_entered(body): - EventDispatcher.emit_signal("trigger_script", yarnScript) diff --git a/jrpg/scripts/levels/spawner.gd b/jrpg/scripts/levels/spawner.gd index 301a460..2e26755 100644 --- a/jrpg/scripts/levels/spawner.gd +++ b/jrpg/scripts/levels/spawner.gd @@ -2,14 +2,9 @@ extends Node export var character_data : Resource -var interaction_component : BasisInteraction - func spawn(): var inst = character_data.scene.instance() inst.name = character_data.name if character_data.yarn != null: - interaction_component = TalkInteraction.new() - interaction_component.name = character_data.yarn.resource_name - interaction_component.yarn_script = character_data.yarn - inst.add_child(interaction_component) + inst.yarn_script = character_data.yarn add_child(inst) diff --git a/jrpg/scripts/misc/test_level.gd b/jrpg/scripts/misc/test_level.gd index 3b38ad0..e6ad5cb 100644 --- a/jrpg/scripts/misc/test_level.gd +++ b/jrpg/scripts/misc/test_level.gd @@ -71,3 +71,7 @@ func scene(args): func _exit_tree(): Controller.hud.hide() Controller.speech_panel.hide() + + +func _on_Switch_switch(activated): + $DirectionalLight.light_energy = activated if 1 else 0 diff --git a/jrpg/scripts/entities/model/player_infos.gd b/jrpg/scripts/model/player_infos.gd similarity index 100% rename from jrpg/scripts/entities/model/player_infos.gd rename to jrpg/scripts/model/player_infos.gd diff --git a/project.godot b/project.godot index 9157014..ca77fdc 100644 --- a/project.godot +++ b/project.godot @@ -14,15 +14,10 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://jrpg/scripts/levels/base_level.gd" }, { -"base": "Node", -"class": "BasisInteraction", -"language": "GDScript", -"path": "res://jrpg/scripts/entities/components/interactions/basis_interaction.gd" -}, { "base": "Resource", "class": "CharacterData", "language": "GDScript", -"path": "res://jrpg/scripts/entities/data/character_data.gd" +"path": "res://jrpg/scripts/data/character_data.gd" }, { "base": "VBoxContainer", "class": "ChoicesBox", @@ -34,6 +29,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://jrpg/scripts/ui/test_hud.gd" }, { +"base": "Node", +"class": "NPC", +"language": "GDScript", +"path": "res://jrpg/scripts/entities/npc.gd" +}, { "base": "KinematicBody", "class": "Player", "language": "GDScript", @@ -42,7 +42,7 @@ _global_script_classes=[ { "base": "Object", "class": "PlayerInfos", "language": "GDScript", -"path": "res://jrpg/scripts/entities/model/player_infos.gd" +"path": "res://jrpg/scripts/model/player_infos.gd" }, { "base": "Control", "class": "SpeechPanel", @@ -54,11 +54,6 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://jrpg/scripts/ui/speech_text.gd" }, { -"base": "BasisInteraction", -"class": "TalkInteraction", -"language": "GDScript", -"path": "res://jrpg/scripts/entities/components/interactions/talk_interaction.gd" -}, { "base": "BaseLevel", "class": "TestLevel", "language": "GDScript", @@ -86,15 +81,14 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "BaseLevel": "", -"BasisInteraction": "", "CharacterData": "", "ChoicesBox": "", "HUD": "", +"NPC": "", "Player": "", "PlayerInfos": "", "SpeechPanel": "", "SpeechText": "", -"TalkInteraction": "", "TestLevel": "", "YarnImporter": "", "YarnRunner": "",