spaceship/buildings/BuildingDefinition.gd
2026-08-31 15:23:25 +02:00

37 lines
1.6 KiB
GDScript

class_name BuildingDefinition
extends Resource
@export var definition_id: String
@export var display_name: String
@export_multiline var description: String
# What it costs in ORE, and the whole price when it wants more than ore.
#
# #138: structures all charged rocks and nothing else, whatever they were.
# The dictionary is the same shape VesselDefinition has used since gas
# bombers and laser ships (build_cost / build_resource_costs): when it is
# empty the price is `cost` in ore, and when it is set it IS the price, ore
# included - and its ore entry must agree with `cost`, which the test pins,
# because repair costs are quoted from `cost` alone (a repair drone carries
# ore and nothing else).
@export var cost: int
@export var build_resource_costs: Dictionary = {}
@export var action_icon: int
@export var menu_icon: int
@export var visual_scene: PackedScene
# No explicit empty default: Godot 4.7.1 can lose the value when exporting a
# custom resource to binary .res.
@export var capabilities: PackedStringArray
@export var logistics: Resource
@export var map_color: Color = Color.WHITE
@export var map_sides: int = 4
@export var map_radius: float = 7.0
@export var map_phase: float = 0.0
@export var menu_button_name: String
@export var menu_label_name: String
@export var menu_cost_name: String
@export_enum("space", "planet") var placement_mode: String = "space"
@export var unique: bool = false
# #99: what a wave has to chew through to level this. Data rather than one
# constant for every structure - an extractor bolted to a rock is not the
# mothership. See GameState.damage_building().
@export var max_hp: int = 40