Server-authoritative Godot 4.6 strategy game. Includes the headless WebSocket game server, the browser client, and Nix packaging (server and web-export derivations plus a NixOS module) for deployment.
20 lines
663 B
GDScript
20 lines
663 B
GDScript
class_name ProtoUnit
|
|
|
|
extends Resource
|
|
|
|
## Template for a unit type. Concrete instances live under res://data/units.
|
|
## Units spawned from the same template share these values but track their own
|
|
## current HP and position.
|
|
|
|
@export var name : String
|
|
@export var max_hp : int = 100
|
|
## Production points needed to train the unit.
|
|
@export var cost : int = 0
|
|
## Production points consumed per game hour while the unit exists.
|
|
@export var upkeep : int = 0
|
|
@export var moveable : bool = true
|
|
## Tiles travelled per game hour.
|
|
@export var speed : float = 0.5
|
|
@export var traversable_terrains : PackedStringArray = PackedStringArray()
|
|
@export var sprites : SpriteFrames
|