1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 15:44:23 +00:00

Remove more unused references in Imp

This commit is contained in:
Steffo 2024-04-19 01:52:35 +02:00
parent 2b39bb4551
commit 081a4f905d
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 2 additions and 7 deletions

View file

@ -1,17 +1,10 @@
extends CharacterBody2D
class_name Imp
@export var skull_chance: float = 0.2
@onready var skull_spawner: Spawner = $"SkullSpawner"
@onready var sprite: SpriteLeftRight = $"Sprite"
func _on_eat_target_eaten(target: Edible):
target.queue_free()
if Random.rng.randf() < skull_chance:
skull_spawner.spawn()
func _on_move(movement:Vector2):
move_and_collide(movement)
sprite.handle_move(movement)

View file

@ -55,6 +55,7 @@ alternative_priority = 10
[node name="ChangeDirectionTimer" parent="MovementWander" instance=ExtResource("10_phvea")]
one_shot = true
autostart = true
mean_secs = 2.0
deviation = 2.0
min_secs = 0.6
@ -86,6 +87,7 @@ tracker = NodePath("..")
[connection signal="timeout" from="MovementWander/ChangeDirectionTimer" to="MovementWander" method="randomize_direction"]
[connection signal="changed_target" from="MovementHunt" to="MovementHunt/HuntPriority" method="priority_conditional"]
[connection signal="move" from="MovementHunt" to="." method="_on_move"]
[connection signal="priority_changed" from="MovementHunt/HuntPriority" to="MovementHunt/HuntPriority" method="log_priority"]
[connection signal="tracked" from="MovementHunt/TrackerMeat" to="MovementHunt/TrackerMeat/TargetPicker" method="sample_target_if_null"]
[connection signal="untracked" from="MovementHunt/TrackerMeat" to="MovementHunt/TrackerMeat/TargetPicker" method="clear_if_target"]
[connection signal="target_changed" from="MovementHunt/TrackerMeat/TargetPicker" to="MovementHunt/TrackerMeat/TargetPicker" method="sample_target_if_null"]