SlimeoosOdyssey/godot/cultist.gd

25 lines
480 B
GDScript

extends SharedSlime
class_name Cultist
var victim
func _process(delta):
super._process(delta)
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"