The fleet hold was unbounded - GameState.fleet_inventory had no total_capacity, so a lone ship could carry unlimited resources. Capacity is now data-driven: only vessels declaring the "cargo" capability contribute their cargo_capacity stat (interceptor: 20; shield vessel and gas bomber: 0, unarmed transporters are never in the fleet at all). Fleet.gd recomputes it in the one place composition can change (spawn_ships/add_ship/store_ship/_on_ship_destroyed), which also covers the space<->surface scene-swap restore since that goes through spawn_ships(). Rock.gd and GasVentField.gd (the two "fly over it to collect" pickup paths) now check what collect_cargo()/collect_gas_cargo() actually accepted before consuming their source, instead of assuming an unlimited hold. The HUD's FLEET HOLD caption shows the live total/cap. Also fixes test_resource_transfer.gd, which pushed more ore through a 2-ship fleet than the new cap allows - it now spawns the largest fleet every unlocked doctrine permits, since that test is about the transfer UI rather than the cap itself (test_fleet_cargo_limit.gd owns that).
22 lines
1.3 KiB
Text
22 lines
1.3 KiB
Text
[gd_resource type="Resource" script_class="VesselDefinition" load_steps=8 format=3]
|
|
[ext_resource type="Script" path="res://VesselDefinition.gd" id="1"]
|
|
[ext_resource type="PackedScene" path="res://VesselWeaponComponent.tscn" id="2"]
|
|
[ext_resource type="Resource" path="res://InterceptorDamageUpgrade.tres" id="3"]
|
|
[ext_resource type="Resource" path="res://InterceptorRateUpgrade.tres" id="4"]
|
|
[ext_resource type="Resource" path="res://InterceptorRangeUpgrade.tres" id="5"]
|
|
[ext_resource type="Resource" path="res://InterceptorSpeedUpgrade.tres" id="6"]
|
|
[ext_resource type="PackedScene" path="res://VesselCargoComponent.tscn" id="7"]
|
|
[resource]
|
|
script = ExtResource("1")
|
|
definition_id = "interceptor"
|
|
display_name = "Interceptor"
|
|
description = "Fast combat vessel with a rapid-firing cannon."
|
|
build_cost = 6
|
|
build_time = 10.0
|
|
icon = 2
|
|
glow_color = Color(0.25, 0.85, 1, 1)
|
|
fleet_eligible = true
|
|
capabilities = PackedStringArray("weapon", "cargo")
|
|
component_scenes = Array[PackedScene]([ExtResource("2"), ExtResource("7")])
|
|
base_stats = {"damage": 1.0, "fire_cooldown": 0.5, "fire_range": 320.0, "max_speed": 460.0, "acceleration": 450.0, "delivery_speed": 180.0, "cargo_capacity": 20.0}
|
|
upgrades = Array[Resource]([ExtResource("3"), ExtResource("4"), ExtResource("5"), ExtResource("6")])
|