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:
Loïc Wisniewski 2026-08-16 17:59:04 +02:00
commit 116e0f97d3
14 changed files with 675 additions and 86 deletions

268
Main.tscn
View file

@ -1,4 +1,4 @@
[gd_scene load_steps=28 format=3]
[gd_scene load_steps=29 format=3]
[ext_resource type="Script" path="res://Starfield.gd" id="1"]
[ext_resource type="Script" path="res://Fleet.gd" id="2"]
@ -26,6 +26,7 @@
[ext_resource type="Script" path="res://ResourceTransferList.gd" id="27"]
[ext_resource type="Script" path="res://GasBombController.gd" id="29"]
[ext_resource type="Script" path="res://LaserController.gd" id="30"]
[ext_resource type="Script" path="res://SpeedFader.gd" id="31"]
[sub_resource type="ShaderMaterial" id="1"]
shader = ExtResource("5")
@ -221,6 +222,28 @@ offset_top = -424
offset_bottom = -24
script = ExtResource("13")
[node name="SpeedFader" type="Control" parent="UI"]
visible = false
mouse_filter = 2
anchor_left = 1.0
anchor_right = 1.0
offset_left = -94
offset_right = -24
offset_top = 740
offset_bottom = 920
script = ExtResource("31")
[node name="Label" type="Label" parent="UI/SpeedFader"]
mouse_filter = 2
offset_left = -20
offset_right = 90
offset_top = -32
offset_bottom = -4
theme_override_font_sizes/font_size = 20
theme_override_colors/font_color = Color(0.7, 0.3, 1, 1)
horizontal_alignment = 1
text = "x1.0"
[node name="LaserButton" type="Control" parent="UI"]
visible = false
mouse_filter = 2
@ -839,7 +862,7 @@ horizontal_alignment = 1
anchor_left = 0.5
anchor_right = 0.5
offset_left = -290
offset_right = -198
offset_right = -215
offset_top = 255
offset_bottom = 375
script = ExtResource("10")
@ -850,7 +873,7 @@ mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -330
offset_right = -158
offset_right = -175
offset_top = 380
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -859,8 +882,8 @@ horizontal_alignment = 1
[node name="AvailableShield" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -168
offset_right = -76
offset_left = -189
offset_right = -114
offset_top = 255
offset_bottom = 375
script = ExtResource("10")
@ -871,8 +894,8 @@ glow_color = Color(0.45, 0.8, 1, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -208
offset_right = -36
offset_left = -229
offset_right = -74
offset_top = 380
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -881,8 +904,8 @@ horizontal_alignment = 1
[node name="AvailableGasBomber" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -46
offset_right = 46
offset_left = -88
offset_right = -13
offset_top = 255
offset_bottom = 375
script = ExtResource("10")
@ -893,8 +916,8 @@ glow_color = Color(0.96, 0.32, 0.78, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -86
offset_right = 86
offset_left = -128
offset_right = 27
offset_top = 380
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -903,8 +926,8 @@ horizontal_alignment = 1
[node name="AvailableCarrier" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 76
offset_right = 168
offset_left = 13
offset_right = 88
offset_top = 255
offset_bottom = 375
script = ExtResource("10")
@ -915,8 +938,8 @@ glow_color = Color(1, 0.78, 0.3, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 36
offset_right = 208
offset_left = -27
offset_right = 128
offset_top = 380
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -925,8 +948,8 @@ horizontal_alignment = 1
[node name="AvailableLaser" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 198
offset_right = 290
offset_left = 114
offset_right = 189
offset_top = 255
offset_bottom = 375
script = ExtResource("10")
@ -937,7 +960,29 @@ glow_color = Color(0.3, 0.9, 1, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 158
offset_left = 74
offset_right = 229
offset_top = 380
offset_bottom = 460
theme_override_font_sizes/font_size = 22
horizontal_alignment = 1
[node name="AvailableDistorder" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 215
offset_right = 290
offset_top = 255
offset_bottom = 375
script = ExtResource("10")
icon = 37
glow_color = Color(0.7, 0.3, 1, 1)
[node name="AvailableDistorderLabel" type="Label" parent="UI/HangarMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 175
offset_right = 330
offset_top = 380
offset_bottom = 460
@ -957,7 +1002,7 @@ horizontal_alignment = 1
anchor_left = 0.5
anchor_right = 0.5
offset_left = -290
offset_right = -198
offset_right = -215
offset_top = 565
offset_bottom = 685
script = ExtResource("10")
@ -968,7 +1013,7 @@ mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -330
offset_right = -158
offset_right = -175
offset_top = 690
offset_bottom = 770
theme_override_font_sizes/font_size = 22
@ -977,8 +1022,8 @@ horizontal_alignment = 1
[node name="FleetShield" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -168
offset_right = -76
offset_left = -189
offset_right = -114
offset_top = 565
offset_bottom = 685
script = ExtResource("10")
@ -989,8 +1034,8 @@ glow_color = Color(0.45, 0.8, 1, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -208
offset_right = -36
offset_left = -229
offset_right = -74
offset_top = 690
offset_bottom = 770
theme_override_font_sizes/font_size = 22
@ -999,8 +1044,8 @@ horizontal_alignment = 1
[node name="FleetGasBomber" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -46
offset_right = 46
offset_left = -88
offset_right = -13
offset_top = 565
offset_bottom = 685
script = ExtResource("10")
@ -1011,8 +1056,8 @@ glow_color = Color(0.96, 0.32, 0.78, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -86
offset_right = 86
offset_left = -128
offset_right = 27
offset_top = 690
offset_bottom = 770
theme_override_font_sizes/font_size = 22
@ -1021,8 +1066,8 @@ horizontal_alignment = 1
[node name="FleetCarrier" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 76
offset_right = 168
offset_left = 13
offset_right = 88
offset_top = 565
offset_bottom = 685
script = ExtResource("10")
@ -1033,8 +1078,8 @@ glow_color = Color(1, 0.78, 0.3, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 36
offset_right = 208
offset_left = -27
offset_right = 128
offset_top = 690
offset_bottom = 770
theme_override_font_sizes/font_size = 22
@ -1043,8 +1088,8 @@ horizontal_alignment = 1
[node name="FleetLaser" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 198
offset_right = 290
offset_left = 114
offset_right = 189
offset_top = 565
offset_bottom = 685
script = ExtResource("10")
@ -1055,7 +1100,29 @@ glow_color = Color(0.3, 0.9, 1, 1)
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 158
offset_left = 74
offset_right = 229
offset_top = 690
offset_bottom = 770
theme_override_font_sizes/font_size = 22
horizontal_alignment = 1
[node name="FleetDistorder" type="Control" parent="UI/HangarMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 215
offset_right = 290
offset_top = 565
offset_bottom = 685
script = ExtResource("10")
icon = 37
glow_color = Color(0.7, 0.3, 1, 1)
[node name="FleetDistorderLabel" type="Label" parent="UI/HangarMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 175
offset_right = 330
offset_top = 690
offset_bottom = 770
@ -1107,7 +1174,7 @@ script = ExtResource("24")
anchor_left = 0.5
anchor_right = 0.5
offset_left = -300
offset_right = -230
offset_right = -240
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
@ -1117,8 +1184,8 @@ glow_color = Color(0.25, 0.85, 1, 1)
[node name="VesselB" type="Control" parent="UI/LabMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -194
offset_right = -124
offset_left = -210
offset_right = -150
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
@ -1128,8 +1195,8 @@ glow_color = Color(0.45, 0.8, 1, 1)
[node name="VesselC" type="Control" parent="UI/LabMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = -88
offset_right = -18
offset_left = -120
offset_right = -60
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
@ -1139,8 +1206,8 @@ glow_color = Color(0.96, 0.32, 0.78, 1)
[node name="VesselD" type="Control" parent="UI/LabMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 18
offset_right = 88
offset_left = -30
offset_right = 30
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
@ -1150,8 +1217,8 @@ glow_color = Color(0.95, 0.55, 0.85, 1)
[node name="VesselE" type="Control" parent="UI/LabMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 124
offset_right = 194
offset_left = 60
offset_right = 120
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
@ -1161,14 +1228,25 @@ glow_color = Color(1, 0.78, 0.3, 1)
[node name="VesselF" type="Control" parent="UI/LabMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 230
offset_right = 300
offset_left = 150
offset_right = 210
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
icon = 35
glow_color = Color(0.3, 0.9, 1, 1)
[node name="VesselG" type="Control" parent="UI/LabMenu"]
anchor_left = 0.5
anchor_right = 0.5
offset_left = 240
offset_right = 300
offset_top = 274
offset_bottom = 394
script = ExtResource("10")
icon = 37
glow_color = Color(0.7, 0.3, 1, 1)
[node name="VesselLabel" type="Label" parent="UI/LabMenu"]
visible = false
mouse_filter = 2
@ -1186,7 +1264,7 @@ mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -330
offset_right = -200
offset_right = -210
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -1197,8 +1275,8 @@ text = "Interceptor"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -224
offset_right = -94
offset_left = -240
offset_right = -120
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -1209,8 +1287,8 @@ text = "Shield"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -118
offset_right = 12
offset_left = -150
offset_right = -30
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -1221,8 +1299,8 @@ text = "Gas Bomber"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 12
offset_right = 118
offset_left = -60
offset_right = 60
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -1233,8 +1311,8 @@ text = "Transporter"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 94
offset_right = 224
offset_left = 30
offset_right = 150
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
@ -1245,14 +1323,26 @@ text = "Carrier"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 200
offset_right = 330
offset_left = 120
offset_right = 240
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
horizontal_alignment = 1
text = "Laser Ship"
[node name="VesselGLabel" type="Label" parent="UI/LabMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 210
offset_right = 330
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
horizontal_alignment = 1
text = "Distorder"
[node name="VesselUpgradeSeparator" type="ColorRect" parent="UI/LabMenu"]
mouse_filter = 2
anchor_right = 1.0
@ -1498,7 +1588,7 @@ anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -310
offset_right = -232
offset_right = -245
offset_top = -100
offset_bottom = 48
script = ExtResource("10")
@ -1511,7 +1601,7 @@ anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -330
offset_right = -212
offset_right = -225
offset_top = 56
offset_bottom = 136
theme_override_font_sizes/font_size = 24
@ -1523,8 +1613,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -202
offset_right = -124
offset_left = -221
offset_right = -156
offset_top = -100
offset_bottom = 48
script = ExtResource("10")
@ -1537,8 +1627,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -222
offset_right = -104
offset_left = -241
offset_right = -136
offset_top = 56
offset_bottom = 136
theme_override_font_sizes/font_size = 24
@ -1551,8 +1641,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -94
offset_right = -16
offset_left = -132
offset_right = -67
offset_top = -100
offset_bottom = 28
script = ExtResource("10")
@ -1565,8 +1655,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -114
offset_right = 4
offset_left = -152
offset_right = -47
offset_top = 56
offset_bottom = 150
theme_override_font_sizes/font_size = 24
@ -1579,8 +1669,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 14
offset_right = 92
offset_left = -43
offset_right = 22
offset_top = -100
offset_bottom = 48
script = ExtResource("10")
@ -1593,8 +1683,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -6
offset_right = 112
offset_left = -63
offset_right = 42
offset_top = 56
offset_bottom = 136
theme_override_font_sizes/font_size = 24
@ -1607,8 +1697,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 122
offset_right = 200
offset_left = 46
offset_right = 111
offset_top = -100
offset_bottom = 48
script = ExtResource("10")
@ -1621,8 +1711,8 @@ anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 102
offset_right = 220
offset_left = 26
offset_right = 131
offset_top = 56
offset_bottom = 136
theme_override_font_sizes/font_size = 24
@ -1630,6 +1720,34 @@ autowrap_mode = 2
text = "Laser Ship"
horizontal_alignment = 1
[node name="DistorderButton" type="Control" parent="UI/CraftMenu"]
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 135
offset_right = 200
offset_top = -100
offset_bottom = 48
script = ExtResource("10")
icon = 37
glow_color = Color(0.7, 0.3, 1, 1)
[node name="DistorderLabel" type="Label" parent="UI/CraftMenu"]
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 115
offset_right = 220
offset_top = 56
offset_bottom = 136
theme_override_font_sizes/font_size = 24
autowrap_mode = 2
text = "Distorder"
horizontal_alignment = 1
[node name="QueueLabel" type="Label" parent="UI/CraftMenu"]
mouse_filter = 2
anchor_left = 1.0