100 lines
4.5 KiB
Text
100 lines
4.5 KiB
Text
[gd_scene format=3 uid="uid://dqlqgk1veyos8"]
|
|
|
|
[ext_resource type="PackedScene" uid="uid://crtgy2rph5to2" path="res://assets/models/enemies/model_scenes/wretched.tscn" id="1_qot2n"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_qot2n"]
|
|
script/source = "extends EnemyWretched
|
|
|
|
@export var difficulty_weight : float = 0.1
|
|
|
|
var is_dead := false
|
|
|
|
func on_death() -> void:
|
|
%StateMachine.switch_to_state(null)
|
|
%NavigationAgent3D.process_mode = Node.PROCESS_MODE_DISABLED
|
|
$CollisionShape3D.disabled = true
|
|
set_movement_direction(Vector2())
|
|
|
|
func _on_health_status_death() -> void:
|
|
$wretched/AnimationPlayer.play(\"death\")
|
|
get_unit().region.raise_difficulty(difficulty_weight)
|
|
on_death.call_deferred()
|
|
is_dead = true
|
|
|
|
func _enter_tree() -> void:
|
|
if is_dead and $wretched/AnimationPlayer.current_animation != \"death\":
|
|
$wretched/AnimationPlayer.play.call_deferred(\"death\")
|
|
$wretched/AnimationPlayer.advance.call_deferred(INF)
|
|
elif is_dead:
|
|
$wretched/AnimationPlayer.play.call_deferred(\"death\")
|
|
"
|
|
|
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ng1ul"]
|
|
radius = 0.2578125
|
|
|
|
[node name="EnemyWretched" type="EnemyWretched" unique_id=2042600475]
|
|
slide_on_ceiling = false
|
|
wall_min_slide_angle = 0.0
|
|
floor_max_angle = 0.9773844
|
|
script = SubResource("GDScript_qot2n")
|
|
difficulty_weight = 0.15
|
|
|
|
[node name="wretched" parent="." unique_id=1505510221 instance=ExtResource("1_qot2n")]
|
|
|
|
[node name="Body" parent="wretched/Character/Skeleton3D" parent_id_path=PackedInt32Array(1505510221, 355963281) index="0" unique_id=1561023907]
|
|
gi_mode = 0
|
|
|
|
[node name="club" parent="wretched/Character/Skeleton3D" parent_id_path=PackedInt32Array(1505510221, 355963281) index="1" unique_id=637269416]
|
|
gi_mode = 0
|
|
|
|
[node name="Hitbox" parent="wretched/Character/Skeleton3D" parent_id_path=PackedInt32Array(1505510221, 355963281) index="2" unique_id=333008962 node_paths=PackedStringArray("health")]
|
|
health = NodePath("../../../../HealthStatus")
|
|
|
|
[node name="CollisionShape3D2" parent="wretched/Character/Skeleton3D/Hitbox" index="0" unique_id=602827216]
|
|
transform = Transform3D(1, 6.8945504e-21, 0, 6.2038546e-25, 1.0000037, 0, 0, 0, 1.0000037, -2.2362435e-16, 0.35283393, -0.013339132)
|
|
debug_color = Color(0.32837027, 0.6238601, 0, 0.41960785)
|
|
|
|
[node name="Hitbox" parent="wretched/Character/Skeleton3D/SpineAttach" parent_id_path=PackedInt32Array(1505510221, 1651916591) index="0" unique_id=1070250681 node_paths=PackedStringArray("health")]
|
|
health = NodePath("../../../../../HealthStatus")
|
|
|
|
[node name="CollisionShape3D" parent="wretched/Character/Skeleton3D/SpineAttach/Hitbox" index="0" unique_id=1643914600]
|
|
debug_color = Color(4.0189175e-06, 0.64973146, 0.14424223, 0.41960785)
|
|
|
|
[node name="Hitbox" parent="wretched/Character/Skeleton3D/HeadAttach" parent_id_path=PackedInt32Array(1505510221, 1057907260) index="0" unique_id=1188667481 node_paths=PackedStringArray("health")]
|
|
health = NodePath("../../../../../HealthStatus")
|
|
damage_modifier = 4.0
|
|
|
|
[node name="CollisionShape3D" parent="wretched/Character/Skeleton3D/HeadAttach/Hitbox" index="0" unique_id=1923399941]
|
|
transform = Transform3D(1.0000024, -1.4661055e-09, 2.3283064e-09, 6.548362e-11, 0.9999224, 0.013243848, 4.0745363e-09, -0.013244033, 0.9999193, -4.656613e-10, 1.3035285, -0.014328403)
|
|
debug_color = Color(0, 0.64368725, 0.30114147, 0.41960785)
|
|
|
|
[node name="CollisionShape3D" parent="wretched/Character/Skeleton3D/BoneAttachment3D/DamageBox" parent_id_path=PackedInt32Array(1505510221, 51031781) index="0" unique_id=1793068779]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.2553203, 0.010501024, -0.009188678)
|
|
debug_color = Color(0.98584324, 0, 0.3343837, 0.41960785)
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=117412966]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|
shape = SubResource("CapsuleShape3D_ng1ul")
|
|
|
|
[node name="StateMachine" type="StateMachine" parent="." unique_id=130345628]
|
|
unique_name_in_owner = true
|
|
|
|
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="." unique_id=1751288447]
|
|
unique_name_in_owner = true
|
|
simplify_path = true
|
|
simplify_epsilon = 0.647
|
|
avoidance_enabled = true
|
|
neighbor_distance = 10.0
|
|
time_horizon_agents = 0.7
|
|
|
|
[node name="PlayerDetector" type="PlayerDetector" parent="." unique_id=592530198]
|
|
unique_name_in_owner = true
|
|
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 1.5103652, 0)
|
|
|
|
[node name="HealthStatus" type="HealthStatus" parent="." unique_id=625738980]
|
|
unique_name_in_owner = true
|
|
health = 3
|
|
|
|
[connection signal="death" from="HealthStatus" to="." method="_on_health_status_death"]
|
|
|
|
[editable path="wretched"]
|