2024-04-28 11:23:07 +02:00
|
|
|
@icon("res://behaviours/sacrificable.svg")
|
2024-04-27 20:12:03 +02:00
|
|
|
extends Node
|
2024-04-28 11:23:07 +02:00
|
|
|
class_name Sacrificable
|
2024-04-27 20:12:03 +02:00
|
|
|
|
2024-04-28 17:16:36 +02:00
|
|
|
|
2024-04-27 20:12:03 +02:00
|
|
|
## Emits [signal eaten] when eaten by an [Eater] whose acceptable diets contain this node's [field diet].
|
|
|
|
##
|
|
|
|
## To add multiple possible [Edible] diets to an entity, add multiple [Edible] nodes to it.
|
|
|
|
|
|
|
|
signal sacrificed
|
|
|
|
|
|
|
|
|
2024-04-28 19:43:10 +02:00
|
|
|
@export var kind: StringName = &""
|
2024-04-27 20:12:03 +02:00
|
|
|
|
|
|
|
|
2024-05-01 06:26:30 +02:00
|
|
|
func set_kind(value: StringName) -> void:
|
|
|
|
kind = value
|
|
|
|
|
2024-04-29 00:32:33 +02:00
|
|
|
func sacrifice():
|
2024-04-27 20:12:03 +02:00
|
|
|
sacrificed.emit()
|