Add space-time distorder vessel and fleet speed fader (#59)
GameState.fleet_speed_multiplier (1.0-3.0) is applied at the point of
use - Fleet's cruise anchor and Ship's own max_speed/acceleration -
rather than baked into stored stats, so a stat upgrade researched
mid-boost can't corrupt the base value and the fader takes effect
immediately with no re-apply step.
Ship.arrive_radius is scaled by the same multiplier: at higher speeds
each physics tick covers a proportionally larger step, and once that
step outgrows a fixed arrive_radius the ship can overshoot its
snap-to-target zone every tick while chasing a target that's now also
receding faster - visible as the fleet stretching apart under boost.
Scaling it preserves the same "snaps onto its slot" tightness at any
boost level that 1.0x already has.
SpeedFader.gd is a self-contained vertical drag control (TouchJoystick's
raw-touch idiom, not _gui_input) that writes straight to the autoload
rather than reporting a value for something else to apply. It also
resets the multiplier to 1.0 the instant fleet.has_capability("distorder")
goes false, so a fleet can never be left permanently boosted by a vessel
it no longer has.
VesselDistorderComponent carries no per-shot behaviour (energy drain
while boosted is #62) - its presence is what matters. Registered in
VesselDefinitions, wired into the crafter/hangar/ship-lab menus per
#57's note (5/5/6 -> 6/6/7 columns).
This commit is contained in:
parent
ed46cd77e6
commit
116e0f97d3
14 changed files with 675 additions and 86 deletions
13
GameState.gd
13
GameState.gd
|
|
@ -22,6 +22,17 @@ var planet_name: String = ""
|
|||
var planet_id: String = ""
|
||||
var planet_definition_id: String = "rocky"
|
||||
|
||||
# #59: 1.0 is today's behaviour. Applied at the point of use (Fleet's cruise
|
||||
# anchor, Ship's own max_speed/acceleration) rather than baked into stored
|
||||
# stats, so a speed upgrade researched while boosted can't corrupt the base
|
||||
# value - see Fleet.gd/Ship.gd for the multiply sites.
|
||||
const MAX_FLEET_SPEED_MULTIPLIER: float = 3.0
|
||||
var fleet_speed_multiplier: float = 1.0
|
||||
|
||||
|
||||
func set_fleet_speed_multiplier(value: float) -> void:
|
||||
fleet_speed_multiplier = clampf(value, 1.0, MAX_FLEET_SPEED_MULTIPLIER)
|
||||
|
||||
# Explored-chunk history for the world map's fog-of-war reveal. Lives
|
||||
# here (not on ExplorationTracker, which gets destroyed and recreated on
|
||||
# every scene swap) so exploration progress isn't lost every time the
|
||||
|
|
@ -381,6 +392,7 @@ func reset_new_game() -> void:
|
|||
planet_name = ""
|
||||
planet_id = ""
|
||||
planet_definition_id = "rocky"
|
||||
fleet_speed_multiplier = 1.0
|
||||
explored_chunks.clear()
|
||||
bank_inventory = INVENTORY.new({RESOURCE_ORE: 500})
|
||||
fleet_inventory = INVENTORY.new()
|
||||
|
|
@ -465,6 +477,7 @@ const VESSEL_GAS_BOMBER: String = "gas_bomber"
|
|||
const VESSEL_TRANSPORTER: String = "transporter"
|
||||
const VESSEL_CARRIER: String = "carrier"
|
||||
const VESSEL_LASER: String = "laser"
|
||||
const VESSEL_DISTORDER: String = "distorder"
|
||||
|
||||
# Compatibility constants for callers and old tests. Runtime metadata is
|
||||
# resolved from VesselDefinition below.
|
||||
|
|
|
|||
Loading…
Reference in a new issue