90 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			90 lines
		
	
	
		
			3.5 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.58691406
 | 
						|
 | 
						|
[node name="EnemyWretched" type="EnemyWretched"]
 | 
						|
wall_min_slide_angle = 0.0
 | 
						|
script = SubResource("GDScript_qot2n")
 | 
						|
 | 
						|
[node name="wretched" parent="." instance=ExtResource("1_qot2n")]
 | 
						|
 | 
						|
[node name="Body" parent="wretched/Character/Skeleton3D" index="0"]
 | 
						|
gi_mode = 0
 | 
						|
 | 
						|
[node name="club" parent="wretched/Character/Skeleton3D" index="1"]
 | 
						|
gi_mode = 0
 | 
						|
 | 
						|
[node name="Hitbox" parent="wretched/Character/Skeleton3D" index="2" node_paths=PackedStringArray("health")]
 | 
						|
health = NodePath("../../../../HealthStatus")
 | 
						|
 | 
						|
[node name="CollisionShape3D2" parent="wretched/Character/Skeleton3D/Hitbox" index="0"]
 | 
						|
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" index="0" node_paths=PackedStringArray("health")]
 | 
						|
health = NodePath("../../../../../HealthStatus")
 | 
						|
 | 
						|
[node name="Hitbox" parent="wretched/Character/Skeleton3D/HeadAttach" index="0" node_paths=PackedStringArray("health")]
 | 
						|
health = NodePath("../../../../../HealthStatus")
 | 
						|
damage_modifier = 4.0
 | 
						|
 | 
						|
[node name="CollisionShape3D" parent="wretched/Character/Skeleton3D/HeadAttach/Hitbox" index="0"]
 | 
						|
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" index="0"]
 | 
						|
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="."]
 | 
						|
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_name_in_owner = true
 | 
						|
 | 
						|
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
 | 
						|
unique_name_in_owner = true
 | 
						|
avoidance_enabled = true
 | 
						|
neighbor_distance = 10.0
 | 
						|
time_horizon_agents = 0.7
 | 
						|
 | 
						|
[node name="PlayerDetector" type="PlayerDetector" parent="."]
 | 
						|
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_name_in_owner = true
 | 
						|
health = 3
 | 
						|
 | 
						|
[connection signal="death" from="HealthStatus" to="." method="_on_health_status_death"]
 | 
						|
 | 
						|
[editable path="wretched"]
 |