feat: implemented melee attacks for Tank enemy
This commit is contained in:
parent
1021920e1f
commit
a78bbfd3b5
17 changed files with 369 additions and 268 deletions
|
|
@ -1,6 +1,9 @@
|
|||
[gd_resource type="Goal" format=3 uid="uid://b4i4e34046n44"]
|
||||
|
||||
[resource]
|
||||
desired_state_dict = {
|
||||
"goal1": true
|
||||
requirements_dict = {
|
||||
"is_target_enemy": true
|
||||
}
|
||||
desired_state_dict = {
|
||||
"is_target_dead": true
|
||||
}
|
||||
BIN
godot/Animation/bean_characters.res
Normal file
BIN
godot/Animation/bean_characters.res
Normal file
Binary file not shown.
|
|
@ -1,145 +1,10 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://ba17jrcaduowj"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://ba17jrcaduowj"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_va30j"]
|
||||
resource_name = "RESET"
|
||||
length = 0.001
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("MeshInstance3D:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 1, 0)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("MeshInstance3D:rotation")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("MeshInstance3D2:rotation")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0)]
|
||||
}
|
||||
[ext_resource type="Goal" uid="uid://b4i4e34046n44" path="res://AI/defeat_enemy_unit.tres" id="1_b1qo1"]
|
||||
[ext_resource type="AnimationLibrary" uid="uid://crkh5gahl2ci6" path="res://Animation/bean_characters.res" id="2_lrpu6"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_opwhc"]
|
||||
resource_name = "fire"
|
||||
step = 0.01
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.04, 0.14),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381), Vector3(-0.363891, 1.24027, 0.199307), Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"fire_at_target"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_yj5ao"]
|
||||
resource_name = "death"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 1, 0), Vector3(0, 0.495427, 0.341233), Vector3(0, -0.527121, 0.341233)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("MeshInstance3D:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(1.59169, 0, 0)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381), Vector3(-0.363891, 0.0191291, 0.571603), Vector3(-0.363891, -1.00342, 0.571603)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("MeshInstance3D2:rotation")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(1.59169, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_3jmw4"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_va30j"),
|
||||
"death": SubResource("Animation_yj5ao"),
|
||||
"fire_weapon": SubResource("Animation_opwhc")
|
||||
}
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_5pqvg"]
|
||||
radius = 7.38627
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_drlm2"]
|
||||
radius = 1.0
|
||||
|
|
@ -158,17 +23,36 @@ configure_team = 3
|
|||
collision_layer = 6
|
||||
collision_mask = 0
|
||||
|
||||
[node name="ActorWorldState" type="UnitWorldState" parent="."]
|
||||
[node name="ActorWorldState" type="EnemyWorldState" parent="."]
|
||||
editor_available_goals = [ExtResource("1_b1qo1")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Planner" type="Planner" parent="."]
|
||||
actions_inspector = [3, 2, 4]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="EntityHealth" type="EntityHealth" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
path_height_offset = 0.5
|
||||
|
||||
[node name="AwarenessArea" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1216, 3.55442)
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
input_ray_pickable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="AwarenessArea"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.36036)
|
||||
shape = SubResource("SphereShape3D_5pqvg")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_3jmw4")
|
||||
"": ExtResource("2_lrpu6")
|
||||
}
|
||||
|
||||
[node name="Eyes" type="Node3D" parent="."]
|
||||
|
|
@ -179,7 +63,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4512, 0)
|
|||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.31501, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 0.999222, -0.0394342, 0, 0.0394342, 0.999222, 0, 1.01253, 0.443459)
|
||||
shape = SubResource("SphereShape3D_drlm2")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
|
|
|
|||
|
|
@ -1,57 +1,9 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://pme230qx1377"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://pme230qx1377"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_va30j"]
|
||||
resource_name = "RESET"
|
||||
length = 0.001
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
[ext_resource type="AnimationLibrary" uid="uid://crkh5gahl2ci6" path="res://Animation/bean_characters.res" id="1_70627"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_opwhc"]
|
||||
resource_name = "fire"
|
||||
step = 0.01
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.04, 0.14),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381), Vector3(-0.363891, 1.24027, 0.199307), Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"fire_at_target"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_3jmw4"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_va30j"),
|
||||
"fire_weapon": SubResource("Animation_opwhc")
|
||||
}
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_drlm2"]
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_n4q15"]
|
||||
albedo_color = Color(0.407843, 1, 0.447059, 1)
|
||||
|
|
@ -59,9 +11,6 @@ albedo_color = Color(0.407843, 1, 0.447059, 1)
|
|||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_5r0b3"]
|
||||
material = SubResource("StandardMaterial3D_n4q15")
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_drlm2"]
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_p8wvo"]
|
||||
size = Vector3(0.2, 0.2, 0.5)
|
||||
|
||||
|
|
@ -71,19 +20,24 @@ collision_layer = 6
|
|||
collision_mask = 0
|
||||
|
||||
[node name="ActorWorldState" type="UnitWorldState" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Planner" type="Planner" parent="."]
|
||||
actions_inspector = [0, 1, 2]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="EntityHealth" type="EntityHealth" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
path_height_offset = 0.5
|
||||
debug_enabled = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_3jmw4")
|
||||
"": ExtResource("1_70627")
|
||||
}
|
||||
|
||||
[node name="Eyes" type="Node3D" parent="."]
|
||||
|
|
@ -93,14 +47,14 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.49429, 0)
|
|||
[node name="VisionTarget" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.39151, 0)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_5r0b3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("SphereShape3D_drlm2")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_5r0b3")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.363891, 1.24027, 0.471381)
|
||||
mesh = SubResource("BoxMesh_p8wvo")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue