Randoloot/scripts/game/ship_catalog.gd
2026-10-10 22:38:40 +02:00

23 lines
1.1 KiB
GDScript

extends RefCounted
class_name ShipCatalog
# Base hull values, before equipment and captain bonuses.
const SHIPS := [
{"number": 0, "name": "Aegis", "role": "Wzmocnione tarcze", "hull": 100.0, "shields": 125.0, "energy": 100.0, "speed": 90.0},
{"number": 2, "name": "Titan", "role": "Wzmocniony kadłub", "hull": 125.0, "shields": 100.0, "energy": 100.0, "speed": 90.0},
{"number": 3, "name": "Eagle", "role": "Szybki myśliwiec", "hull": 100.0, "shields": 100.0, "energy": 100.0, "speed": 108.0},
{"number": 7, "name": "Phantom", "role": "Większy zapas energii", "hull": 100.0, "shields": 100.0, "energy": 125.0, "speed": 90.0},
]
static func texture_path(ship: Dictionary) -> String:
return "res://assets/Ships/Spaceship_%d.png" % int(ship["number"])
static func for_path(path: String) -> Dictionary:
for ship in SHIPS:
if texture_path(ship) == path:
return ship
return SHIPS[0]
static func stats_text(ship: Dictionary) -> String:
return "Kadłub: %d · Tarcze: %d\nEnergia: %d · Prędkość: %d px/s" % [ship["hull"], ship["shields"], ship["energy"], ship["speed"]]