gmtk2021/Scripts/Trait.gd

31 lines
499 B
GDScript

extends Resource
class_name Trait
enum TraitType{
MUNDANE,
EXCLUSIONARY,
REQUIRES
}
export var id: String
export var string: String
export(TraitType) var type #TraitType
func validate(trait_owner) -> bool:
match type:
TraitType.MUNDANE:
return true
TraitType.EXCLUSIONARY:
return excludes(trait_owner)
TraitType.REQUIRES:
return requires(trait_owner)
return false
func excludes(_trait_owner) -> bool:
return false
func requires(_trait_owner) -> bool:
return false