init
This commit is contained in:
25
scripts/upgrades/standard_engine_upgrade.gd
Normal file
25
scripts/upgrades/standard_engine_upgrade.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
extends Upgrade
|
||||
class_name StandardEngineUpgrade
|
||||
|
||||
var module: StandardEngineModule
|
||||
|
||||
func _init(tier: int = 1, module: StandardEngineModule = null):
|
||||
if module == null:
|
||||
self.module = StandardEngineModule.new()
|
||||
else:
|
||||
self.module = module
|
||||
if tier < 5:
|
||||
unlocks.append(StandardEngineUpgrade.new(tier + 1))
|
||||
self.tier = tier
|
||||
name = "Standard Engine Tier %s" % ['I','II','III','IV','V'][tier - 1]
|
||||
description = "Standard Engine with no specialties, all around engine"
|
||||
cost = {
|
||||
"star": (tier - 1) * 10
|
||||
}
|
||||
|
||||
func activate_upgrade() -> bool:
|
||||
if not super(): return false
|
||||
if tier == 1:
|
||||
DataHandler.add_module(GameData.ModuleType.ENGINE, module)
|
||||
module.tier = tier
|
||||
return true
|
||||
Reference in New Issue
Block a user