init
This commit is contained in:
19
scripts/upgrades/engine_maneuverability_upgrade.gd
Normal file
19
scripts/upgrades/engine_maneuverability_upgrade.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
extends Upgrade
|
||||
class_name EngineManeuverabilityUpgrade
|
||||
|
||||
@export var modifier := 1.8
|
||||
|
||||
func _init(tier: int = 1):
|
||||
if tier < 5:
|
||||
unlocks.append(EngineManeuverabilityUpgrade.new(tier + 1))
|
||||
self.tier = tier
|
||||
name = "Engine Maneuverability Increase - Tier %s" % ['I','II','III','IV','V'][tier - 1]
|
||||
description = "Increases the turning speed of your rocket"
|
||||
cost = {
|
||||
"star": (tier) * 15 - 5
|
||||
}
|
||||
|
||||
func activate_upgrade() -> bool:
|
||||
if not super(): return false
|
||||
DataHandler.game_data.engine_maneuverability_modifier *= modifier
|
||||
return true
|
||||
20
scripts/upgrades/engine_speed_upgrade.gd
Normal file
20
scripts/upgrades/engine_speed_upgrade.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
extends Upgrade
|
||||
class_name EngineSpeedUpgrade
|
||||
|
||||
@export var modifier := 1.2
|
||||
|
||||
func _init(tier: int = 1):
|
||||
if tier < 5:
|
||||
unlocks.append(EngineSpeedUpgrade.new(tier + 1))
|
||||
self.tier = tier
|
||||
name = "Engine Speed Increase - Tier %s" % ['I','II','III','IV','V'][tier - 1]
|
||||
description = "Increases the top speed of your rocket"
|
||||
cost = {
|
||||
"fuel": (tier) * 10 - 5,
|
||||
"star": tier * 5 + 10
|
||||
}
|
||||
|
||||
func activate_upgrade() -> bool:
|
||||
if not super(): return false
|
||||
DataHandler.game_data.engine_speed_modifier *= modifier
|
||||
return true
|
||||
8
scripts/upgrades/first_upgrade.gd
Normal file
8
scripts/upgrades/first_upgrade.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Upgrade
|
||||
class_name FirstUpgrade
|
||||
|
||||
func _init():
|
||||
name = "First Upgrade"
|
||||
description = "Buy this upgrade to unlock the six initial upgrades"
|
||||
cost = {}
|
||||
unlocks = [StandardCockpitUpgrade.new(), StandardEngineUpgrade.new(), FuelEfficiencyUpgrade.new(), FuelCapacityUpgrade.new(), EngineSpeedUpgrade.new(), EngineManeuverabilityUpgrade.new()]
|
||||
19
scripts/upgrades/fuel_capacity_upgrade.gd
Normal file
19
scripts/upgrades/fuel_capacity_upgrade.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
extends Upgrade
|
||||
class_name FuelCapacityUpgrade
|
||||
|
||||
@export var size_increase := 40
|
||||
|
||||
func _init(tier: int = 1):
|
||||
if tier < 5:
|
||||
unlocks.append(FuelCapacityUpgrade.new(tier + 1))
|
||||
self.tier = tier
|
||||
name = "Fuel Capacity Increase - Tier %s" % ['I','II','III','IV','V'][tier - 1]
|
||||
description = "Increases the maximum amount of fuel your rocket can hold"
|
||||
cost = {
|
||||
"fuel": (tier) * 20 - 5
|
||||
}
|
||||
|
||||
func activate_upgrade() -> bool:
|
||||
if not super(): return false
|
||||
DataHandler.game_data.fuel_max += size_increase
|
||||
return true
|
||||
20
scripts/upgrades/fuel_efficiency_upgrade.gd
Normal file
20
scripts/upgrades/fuel_efficiency_upgrade.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
extends Upgrade
|
||||
class_name FuelEfficiencyUpgrade
|
||||
|
||||
@export var modifier := 0.95
|
||||
|
||||
func _init(tier: int = 1):
|
||||
if tier < 5:
|
||||
unlocks.append(FuelEfficiencyUpgrade.new(tier + 1))
|
||||
self.tier = tier
|
||||
name = "Fuel Efficiency Increase - Tier %s" % ['I','II','III','IV','V'][tier - 1]
|
||||
description = "Increases the efficiency of fuel use for your rocket"
|
||||
cost = {
|
||||
"fuel": (tier) * 15 - 5,
|
||||
"star": (tier) * 5 + 5
|
||||
}
|
||||
|
||||
func activate_upgrade() -> bool:
|
||||
if not super(): return false
|
||||
DataHandler.game_data.fuel_efficiency *= modifier
|
||||
return true
|
||||
25
scripts/upgrades/standard_cockpit_upgrade.gd
Normal file
25
scripts/upgrades/standard_cockpit_upgrade.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
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
|
||||
17
scripts/upgrades/upgrade.gd
Normal file
17
scripts/upgrades/upgrade.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Resource
|
||||
class_name Upgrade
|
||||
|
||||
@export var name: String = "Base Upgrade"
|
||||
@export var description: String = "Base Description"
|
||||
@export var unlocks: Array[Upgrade]
|
||||
@export var cost: Dictionary = {
|
||||
"star": 1
|
||||
}
|
||||
@export var purchased: bool = false
|
||||
@export var tier: int = -1
|
||||
|
||||
func activate_upgrade() -> bool:
|
||||
if DataHandler.has_upgrade_cost(self): return false
|
||||
purchased = true
|
||||
DataHandler.game_data.upgrades.append_array(unlocks)
|
||||
return true
|
||||
Reference in New Issue
Block a user