Files
MisguidedLaunch/scripts/upgrades/standard_cockpit_upgrade.gd
Eric Vande Voort 7eb0dea424 init
2025-01-07 16:10:03 -06:00

26 lines
709 B
GDScript

extends Upgrade
class_name StandardCockpitUpgrade
var module: StandardCockpitModule
func _init(tier: int = 1, module: StandardCockpitModule = null):
if module == null:
self.module = StandardCockpitModule.new()
else:
self.module = module
if tier < 5:
unlocks.append(StandardCockpitUpgrade.new(tier + 1, module))
self.tier = tier
name = "Standard Cockpit Tier %s" % ['I','II','III','IV','V'][tier - 1]
description = "Standard Cockpit with no specialties, no strengths, no weakness."
cost = {
"star": (tier - 1) * 10
}
func activate_upgrade() -> bool:
if not super(): return false
if tier == 1:
DataHandler.add_module(GameData.ModuleType.COCKPIT, module)
module.tier = tier
return true