2023-08-20 00:00:17 -06:00
|
|
|
extends SharedSlime
|
|
|
|
class_name Cultist
|
|
|
|
|
2023-08-20 12:18:04 -06:00
|
|
|
var victim
|
2023-08-20 00:00:17 -06:00
|
|
|
|
2023-08-20 12:18:04 -06:00
|
|
|
func _process(delta):
|
|
|
|
super._process(delta)
|
2023-08-20 00:00:17 -06:00
|
|
|
|
2023-08-20 12:18:04 -06:00
|
|
|
if task == "corrupt":
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
# For corruption detection range.
|
|
|
|
func _on_target_radius_body_entered(body):
|
|
|
|
if body.is_class("Villager"):
|
|
|
|
victim = body
|
|
|
|
walk_speed = 2 * walk_speed
|
|
|
|
target_location_xz = victim.location_xz
|
|
|
|
task = "walk"
|
|
|
|
|
|
|
|
# For collision with other slimes.
|
|
|
|
func _on_collision_detection_body_entered(body):
|
|
|
|
if body.is_class("Villager"):
|
|
|
|
task = "corrupt"
|