feat: player hurt sequence & animation changes
This commit is contained in:
parent
41f16daf78
commit
85f17d6bab
5 changed files with 50 additions and 21 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -3,7 +3,7 @@ extends BehaviourAction
|
|||
@export var attack_name := "jab_1"
|
||||
|
||||
@onready var body := owner
|
||||
@onready var anim := %AnimationPlayer as AnimationPlayer
|
||||
@onready var anim : AnimationPlayer = get_behaviour_tree().get_node("%AnimationPlayer") as AnimationPlayer
|
||||
|
||||
var anim_started := false
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@
|
|||
[sub_resource type="GDScript" id="GDScript_eqqp1"]
|
||||
script/source = "extends CharacterBody3D
|
||||
|
||||
var attack_queued := false
|
||||
var attack_queued : bool = false
|
||||
var hurt_high : bool = false
|
||||
|
||||
func _physics_process(delta: float):
|
||||
var root_velocity : Vector3 = $AnimationPlayer.get_root_motion_position() / delta
|
||||
var root_velocity : Vector3 = %AnimationPlayer.get_root_motion_position() / delta
|
||||
velocity = (global_basis.x * root_velocity.x + global_basis.z * root_velocity.z)
|
||||
move_and_slide()
|
||||
|
||||
|
|
@ -20,6 +21,19 @@ func _unhandled_input(event : InputEvent):
|
|||
get_viewport().set_input_as_handled()
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_nmc1l"]
|
||||
script/source = "extends BehaviourAction
|
||||
|
||||
@onready var body := get_behaviour_tree().get_parent() as CharacterBody3D
|
||||
|
||||
func _execute() -> int:
|
||||
if body.hurt_high:
|
||||
body.hurt_high = false
|
||||
return Success
|
||||
else:
|
||||
return Fail
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_ykyjo"]
|
||||
resource_name = "PlayerMovement"
|
||||
script/source = "extends BehaviourAction
|
||||
|
|
@ -27,8 +41,8 @@ script/source = "extends BehaviourAction
|
|||
var max_rotation_per_second : float = 15
|
||||
|
||||
var input : Vector2 = Vector2()
|
||||
@onready var body : CharacterBody3D = owner as CharacterBody3D
|
||||
@onready var anim := %AnimationPlayer
|
||||
@onready var body : CharacterBody3D = get_behaviour_tree().get_parent() as CharacterBody3D
|
||||
@onready var anim := get_behaviour_tree().get_node(\"%AnimationPlayer\") as AnimationPlayer
|
||||
|
||||
func _unhandled_input(event : InputEvent):
|
||||
if event.is_action(\"move_forward\") or event.is_action(\"move_back\"):
|
||||
|
|
@ -57,7 +71,7 @@ resource_name = "PlayerIdle"
|
|||
script/source = "extends BehaviourAction
|
||||
|
||||
func _execute() -> int:
|
||||
%AnimationPlayer.play(\"ready\", .1)
|
||||
get_behaviour_tree().get_node(\"%AnimationPlayer\").play(\"ready\", .1)
|
||||
(owner as CharacterBody3D).velocity = Vector3()
|
||||
return Success
|
||||
"
|
||||
|
|
@ -65,10 +79,13 @@ func _execute() -> int:
|
|||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_eqqp1"]
|
||||
radius = 0.30371094
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_uxov2"]
|
||||
albedo_color = Color(0.5254902, 0.69411767, 1, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_uxov2"]
|
||||
size = Vector3(0.33496094, 0.4033203, 0.26367188)
|
||||
|
||||
[node name="bot" unique_id=807930453 instance=ExtResource("1_eqqp1")]
|
||||
[node name="bot" unique_id=1222178058 instance=ExtResource("1_eqqp1")]
|
||||
script = SubResource("GDScript_eqqp1")
|
||||
|
||||
[node name="BehaviourTree" type="BehaviourTree" parent="." index="0" unique_id=2108584329]
|
||||
|
|
@ -77,32 +94,41 @@ script = SubResource("GDScript_eqqp1")
|
|||
|
||||
[node name="BehaviourSelector" type="BehaviourSelector" parent="BehaviourTree/BehaviourRepeater" index="0" unique_id=1931421694]
|
||||
|
||||
[node name="SequenceJabChain" type="BehaviourSequence" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector" index="0" unique_id=637026832]
|
||||
[node name="SequenceHitHigh" type="BehaviourSequence" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector" index="0" unique_id=649050605]
|
||||
|
||||
[node name="WasHurt" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceHitHigh" index="0" unique_id=1391609239]
|
||||
script = SubResource("GDScript_nmc1l")
|
||||
|
||||
[node name="HurtHighAnim" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceHitHigh" index="1" unique_id=425114947]
|
||||
script = ExtResource("2_ykyjo")
|
||||
attack_name = "stagger_high"
|
||||
|
||||
[node name="SequenceJabChain" type="BehaviourSequence" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector" index="1" unique_id=637026832]
|
||||
|
||||
[node name="JabInput" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="0" unique_id=215816583]
|
||||
script = ExtResource("2_uxov2")
|
||||
|
||||
[node name="Jab" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="1" unique_id=486339280]
|
||||
[node name="Jab1Anim" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="1" unique_id=486339280]
|
||||
script = ExtResource("2_ykyjo")
|
||||
|
||||
[node name="JabInput2" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="2" unique_id=1083914312]
|
||||
script = ExtResource("2_uxov2")
|
||||
|
||||
[node name="Jab2" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="3" unique_id=1010781881]
|
||||
[node name="Jab2Anim" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="3" unique_id=1010781881]
|
||||
script = ExtResource("2_ykyjo")
|
||||
attack_name = "jab_2"
|
||||
|
||||
[node name="JabInput3" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="4" unique_id=583017375]
|
||||
script = ExtResource("2_uxov2")
|
||||
|
||||
[node name="Jab3" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="5" unique_id=217672683]
|
||||
[node name="Hook1Anim" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector/SequenceJabChain" index="5" unique_id=217672683]
|
||||
script = ExtResource("2_ykyjo")
|
||||
attack_name = "hook_1"
|
||||
|
||||
[node name="Movement" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector" index="1" unique_id=838466796]
|
||||
[node name="Movement" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector" index="2" unique_id=838466796]
|
||||
script = SubResource("GDScript_ykyjo")
|
||||
|
||||
[node name="Idle" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector" index="2" unique_id=878625744]
|
||||
[node name="Idle" type="BehaviourAction" parent="BehaviourTree/BehaviourRepeater/BehaviourSelector" index="3" unique_id=878625744]
|
||||
script = SubResource("GDScript_uxov2")
|
||||
|
||||
[node name="PhysicsShape" type="CollisionShape3D" parent="." index="1" unique_id=1611683515]
|
||||
|
|
@ -110,7 +136,10 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|||
shape = SubResource("CapsuleShape3D_eqqp1")
|
||||
debug_color = Color(0, 0.6, 0.69803923, 1)
|
||||
|
||||
[node name="HandR" type="BoneAttachment3D" parent="Character/Skeleton3D" parent_id_path=PackedInt32Array(1974662018) index="1" unique_id=385862689]
|
||||
[node name="Mesh" parent="Character/Skeleton3D" parent_id_path=PackedInt32Array(1717786181) index="0" unique_id=154641310]
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_uxov2")
|
||||
|
||||
[node name="HandR" type="BoneAttachment3D" parent="Character/Skeleton3D" parent_id_path=PackedInt32Array(1717786181) index="1" unique_id=385862689]
|
||||
transform = Transform3D(0.015967373, -0.083946444, 0.9963424, -0.17989334, -0.98045003, -0.07972447, 0.9835564, -0.17796235, -0.030756809, 0.27221423, 0.7951686, 0.024477992)
|
||||
bone_name = "hand.r"
|
||||
bone_idx = 10
|
||||
|
|
@ -118,11 +147,11 @@ bone_idx = 10
|
|||
[node name="Area3D" type="Area3D" parent="Character/Skeleton3D/HandR" index="0" unique_id=1170013417]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Character/Skeleton3D/HandR/Area3D" index="0" unique_id=580766922]
|
||||
transform = Transform3D(1.0000031, -3.5762787e-07, 0, -1.1920929e-07, 1.0000023, 4.656613e-10, -5.5879354e-09, 4.90807e-07, 1, 9.432435e-05, 0.09994143, -3.59118e-05)
|
||||
transform = Transform3D(1.0000031, -3.5762787e-07, 1.4210855e-14, -1.1920929e-07, 1.0000023, -1.49011585e-08, -5.5879497e-09, 4.917384e-07, 1, 9.4322706e-05, 0.101888776, -0.010492921)
|
||||
shape = SubResource("BoxShape3D_uxov2")
|
||||
debug_color = Color(0.9966913, 0, 0.17880186, 1)
|
||||
|
||||
[node name="HandL" type="BoneAttachment3D" parent="Character/Skeleton3D" parent_id_path=PackedInt32Array(1974662018) index="2" unique_id=279793409]
|
||||
[node name="HandL" type="BoneAttachment3D" parent="Character/Skeleton3D" parent_id_path=PackedInt32Array(1717786181) index="2" unique_id=279793409]
|
||||
transform = Transform3D(-0.039434362, 0.07924447, -0.9960749, 0.12679999, -0.9883944, -0.083653376, -0.99114394, -0.12960118, 0.028928574, -0.2710728, 0.7714727, 0.0945672)
|
||||
bone_name = "hand.l"
|
||||
bone_idx = 7
|
||||
|
|
@ -130,10 +159,10 @@ bone_idx = 7
|
|||
[node name="Area3D" type="Area3D" parent="Character/Skeleton3D/HandL" index="0" unique_id=552609571]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Character/Skeleton3D/HandL/Area3D" index="0" unique_id=513165671]
|
||||
transform = Transform3D(1.0000169, -1.5944242e-06, -4.04194e-07, 6.556511e-07, 1.0000216, -4.172325e-07, -2.7939663e-08, 8.046625e-07, 1.0000148, -4.815308e-05, 0.09992814, 0.00016999245)
|
||||
transform = Transform3D(1.0000169, -1.5944242e-06, -4.04194e-07, 6.556511e-07, 1.0000216, -4.172325e-07, -2.7939663e-08, 8.046625e-07, 1.0000148, -4.8151425e-05, 0.101875424, -0.010286927)
|
||||
shape = SubResource("BoxShape3D_uxov2")
|
||||
debug_color = Color(0.9966913, 0, 0.17880186, 1)
|
||||
|
||||
[node name="AnimationPlayer" parent="." index="3" unique_id=1761461954]
|
||||
[node name="AnimationPlayer" parent="." index="3" unique_id=1369805121]
|
||||
unique_name_in_owner = true
|
||||
root_motion_track = NodePath("Character/Skeleton3D:root")
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ glow_enabled = true
|
|||
environment = SubResource("Environment_4r7d4")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=169512636]
|
||||
transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0)
|
||||
transform = Transform3D(0.2302671, 0.8427532, -0.48656374, 4.2118103e-08, 0.5, 0.8660255, 0.97312754, -0.19941717, 0.11513353, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="." unique_id=473807903]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.9577711, 0.28753164, 0, -0.28753164, 0.9577711, 0, 12.772846, 37.495686)
|
||||
transform = Transform3D(1, 0, 0, 0, 0.9036031, 0.42837068, 0, -0.42837068, 0.9036031, 1.9073486e-06, 9.186176, 19.605062)
|
||||
fov = 24.81873
|
||||
|
||||
[node name="bot" parent="." unique_id=2030034290 instance=ExtResource("1_upt1h")]
|
||||
[node name="bot" parent="." unique_id=969338301 instance=ExtResource("1_upt1h")]
|
||||
|
||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=1773598072]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue