4
0
Fork 0
WolfBox/scripts/werewolf/role.gd

32 lines
980 B
GDScript3
Raw Normal View History

2025-06-21 14:36:09 +01:00
extends Resource
class_name Role
static var roles: Dictionary = {}
static var roles_group: ResourceGroup = preload("res://roles/roles_group.tres")
static func _static_init() -> void:
for res in roles_group.load_all():
if res is Role:
roles[res.name] = res
@export var global_enable: bool = false
@export var name: String:
set(val):
resource_name = val
name = val
roles[name] = self
@export_multiline var description: String
@export_multiline var flavour_text: String
@export_multiline var postit: String
@export var teams: Array[Team]
@export var night_action: NightAction = null
@export var passive_action: Passive = null
@export var able_to_kill: bool = false
@export var special_investigation_results: Dictionary = {} # investigating role = forced result
@export var icon: Texture2D = preload("res://icon.svg")
@export var max_count: int = 1
@export var balance: float = 1.0
@export var chaos: float = 0.0
@export var pointless_without: PackedStringArray = []