SlimeoosOdyssey/godot/cultist.gd

25 lines
480 B
GDScript3
Raw Normal View History

2023-08-20 00:00:17 -06:00
extends SharedSlime
class_name Cultist
var victim
2023-08-20 00:00:17 -06:00
func _process(delta):
super._process(delta)
2023-08-20 00:00:17 -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"