behaviour-tree-test/project/behaviours/branches/sequence_backstep.tscn

44 lines
1.5 KiB
Text

[gd_scene format=3 uid="uid://bydna58cavo7u"]
[ext_resource type="Script" uid="uid://ywfmsbsdc6s7" path="res://behaviours/select_target.gd" id="1_ps85x"]
[ext_resource type="Script" uid="uid://bp4utstetxnhr" path="res://behaviours/animate.gd" id="2_sri0f"]
[sub_resource type="GDScript" id="GDScript_67pab"]
resource_name = "WantsBackstep"
script/source = "extends BehaviourAction
@onready var body := get_behaviour_tree().get_parent() as CharacterBody3D
func _enter() -> int:
return Success if body.wants_backstep() else Fail
"
[sub_resource type="GDScript" id="GDScript_cqokf"]
resource_name = "ResetStagger"
script/source = "extends BehaviourAction
@onready var body := get_behaviour_tree().get_parent() as CharacterBody3D
func _enter():
body.hurt_high = false
return Success
"
[node name="SequenceBackstep" type="BehaviourSequence" unique_id=2107585033]
[node name="WantsBackstep" type="BehaviourAction" parent="." unique_id=1133030691]
script = SubResource("GDScript_67pab")
[node name="BehaviourAlwaysSuccess" type="BehaviourAlwaysSuccess" parent="." unique_id=124610818]
[node name="SelectTarget" type="BehaviourAction" parent="BehaviourAlwaysSuccess" unique_id=2140246576]
script = ExtResource("1_ps85x")
[node name="PlayBackstep" type="BehaviourAction" parent="." unique_id=151395841]
script = ExtResource("2_sri0f")
anim_name = "backstep"
allow_interrupt = false
face_target = 20.0
[node name="ResetStagger" type="BehaviourAction" parent="." unique_id=865024528]
script = SubResource("GDScript_cqokf")