19 lines
380 B
GDScript3
19 lines
380 B
GDScript3
|
extends SharedSlime
|
||
|
class_name Cultist
|
||
|
|
||
|
const SPEED = 5.0
|
||
|
const JUMP_VELOCITY = 4.
|
||
|
|
||
|
func _on_area_3d_body_entered(body):
|
||
|
var items_in_range = $Area3D.get_overlapping_bodies()
|
||
|
var villagers = []
|
||
|
|
||
|
for item in items_in_range:
|
||
|
if is_class("Villager"):
|
||
|
villagers.append(item)
|
||
|
|
||
|
var rng = RandomNumberGenerator.new()
|
||
|
var victim_num = rng.randi_range(0, villagers.size())
|
||
|
|
||
|
|