1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 08:04:23 +00:00

Move SacrificeKind to Sacrificable

This commit is contained in:
Steffo 2024-04-28 17:16:36 +02:00
parent 07f40806be
commit fefcacef4b
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 12 additions and 10 deletions

View file

@ -2,6 +2,7 @@
extends Node extends Node
class_name Sacrificable class_name Sacrificable
## Emits [signal eaten] when eaten by an [Eater] whose acceptable diets contain this node's [field diet]. ## 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. ## To add multiple possible [Edible] diets to an entity, add multiple [Edible] nodes to it.
@ -9,8 +10,18 @@ class_name Sacrificable
signal sacrificed signal sacrificed
@export var type: Enums.MonsterType = Enums.MonsterType.Sheep @export var type: SacrificeKind = SacrificeKind.Sheep
func sarcifice(): func sarcifice():
sacrificed.emit() sacrificed.emit()
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,
}

View file

@ -8,12 +8,3 @@ enum ZIndex {
Props = 0, Props = 0,
Terrain = -10, Terrain = -10,
} }
enum MonsterType {
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,
Chupacapra,
Watcher,
Chtulu,
}