hit and hurt boxes

pull/2/head
Sascha 2024-05-29 10:21:48 +07:00
parent dd9799b00a
commit a0f78268d8
19 changed files with 201261 additions and 67 deletions

File diff suppressed because one or more lines are too long

@ -155,7 +155,7 @@ graph_offset = Vector2(-318, -97.186)
[sub_resource type="ViewportTexture" id="ViewportTexture_1vx5n"] [sub_resource type="ViewportTexture" id="ViewportTexture_1vx5n"]
viewport_path = NodePath("sprite_enemy_overlay/EnemyOverlay") viewport_path = NodePath("sprite_enemy_overlay/EnemyOverlay")
[node name="Skeleton_Warrior_new" instance=ExtResource("1_1tv7o")] [node name="Skeleton_Warrior_old" instance=ExtResource("1_1tv7o")]
script = ExtResource("2_gn4pp") script = ExtResource("2_gn4pp")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." index="0"] [node name="CollisionShape3D" type="CollisionShape3D" parent="." index="0"]
@ -168,114 +168,129 @@ debug_enabled = true
[node name="Skeleton3D" parent="Rig" index="0"] [node name="Skeleton3D" parent="Rig" index="0"]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0) transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
bones/0/rotation = Quaternion(-8.55849e-09, -0.000274706, -1.25818e-11, 1) bones/0/rotation = Quaternion(-8.55849e-09, -0.000274706, -1.25818e-11, 1)
bones/1/position = Vector3(8.16132e-19, 0.382984, 1.30438e-15) bones/1/position = Vector3(6.64802e-19, 0.369938, 1.20825e-15)
bones/1/rotation = Quaternion(5.47782e-05, 0.0425453, 3.42195e-05, 0.999095) bones/1/rotation = Quaternion(5.44561e-05, 0.0425453, 3.42348e-05, 0.999095)
bones/1/scale = Vector3(1, 1, 1)
bones/2/position = Vector3(5.98822e-12, 0.191978, -2.81142e-12) bones/2/position = Vector3(5.98822e-12, 0.191978, -2.81142e-12)
bones/2/rotation = Quaternion(-3.10378e-05, 0.00388564, 0.000187698, 0.999992) bones/2/rotation = Quaternion(-2.79886e-05, 0.00399459, 0.000181815, 0.999992)
bones/2/scale = Vector3(1, 1, 1)
bones/3/position = Vector3(-1.41718e-11, 0.374988, 2.56119e-11) bones/3/position = Vector3(-1.41718e-11, 0.374988, 2.56119e-11)
bones/3/rotation = Quaternion(2.86863e-05, 8.03129e-05, 0.000548415, 1) bones/3/rotation = Quaternion(3.63335e-05, 8.24477e-05, 0.000559379, 1)
bones/4/position = Vector3(0.211997, 0.134122, -2.27967e-05) bones/3/scale = Vector3(1, 1, 1)
bones/4/rotation = Quaternion(-0.554613, -0.0656539, -0.656589, 0.506937) bones/4/position = Vector3(0.212005, 0.134126, -2.50098e-05)
bones/4/rotation = Quaternion(-0.551295, -0.0608436, -0.645622, 0.524922)
bones/4/scale = Vector3(0.999999, 0.999999, 1) bones/4/scale = Vector3(0.999999, 0.999999, 1)
bones/5/position = Vector3(4.27124e-08, 0.241897, -1.72472e-07) bones/5/position = Vector3(4.27124e-08, 0.241897, -1.72472e-07)
bones/5/rotation = Quaternion(2.10572e-07, 1.0219e-08, -0.474544, 0.880232) bones/5/rotation = Quaternion(2.21527e-07, 7.7559e-08, -0.50175, 0.865013)
bones/5/scale = Vector3(1, 1, 1)
bones/6/position = Vector3(1.43398e-08, 0.260044, -2.47846e-08) bones/6/position = Vector3(1.43398e-08, 0.260044, -2.47846e-08)
bones/6/rotation = Quaternion(-2.29225e-07, 3.87405e-08, 0.0266581, 0.999645) bones/6/rotation = Quaternion(-2.29225e-07, 3.87405e-08, 0.0266581, 0.999645)
bones/6/scale = Vector3(1, 1, 1) bones/6/scale = Vector3(1, 1, 1)
bones/7/position = Vector3(-7.1782e-09, 0.0738259, -1.0869e-08) bones/7/position = Vector3(-7.1782e-09, 0.0738259, -1.0869e-08)
bones/7/rotation = Quaternion(-0.317845, -0.326853, 0.129819, 0.880505) bones/7/rotation = Quaternion(-0.31985, -0.336269, 0.139119, 0.874794)
bones/7/scale = Vector3(1, 1, 1)
bones/8/position = Vector3(9.24142e-10, 0.0961252, -0.0575) bones/8/position = Vector3(9.24142e-10, 0.0961252, -0.0575)
bones/8/rotation = Quaternion(0.00151, 0.00152182, -0.701159, 0.713002) bones/8/rotation = Quaternion(0.00137925, 0.00136064, -0.701714, 0.712456)
bones/9/position = Vector3(-0.212006, 0.134125, -2.27046e-05) bones/8/scale = Vector3(1, 1, 1)
bones/9/rotation = Quaternion(-0.614774, 0.0853545, 0.62569, 0.472526) bones/9/position = Vector3(-0.211998, 0.134121, -2.04914e-05)
bones/9/rotation = Quaternion(-0.611123, 0.0808876, 0.616329, 0.490025)
bones/9/scale = Vector3(0.999999, 0.999999, 1) bones/9/scale = Vector3(0.999999, 0.999999, 1)
bones/10/position = Vector3(-4.04491e-08, 0.241897, -5.30697e-08) bones/10/position = Vector3(-4.04491e-08, 0.241897, -5.30697e-08)
bones/10/rotation = Quaternion(2.17569e-07, -6.91352e-08, 0.500305, 0.865849) bones/10/rotation = Quaternion(2.03615e-07, -8.71308e-08, 0.526245, 0.850333)
bones/10/scale = Vector3(1, 1, 1)
bones/11/position = Vector3(-3.84913e-08, 0.260044, 1.39398e-08) bones/11/position = Vector3(-3.84913e-08, 0.260044, 1.39398e-08)
bones/11/rotation = Quaternion(-2.17454e-07, -1.26836e-08, -0.0266581, 0.999645) bones/11/rotation = Quaternion(-2.17454e-07, -1.26836e-08, -0.0266581, 0.999645)
bones/11/scale = Vector3(1, 1, 1) bones/11/scale = Vector3(1, 1, 1)
bones/12/position = Vector3(-1.3659e-08, 0.0738259, -6.36405e-08) bones/12/position = Vector3(-1.3659e-08, 0.0738259, -6.36405e-08)
bones/12/rotation = Quaternion(-0.311756, 0.304825, -0.213302, 0.874295) bones/12/rotation = Quaternion(-0.314378, 0.315529, -0.222963, 0.867119)
bones/12/scale = Vector3(1, 1, 1)
bones/13/position = Vector3(-1.97277e-08, 0.0961251, -0.0575) bones/13/position = Vector3(-1.97277e-08, 0.0961251, -0.0575)
bones/13/rotation = Quaternion(0.00376176, 0.00442777, 0.70305, 0.711116) bones/13/rotation = Quaternion(0.00422151, 0.00494949, 0.702563, 0.711592)
bones/13/scale = Vector3(1, 1, 1)
bones/14/position = Vector3(-1.24878e-11, 0.268797, 4.0423e-15) bones/14/position = Vector3(-1.24878e-11, 0.268797, 4.0423e-15)
bones/14/rotation = Quaternion(0.000529821, -0.0308609, -2.11689e-05, 0.999524) bones/14/rotation = Quaternion(0.00053659, -0.0309765, -1.39809e-05, 0.99952)
bones/16/position = Vector3(0.170945, 0.113587, 0.000319267) bones/16/position = Vector3(0.170945, 0.113587, 0.000221288)
bones/16/rotation = Quaternion(0.992493, 0.081591, 0.0753534, 0.0512185) bones/16/rotation = Quaternion(0.989657, 0.082121, 0.0778557, 0.0881679)
bones/16/scale = Vector3(1, 1, 1) bones/16/scale = Vector3(1, 1, 1)
bones/17/position = Vector3(3.92422e-08, 0.227078, -1.35528e-10) bones/17/position = Vector3(3.92422e-08, 0.227078, -1.35528e-10)
bones/17/rotation = Quaternion(0.291779, 7.46543e-08, -2.03199e-07, 0.956486) bones/17/rotation = Quaternion(0.389702, 6.52278e-08, -2.6229e-07, 0.920941)
bones/17/scale = Vector3(1, 1, 1)
bones/18/position = Vector3(4.37849e-08, 0.149437, -6.94943e-09) bones/18/position = Vector3(4.37849e-08, 0.149437, -6.94943e-09)
bones/18/rotation = Quaternion(-0.567927, -0.203552, 0.0569006, 0.79548) bones/18/rotation = Quaternion(-0.61891, -0.198635, 0.0739345, 0.756326)
bones/18/scale = Vector3(1, 1, 0.999999) bones/18/scale = Vector3(1, 1, 0.999999)
bones/19/position = Vector3(-7.03199e-09, 0.16565, 2.68891e-08) bones/19/position = Vector3(-7.03199e-09, 0.16565, 2.68891e-08)
bones/19/rotation = Quaternion(4.02035e-05, 0.920193, -0.391466, -8.92328e-06) bones/19/rotation = Quaternion(-1.9783e-06, 0.920155, -0.391554, 6.20673e-07)
bones/19/scale = Vector3(1, 0.999998, 1) bones/19/scale = Vector3(1, 0.999998, 1)
bones/20/position = Vector3(-0.170945, 0.113344, -0.000319591) bones/20/position = Vector3(-0.170945, 0.113344, -0.000221611)
bones/20/rotation = Quaternion(0.995364, -0.0306144, 0.0303641, 0.0859734) bones/20/rotation = Quaternion(0.991901, -0.0327751, 0.0294322, 0.119131)
bones/20/scale = Vector3(1, 1, 1) bones/20/scale = Vector3(1, 1, 1)
bones/21/position = Vector3(-9.67559e-09, 0.227077, -1.42054e-08) bones/21/position = Vector3(-9.67559e-09, 0.227077, -1.42054e-08)
bones/21/rotation = Quaternion(0.35349, -6.90781e-08, 2.46719e-07, 0.935438) bones/21/rotation = Quaternion(0.438174, -6.51914e-08, 3.07249e-07, 0.89889)
bones/21/scale = Vector3(1, 1, 1)
bones/22/position = Vector3(1.60742e-08, 0.149437, 6.9127e-09) bones/22/position = Vector3(1.60742e-08, 0.149437, 6.9127e-09)
bones/22/rotation = Quaternion(-0.5999, 0.112359, -0.0141821, 0.792019) bones/22/rotation = Quaternion(-0.645671, 0.111105, -0.0219987, 0.75517)
bones/22/scale = Vector3(1, 1, 0.999999) bones/22/scale = Vector3(1, 1, 0.999999)
bones/23/position = Vector3(6.94013e-09, 0.16565, 2.44373e-08) bones/23/position = Vector3(6.94013e-09, 0.16565, 2.44373e-08)
bones/23/rotation = Quaternion(-8.80789e-05, 0.920215, -0.391413, 2.01305e-05) bones/23/rotation = Quaternion(-8.80708e-05, 0.920215, -0.391413, 2.01284e-05)
bones/23/scale = Vector3(1, 0.999998, 1) bones/23/scale = Vector3(1, 0.999998, 1)
bones/24/position = Vector3(0.170945, 0.292331, 0.575833) bones/24/position = Vector3(0.170945, 0.292327, 0.575829)
bones/24/rotation = Quaternion(0.707107, -2.25334e-07, -5.00237e-08, 0.707107) bones/24/rotation = Quaternion(0.707107, -2.25334e-07, -5.00237e-08, 0.707107)
bones/24/scale = Vector3(1, 1, 1) bones/24/scale = Vector3(1, 1, 1)
bones/25/position = Vector3(0.201736, 0.0279163, 0.2083) bones/25/position = Vector3(0.201736, 0.027845, 0.207788)
bones/25/rotation = Quaternion(-0.709423, -7.23541e-08, -7.28499e-08, 0.704783) bones/25/rotation = Quaternion(-0.709033, -7.23962e-08, -7.28047e-08, 0.705175)
bones/25/scale = Vector3(1, 1, 1) bones/25/scale = Vector3(1, 1, 1)
bones/26/position = Vector3(-7.49557e-10, 0.362833, -6.70081e-10) bones/26/position = Vector3(-7.49557e-10, 0.362833, -6.70081e-10)
bones/26/rotation = Quaternion(-7.43883e-08, 1.36633e-08, 0.986123, -0.166014) bones/26/rotation = Quaternion(-7.43883e-08, 1.36633e-08, 0.986123, -0.166014)
bones/27/position = Vector3(-4.34108e-08, 0.213436, -1.24871e-08) bones/27/position = Vector3(-4.34108e-08, 0.213436, -1.24871e-08)
bones/27/rotation = Quaternion(-1.33535e-07, 0.391084, 0.920355, 2.11962e-08) bones/27/rotation = Quaternion(-1.33533e-07, 0.391084, 0.920355, 2.11989e-08)
bones/27/scale = Vector3(1, 1, 1) bones/27/scale = Vector3(1, 1, 1)
bones/28/position = Vector3(2.49135e-08, 0.16565, 4.15134e-10) bones/28/position = Vector3(2.49135e-08, 0.16565, 4.15134e-10)
bones/28/rotation = Quaternion(-0.391084, -1.9452e-08, -4.71066e-08, 0.920355) bones/28/rotation = Quaternion(-0.391084, -1.9452e-08, -4.71066e-08, 0.920355)
bones/28/scale = Vector3(1, 1, 1) bones/28/scale = Vector3(1, 1, 1)
bones/29/position = Vector3(4.40738e-08, 0.16565, -1.00732e-08) bones/29/position = Vector3(4.40738e-08, 0.16565, -1.00732e-08)
bones/29/rotation = Quaternion(1, -1.43484e-08, 1.98699e-07, -1.03499e-07) bones/29/rotation = Quaternion(1, -1.43484e-08, 1.98699e-07, -1.03499e-07)
bones/29/scale = Vector3(1, 1, 1)
bones/30/position = Vector3(-1.01971e-08, 1.4023e-08, -1.90554e-08) bones/30/position = Vector3(-1.01971e-08, 1.4023e-08, -1.90554e-08)
bones/30/rotation = Quaternion(4.02062e-08, -6.75534e-12, -1.77594e-08, 1) bones/30/rotation = Quaternion(4.02062e-08, -6.75534e-12, -1.77594e-08, 1)
bones/31/position = Vector3(-0.170945, 0.292331, 0.575833) bones/31/position = Vector3(-0.170945, 0.292327, 0.575829)
bones/31/rotation = Quaternion(0.707107, -3.427e-08, 1.4104e-07, 0.707107) bones/31/rotation = Quaternion(0.707107, -3.427e-08, 1.4104e-07, 0.707107)
bones/31/scale = Vector3(1, 1, 1) bones/31/scale = Vector3(1, 1, 1)
bones/32/position = Vector3(-0.170945, 0.0251776, 0.240861) bones/32/position = Vector3(-0.170945, 0.0252633, 0.241364)
bones/32/rotation = Quaternion(-0.702797, -7.3091e-08, -7.21125e-08, 0.711391) bones/32/rotation = Quaternion(-0.703198, -7.30473e-08, -7.21461e-08, 0.710994)
bones/32/scale = Vector3(1, 1, 1) bones/32/scale = Vector3(1, 1, 1)
bones/33/position = Vector3(1.23156e-08, 0.362833, -3.27995e-10) bones/33/position = Vector3(1.23156e-08, 0.362833, -3.27995e-10)
bones/33/rotation = Quaternion(-9.3501e-08, -8.30957e-09, 0.994956, 0.100307) bones/33/rotation = Quaternion(-9.3501e-08, -8.30957e-09, 0.994956, 0.100307)
bones/34/position = Vector3(-2.94849e-09, 0.213436, -1.62925e-08) bones/34/position = Vector3(-2.94849e-09, 0.213436, -1.62925e-08)
bones/34/rotation = Quaternion(-1.46964e-07, 0.391084, 0.920355, 2.40273e-08) bones/34/rotation = Quaternion(-1.4697e-07, 0.391084, 0.920355, 2.4034e-08)
bones/34/scale = Vector3(1, 1, 1) bones/34/scale = Vector3(1, 1, 1)
bones/35/position = Vector3(-8.78417e-09, 0.16565, 1.69807e-08) bones/35/position = Vector3(-8.78417e-09, 0.16565, 1.69807e-08)
bones/35/rotation = Quaternion(-0.391084, -3.11633e-08, -5.80803e-08, 0.920355) bones/35/rotation = Quaternion(-0.391084, -3.11633e-08, -5.80803e-08, 0.920355)
bones/35/scale = Vector3(1, 1, 1) bones/35/scale = Vector3(1, 1, 1)
bones/36/position = Vector3(6.05823e-09, 0.16565, 1.15316e-08) bones/36/position = Vector3(6.05823e-09, 0.16565, 1.15316e-08)
bones/36/rotation = Quaternion(1, -1.43787e-09, 1.9332e-07, -8.73225e-08) bones/36/rotation = Quaternion(1, -1.43787e-09, 1.9332e-07, -8.73225e-08)
bones/36/scale = Vector3(1, 1, 1)
bones/37/position = Vector3(4.5566e-09, -3.13355e-09, -5.74337e-09) bones/37/position = Vector3(4.5566e-09, -3.13355e-09, -5.74337e-09)
bones/37/rotation = Quaternion(-6.66488e-10, 8.29075e-12, -1.77544e-08, 1) bones/37/rotation = Quaternion(-6.66488e-10, 8.29075e-12, -1.77544e-08, 1)
bones/37/scale = Vector3(1, 1, 1)
bones/38/position = Vector3(0.453379, 1.10355, -0.593026) bones/38/position = Vector3(0.453379, 1.10355, -0.593026)
bones/38/rotation = Quaternion(-0.707107, 6.4707e-05, 6.4707e-05, 0.707107) bones/38/rotation = Quaternion(-0.707107, 6.4707e-05, 6.4707e-05, 0.707107)
bones/39/position = Vector3(0.520733, 0.772673, -0.0592629) bones/39/position = Vector3(0.520733, 0.77053, -0.0592629)
bones/39/rotation = Quaternion(0.795616, 0.00380772, 0.605784, 0.00243902) bones/39/rotation = Quaternion(0.795616, 0.00380772, 0.605784, 0.00243902)
bones/39/scale = Vector3(1, 1, 1) bones/39/scale = Vector3(1, 1, 1)
bones/40/position = Vector3(-0.45384, 1.10345, -0.592593) bones/40/position = Vector3(-0.45384, 1.10345, -0.592593)
bones/40/rotation = Quaternion(-0.707107, 6.4707e-05, 6.4707e-05, 0.707107) bones/40/rotation = Quaternion(-0.707107, 6.4707e-05, 6.4707e-05, 0.707107)
bones/41/position = Vector3(-0.510811, 0.773125, 0.0633181) bones/41/position = Vector3(-0.510811, 0.770982, 0.0633181)
bones/41/rotation = Quaternion(-0.762388, 0.00756036, 0.647063, -0.00406019) bones/41/rotation = Quaternion(-0.762388, 0.00756036, 0.647063, -0.00406019)
bones/41/scale = Vector3(1, 1, 1)
[node name="Skeleton_Warrior_Helmet" parent="Rig/Skeleton3D" index="0"] [node name="Skeleton_Warrior_Helmet" parent="Rig/Skeleton3D" index="0"]
transform = Transform3D(0.999526, -0.00142252, 0.030764, 0.00146174, 0.999998, -0.00125251, -0.0307621, 0.00129688, 0.999526, -0.000553359, 1.19319, 8.46903e-05) transform = Transform3D(0.999526, -0.00144411, 0.0307548, 0.00148443, 0.999998, -0.00128816, -0.0307529, 0.0013332, 0.999526, -0.000550446, 1.18015, 9.1196e-05)
[node name="AnimationTree" type="AnimationTree" parent="." index="4"] [node name="AnimationTree" type="AnimationTree" parent="." index="4"]
tree_root = SubResource("AnimationNodeStateMachine_7v7qh") tree_root = SubResource("AnimationNodeStateMachine_7v7qh")
anim_player = NodePath("../AnimationPlayer") anim_player = NodePath("../AnimationPlayer")
parameters/current_length = 1.04167 parameters/current_length = 1.04167
parameters/current_position = 0.849599 parameters/current_position = 0.62703
parameters/current_delta = 0.0166667 parameters/current_delta = 0.0166667
parameters/conditions/grounded = false parameters/conditions/grounded = false
parameters/conditions/jumping = false parameters/conditions/jumping = false
@ -295,11 +310,11 @@ parameters/Hit_B/current_length = 0.833333
parameters/Hit_B/current_position = 0.833333 parameters/Hit_B/current_position = 0.833333
parameters/Hit_B/current_delta = 0.0175824 parameters/Hit_B/current_delta = 0.0175824
parameters/IWR/current_length = 1.04167 parameters/IWR/current_length = 1.04167
parameters/IWR/current_position = 0.849599 parameters/IWR/current_position = 0.62703
parameters/IWR/current_delta = 0.0166667 parameters/IWR/current_delta = 0.0166667
parameters/IWR/blend_position = Vector2(0.000524879, -0.0137615) parameters/IWR/blend_position = Vector2(0.000524879, -0.0137615)
parameters/IWR/0/current_length = 1.04167 parameters/IWR/0/current_length = 1.04167
parameters/IWR/0/current_position = 0.849599 parameters/IWR/0/current_position = 0.62703
parameters/IWR/0/current_delta = 0.0166667 parameters/IWR/0/current_delta = 0.0166667
parameters/IWR/1/current_length = 0.791667 parameters/IWR/1/current_length = 0.791667
parameters/IWR/1/current_position = 0.708259 parameters/IWR/1/current_position = 0.708259
@ -308,7 +323,7 @@ parameters/IWR/2/current_length = 1.04167
parameters/IWR/2/current_position = 1.04167 parameters/IWR/2/current_position = 1.04167
parameters/IWR/2/current_delta = 0.0 parameters/IWR/2/current_delta = 0.0
parameters/IWR/3/current_length = 0.791667 parameters/IWR/3/current_length = 0.791667
parameters/IWR/3/current_position = 0.68293 parameters/IWR/3/current_position = 0.293691
parameters/IWR/3/current_delta = 0.0166667 parameters/IWR/3/current_delta = 0.0166667
parameters/IWR/4/current_length = 0.791667 parameters/IWR/4/current_length = 0.791667
parameters/IWR/4/current_position = 0.390352 parameters/IWR/4/current_position = 0.390352

