Adds enemies

This commit is contained in:
Michel 2025-02-01 22:51:01 +01:00
parent cf8ba8bacb
commit 76e5b1927f
324 changed files with 28447 additions and 106 deletions

126
ai/enemy.tres Normal file
View file

@ -0,0 +1,126 @@
[gd_resource type="BehaviorTree" load_steps=28 format=3 uid="uid://db7m2p0at5kmq"]
[sub_resource type="BlackboardPlan" id="BlackboardPlan_aewef"]
var/PlayerDistance/name = &"PlayerDistance"
var/PlayerDistance/type = 3
var/PlayerDistance/value = 0.0
var/PlayerDistance/hint = 0
var/PlayerDistance/hint_string = ""
var/LookingAngleToPlayer/name = &"LookingAngleToPlayer"
var/LookingAngleToPlayer/type = 3
var/LookingAngleToPlayer/value = 0.0
var/LookingAngleToPlayer/hint = 0
var/LookingAngleToPlayer/hint_string = ""
[sub_resource type="BBVariant" id="BBVariant_xy1ol"]
type = 3
saved_value = 20.0
resource_name = "20"
[sub_resource type="BTCheckVar" id="BTCheckVar_7t8wr"]
variable = &"PlayerDistance"
check_type = 1
value = SubResource("BBVariant_xy1ol")
[sub_resource type="BBVariant" id="BBVariant_b57jb"]
type = 3
saved_value = 0.75
resource_name = "0.75"
[sub_resource type="BTCheckVar" id="BTCheckVar_75gjs"]
variable = &"LookingAngleToPlayer"
check_type = 3
value = SubResource("BBVariant_b57jb")
[sub_resource type="BBVariant" id="BBVariant_fnoth"]
type = 1
saved_value = true
resource_name = "true"
[sub_resource type="BBNode" id="BBNode_g13ub"]
saved_value = NodePath("BTPlayer")
resource_name = "BTPlayer"
[sub_resource type="BTCallMethod" id="BTCallMethod_esnfv"]
node = SubResource("BBNode_g13ub")
method = &"setAggressive"
args = Array[BBVariant]([SubResource("BBVariant_fnoth")])
[sub_resource type="BBNode" id="BBNode_33tkl"]
saved_value = NodePath("BTPlayer")
resource_name = "BTPlayer"
[sub_resource type="BTCallMethod" id="BTCallMethod_rf34d"]
node = SubResource("BBNode_33tkl")
method = &"moveToPlayer"
[sub_resource type="BBNode" id="BBNode_qn8c3"]
saved_value = NodePath("BTPlayer")
resource_name = "BTPlayer"
[sub_resource type="BTCallMethod" id="BTCallMethod_1c0iq"]
node = SubResource("BBNode_qn8c3")
method = &"Fire"
[sub_resource type="BTProbability" id="BTProbability_3bm4s"]
run_chance = 0.33
children = [SubResource("BTCallMethod_1c0iq")]
[sub_resource type="BTCooldown" id="BTCooldown_3g17e"]
duration = 5.0
process_pause = true
trigger_on_failure = true
children = [SubResource("BTProbability_3bm4s")]
[sub_resource type="BTAlwaysSucceed" id="BTAlwaysSucceed_5xj25"]
children = [SubResource("BTCooldown_3g17e")]
[sub_resource type="BTSequence" id="BTSequence_wtx4r"]
custom_name = "Enemy Sees Player"
children = [SubResource("BTCheckVar_7t8wr"), SubResource("BTCheckVar_75gjs"), SubResource("BTCallMethod_esnfv"), SubResource("BTCallMethod_rf34d"), SubResource("BTAlwaysSucceed_5xj25")]
[sub_resource type="BBVariant" id="BBVariant_mxhbj"]
type = 1
saved_value = false
resource_name = "false"
[sub_resource type="BBNode" id="BBNode_sh8d3"]
saved_value = NodePath("BTPlayer")
resource_name = "BTPlayer"
[sub_resource type="BTCallMethod" id="BTCallMethod_ns46c"]
node = SubResource("BBNode_sh8d3")
method = &"setAggressive"
args = Array[BBVariant]([SubResource("BBVariant_mxhbj")])
[sub_resource type="BBNode" id="BBNode_dskfg"]
saved_value = NodePath("BTPlayer")
resource_name = "BTPlayer"
[sub_resource type="BTCallMethod" id="BTCallMethod_2jcfh"]
node = SubResource("BBNode_dskfg")
method = &"roam"
[sub_resource type="BTWait" id="BTWait_4jytf"]
duration = 4.0
[sub_resource type="BTSequence" id="BTSequence_wkk7c"]
children = [SubResource("BTCallMethod_2jcfh"), SubResource("BTWait_4jytf")]
[sub_resource type="BTProbability" id="BTProbability_3yptl"]
run_chance = 0.25
children = [SubResource("BTSequence_wkk7c")]
[sub_resource type="BTWait" id="BTWait_xq0e8"]
duration = 4.0
[sub_resource type="BTDynamicSequence" id="BTDynamicSequence_phkns"]
custom_name = "Enemy doesn't see Player, Roaming"
children = [SubResource("BTCallMethod_ns46c"), SubResource("BTProbability_3yptl"), SubResource("BTWait_xq0e8")]
[sub_resource type="BTDynamicSelector" id="BTDynamicSelector_28yhc"]
children = [SubResource("BTSequence_wtx4r"), SubResource("BTDynamicSequence_phkns")]
[resource]
blackboard_plan = SubResource("BlackboardPlan_aewef")
root_task = SubResource("BTDynamicSelector_28yhc")