92 lines
4.2 KiB
Plaintext
92 lines
4.2 KiB
Plaintext
[gd_scene load_steps=4 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 = 10
|
|
|
|
var is_dead := false
|
|
|
|
func on_death() -> void:
|
|
%StateMachine.process_mode = Node.PROCESS_MODE_DISABLED
|
|
%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(1.0 / 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.30615234
|
|
|
|
[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")
|
|
|
|
[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)
|
|
|
|
[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="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)
|
|
|
|
[node name="CollisionShape3D" parent="wretched/Character/Skeleton3D/BoneAttachment3D/DamageBox" parent_id_path=PackedInt32Array(1505510221, 51031781) index="0" unique_id=1793068779]
|
|
transform = Transform3D(1, -9.834766e-07, -2.454035e-06, 1.4305115e-06, 0.9999989, -8.145726e-06, 1.8983264e-06, 7.3344854e-06, 1, -0.20908, -5.9604645e-07, -4.7683716e-07)
|
|
|
|
[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
|
|
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.4599279, 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"]
|