@ -67,3 +67,9 @@ block={
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(108, 13),"global_position":Vector2(112, 54),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null) "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(108, 13),"global_position":Vector2(112, 54),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
] ]
} }
[layer_names]
3d_physics/layer_1="objects"
3d_physics/layer_2="hitboxes"
3d_physics/layer_3="player"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -27018,6 +27018,11 @@ _subresources={
"slice_99/start_frame": 0, "slice_99/start_frame": 0,
"slices/amount": 0 "slices/amount": 0
} }
},
"nodes": {
"PATH:Rig/Skeleton3D": {
"rest_pose/external_animation_library": null
}
} }
} }
fbx/importer=0 fbx/importer=0

@ -6,10 +6,10 @@
[ext_resource type="PackedScene" uid="uid://dtehhqrqtplan" path="res://packed-scenes/knight.tscn" id="7_iwqlu"] [ext_resource type="PackedScene" uid="uid://dtehhqrqtplan" path="res://packed-scenes/knight.tscn" id="7_iwqlu"]
[ext_resource type="MeshLibrary" uid="uid://dje66fxvu4hnm" path="res://resources/floors_mesh_library.tres" id="7_pv7jr"] [ext_resource type="MeshLibrary" uid="uid://dje66fxvu4hnm" path="res://resources/floors_mesh_library.tres" id="7_pv7jr"]
[ext_resource type="PackedScene" uid="uid://dif2kboftacra" path="res://packed-scenes/torch_mounted.tscn" id="8_8d1n4"] [ext_resource type="PackedScene" uid="uid://dif2kboftacra" path="res://packed-scenes/torch_mounted.tscn" id="8_8d1n4"]
[ext_resource type="PackedScene" uid="uid://670weiu5lj4u" path="res://packed-scenes/skeleton_warrior_new.tscn" id="8_b6x6f"]
[ext_resource type="PackedScene" uid="uid://d1vowjv6aed2s" path="res://packed-scenes/ui.tscn" id="9_ah8u8"] [ext_resource type="PackedScene" uid="uid://d1vowjv6aed2s" path="res://packed-scenes/ui.tscn" id="9_ah8u8"]
[ext_resource type="MeshLibrary" uid="uid://bs0yqy7xhugol" path="res://resources/level_mesh_library.tres" id="9_dr0le"] [ext_resource type="MeshLibrary" uid="uid://bs0yqy7xhugol" path="res://resources/level_mesh_library.tres" id="9_dr0le"]
[ext_resource type="Material" uid="uid://dmiddiyswbqqx" path="res://resources/material/TCom_Sand_Muddy2.tres" id="10_0dqj1"] [ext_resource type="Material" uid="uid://dmiddiyswbqqx" path="res://resources/material/TCom_Sand_Muddy2.tres" id="10_0dqj1"]
[ext_resource type="PackedScene" uid="uid://cjxeovwundmud" path="res://packed-scenes/skeleton_warrior.tscn" id="10_fdhx7"]
[sub_resource type="NavigationMesh" id="NavigationMesh_3mbqm"] [sub_resource type="NavigationMesh" id="NavigationMesh_3mbqm"]
vertices = PackedVector3Array(-21.5, 0.4, 13.5, -16, 0.4, 13.5, -16, 0.4, 10.75, -21.5, 0.4, 13.5, -16, 0.4, 10.75, -15.25, 0.4, 10, -13, 0.4, 2, -14, 0.4, 1.5, -21.5, 0.4, -1.5, -14, 0.4, 1.5, -14, 0.4, -1.5, -21.5, 0.4, -1.5, -15.25, 0.4, 10, -13, 0.4, 10, -13, 0.4, 2, -12, 0.4, -1.5, -12, 0.4, 0, 14, 0.4, 0, 14, 0.4, -1.5, 18, 0.4, 10.75, 18, 0.4, 13.5, 20, 0.4, 13.5, 17.5, 0.4, 10, 18, 0.4, 10.75, 20, 0.4, 13.5, 20.25, 0.4, -1.5, 16, 0.4, 1.5, 15.5, 0.4, 2, 20.25, 0.4, -1.5, 16, 0.4, -1.5, 16, 0.4, 1.5, -13, 0.4, 10, 17.5, 0.4, 10, 15.5, 0.4, 2, -13, 0.4, 2, -14, 0.4, 12, -14, 0.4, 13.5, 16, 0.4, 13.5, 16, 0.4, 12) vertices = PackedVector3Array(-21.5, 0.4, 13.5, -16, 0.4, 13.5, -16, 0.4, 10.75, -21.5, 0.4, 13.5, -16, 0.4, 10.75, -15.25, 0.4, 10, -13, 0.4, 2, -14, 0.4, 1.5, -21.5, 0.4, -1.5, -14, 0.4, 1.5, -14, 0.4, -1.5, -21.5, 0.4, -1.5, -15.25, 0.4, 10, -13, 0.4, 10, -13, 0.4, 2, -12, 0.4, -1.5, -12, 0.4, 0, 14, 0.4, 0, 14, 0.4, -1.5, 18, 0.4, 10.75, 18, 0.4, 13.5, 20, 0.4, 13.5, 17.5, 0.4, 10, 18, 0.4, 10.75, 20, 0.4, 13.5, 20.25, 0.4, -1.5, 16, 0.4, 1.5, 15.5, 0.4, 2, 20.25, 0.4, -1.5, 16, 0.4, -1.5, 16, 0.4, 1.5, -13, 0.4, 10, 17.5, 0.4, 10, 15.5, 0.4, 2, -13, 0.4, 2, -14, 0.4, 12, -14, 0.4, 13.5, 16, 0.4, 13.5, 16, 0.4, 12)
@ -46,11 +46,6 @@ unit_name = "Player"
speed = 8.0 speed = 8.0
acceleration = 8.0 acceleration = 8.0
[node name="Skeleton_Warrior_new" parent="." node_paths=PackedStringArray("player") instance=ExtResource("8_b6x6f")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 20, 1, 6)
player = NodePath("../Player")
unit_name = "Skeleton_Warrior"
[node name="torch_mounted" parent="." instance=ExtResource("8_8d1n4")] [node name="torch_mounted" parent="." instance=ExtResource("8_8d1n4")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.03394, 2.9024, 1.25148) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.03394, 2.9024, 1.25148)
@ -104,3 +99,7 @@ mesh = SubResource("PlaneMesh_7a7yt")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Ground/StaticBody3D"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Ground/StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_cumsm") shape = SubResource("ConcavePolygonShape3D_cumsm")
[node name="Skeleton_Warrior" parent="." node_paths=PackedStringArray("player") instance=ExtResource("10_fdhx7")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 18, 1, 5)
player = NodePath("../Player")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -8,7 +8,7 @@
[ext_resource type="PackedScene" uid="uid://cvsx5ruh4jy7b" path="res://packed-scenes/zombie_a.tscn" id="5_20dtm"] [ext_resource type="PackedScene" uid="uid://cvsx5ruh4jy7b" path="res://packed-scenes/zombie_a.tscn" id="5_20dtm"]
[ext_resource type="PackedScene" uid="uid://dtishjt1o2r2y" path="res://packed-scenes/zombie_c.tscn" id="6_mkx4u"] [ext_resource type="PackedScene" uid="uid://dtishjt1o2r2y" path="res://packed-scenes/zombie_c.tscn" id="6_mkx4u"]
[ext_resource type="PackedScene" uid="uid://dtehhqrqtplan" path="res://packed-scenes/knight.tscn" id="7_u2hik"] [ext_resource type="PackedScene" uid="uid://dtehhqrqtplan" path="res://packed-scenes/knight.tscn" id="7_u2hik"]
[ext_resource type="PackedScene" uid="uid://670weiu5lj4u" path="res://packed-scenes/skeleton_warrior_new.tscn" id="8_rn4yx"] [ext_resource type="PackedScene" uid="uid://670weiu5lj4u" path="res://packed-scenes/skeleton_warrior_old.tscn" id="8_rn4yx"]
[sub_resource type="PlaneMesh" id="PlaneMesh_473ws"] [sub_resource type="PlaneMesh" id="PlaneMesh_473ws"]
material = ExtResource("3_w0uw1") material = ExtResource("3_w0uw1")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -10,6 +10,7 @@ var attacks := ["Unarmed_Melee_Attack_Punch_A","Unarmed_Melee_Attack_Punch_A 2",
@onready var nav_agent: NavigationAgent3D = $NavigationAgent3D @onready var nav_agent: NavigationAgent3D = $NavigationAgent3D
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
if player == null: return
if player.dead: return if player.dead: return
var distance = global_position.distance_to(player.global_position) var distance = global_position.distance_to(player.global_position)
#print(distance) #print(distance)
@ -45,4 +46,4 @@ func _on_animation_tree_animation_started(anim_name: StringName) -> void:
func _on_animation_tree_animation_finished(anim_name: StringName) -> void: func _on_animation_tree_animation_finished(anim_name: StringName) -> void:
if attacks.has(anim_name): if attacks.has(anim_name):
player.get_damage(damage) player.take_damage(damage)

@ -1,7 +1,7 @@
extends Node2D extends Node2D
@onready var name_label: Label = $SubViewport/Name @onready var name_label: Label = $SubViewport/Name
@onready var health_bar: TextureProgressB = $SubViewport/Healthar @onready var health_bar: TextureProgressBar = $SubViewport/Healthar
@onready var stamina_bar: TextureProgressBar = $SubViewport/Stamina @onready var stamina_bar: TextureProgressBar = $SubViewport/Stamina
@export var enemy: Enemy @export var enemy: Enemy

@ -0,0 +1,11 @@
class_name HitBox
extends Area3D
@onready var unit: Unit = $"../../../../.."
func _init() -> void:
collision_layer = 2
collision_mask = 0
func get_damage() -> int:
return unit.damage

@ -0,0 +1,14 @@
class_name HurtBox
extends Area3D
func _init() -> void:
collision_layer = 0
collision_mask = 2
func _ready() -> void:
connect("area_entered", _on_area_entered)
func _on_area_entered(hitbox: HitBox) -> void:
if hitbox == null: return
if owner.has_method("take_damage"):
owner.take_damage(hitbox.get_damage())

@ -45,13 +45,12 @@ func _process(delta: float) -> void:
stamina_changed.emit(stamina, maximum_stamina) stamina_changed.emit(stamina, maximum_stamina)
stamina_timer = 0 stamina_timer = 0
func get_damage(damage: int) -> void: func take_damage(damage_amount: int) -> void:
anim_state.travel(hits.pick_random()) health -= damage_amount
health -= damage
clampi(health, 0, maximum_health) clampi(health, 0, maximum_health)
health_changed.emit(health, maximum_health) health_changed.emit(health, maximum_health)
if health <= 0: anim_state.travel(hits.pick_random())
die() if health <= 0: die()
func enough_stamina_available(stamina_needed: int) -> bool: func enough_stamina_available(stamina_needed: int) -> bool:
return stamina_needed <= stamina return stamina_needed <= stamina