1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-26 01:54:23 +00:00
hella-farm/behaviours/sacrificable.gd

28 lines
618 B
GDScript3
Raw Normal View History

2024-04-28 09:23:07 +00:00
@icon("res://behaviours/sacrificable.svg")
2024-04-27 18:12:03 +00:00
extends Node
2024-04-28 09:23:07 +00:00
class_name Sacrificable
2024-04-27 18:12:03 +00:00
2024-04-28 15:16:36 +00:00
2024-04-27 18:12:03 +00: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 15:16:36 +00:00
@export var type: SacrificeKind = SacrificeKind.Sheep
2024-04-27 18:12:03 +00:00
func sarcifice():
sacrificed.emit()
2024-04-28 15:16:36 +00:00
enum SacrificeKind {
None = 0, # I hate this but in GDScript enums can't be nulls and there aren't any sum types like in rust so this is all we can do
Sheep,
Imp,
Chupacabra,
Watcher,
Cthulhu,
}