23 lines
1.3 KiB
GDScript
23 lines
1.3 KiB
GDScript
extends RefCounted
|
|
class_name ShipCatalog
|
|
|
|
# Base hull values, before equipment and captain bonuses.
|
|
const SHIPS := [
|
|
{"number": 0, "name": "Szerszeń", "asset": "szerszen", "role": "MYŚLIWIEC • SZYBKOŚĆ", "accent": Color("efb866"), "hull": 100.0, "shields": 100.0, "energy": 100.0, "speed": 108.0},
|
|
{"number": 2, "name": "Bastion", "asset": "bastion", "role": "FREGATA • PANCERZ", "accent": Color("de976b"), "hull": 125.0, "shields": 100.0, "energy": 100.0, "speed": 90.0},
|
|
{"number": 3, "name": "Wędrowiec", "asset": "wedrowiec", "role": "ZWIADEK • TARCZE", "accent": Color("64d8ed"), "hull": 100.0, "shields": 125.0, "energy": 100.0, "speed": 90.0},
|
|
{"number": 7, "name": "Żmija", "asset": "zmija", "role": "KORSARZ • ENERGIA", "accent": Color("b796ff"), "hull": 100.0, "shields": 100.0, "energy": 125.0, "speed": 90.0},
|
|
]
|
|
|
|
static func texture_path(ship: Dictionary) -> String:
|
|
return "res://assets/Ships/player/%s.png" % ship["asset"]
|
|
|
|
static func for_path(path: String) -> Dictionary:
|
|
for ship in SHIPS:
|
|
if texture_path(ship) == path or path == "res://assets/Ships/Spaceship_%d.png" % int(ship["number"]):
|
|
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"]]
|