21 lines
548 B
GDScript
21 lines
548 B
GDScript
@tool
|
|
class_name StructuralPiece
|
|
extends OrbitalBody2D
|
|
|
|
# Does this piece block atmosphere? (e.g., a hull plate would, a girder would not).
|
|
@export var is_pressurized: bool = true
|
|
|
|
# The health of this specific piece.
|
|
@export var health: float = 100.0
|
|
|
|
# This setter is triggered by the editor.
|
|
var is_preview: bool = false:
|
|
set(value):
|
|
is_preview = value
|
|
if is_preview:
|
|
# Make the piece translucent if it's a preview.
|
|
modulate = Color(1, 1, 1, 0.5)
|
|
else:
|
|
# Make it opaque if it's a permanent piece.
|
|
modulate = Color(1, 1, 1, 1)
|