ShitboxInfinity/src/main.gd
m3ultra fd1218621b The Garage: shit-tier upgrade economy
Earn bucks from every mode (takedowns, outruns, escapes, derby kills, medals,
a cut of crash damage) and spend them on performance parts of deeply
questionable provenance: K-MART MEGA WING, GO-FASTER STRIPES, SERVO FLAME KIT,
BLINGY MAGS, SERVO NEONS, BUNNINGS DRAINPIPE, TURBO THRU THE BONNET. Every
part gives a real stat bump AND bolts a procedural eyesore onto the car, sized
off the model AABB so the same tat fits a BUBBLA or a Kingswood. Fully kitted:
+35% power, +1.1 grip, +0.55 boost.

Per-car, persistent (user://garage.save), player-only -- stats apply to a
DUPLICATE of the shared CarStats so tuning your Lazza doesn't secretly tune
every Lazza in the city, and the save path is redirectable so the smoke test
can never wipe real progression. Bolt-ons attach after the deformer snapshot:
the wing survives every crash, as is right and proper.

GARAGE button + bucks readout in the menu; shop screen with prices, blurbs and
FITTED states. Smoke covers the earn/buy/duplicate-stats roundtrip.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 10:50:55 +10:00

64 lines
2.3 KiB
GDScript

extends Control
## Menu: pick a car, a level and a mode from whatever exists, hit RACE.
const MODES := [["cruise", "Cruise"], ["crash", "Crash Mode"], ["race", "Race"],
["rage", "Road Rage"], ["drag", "Drag"], ["derby", "Derby"]]
const TIMES := [["day", "Day"], ["dusk", "Dusk"], ["night", "Night"]]
@onready var car_list: ItemList = $VBox/HBox/Cars
@onready var level_list: ItemList = $VBox/HBox/Levels
@onready var mode_list: ItemList = $VBox/HBox/Modes
@onready var time_list: ItemList = $VBox/HBox/Times
var car_paths: Array = []
var level_paths: Array = []
var junction_data: Array = []
func _ready() -> void:
var cars := Registry.cars()
for id in cars:
var stats: CarStats = load(cars[id])
car_list.add_item(stats.display_name)
car_paths.append(cars[id])
var levels := Registry.levels()
for id in levels:
level_list.add_item(String(id).capitalize())
level_paths.append(levels[id])
junction_data.append({})
for j in Registry.junctions():
level_list.add_item("CRASH JCT: %s (%s)" % [j.name, String(j.level_id).capitalize()])
level_paths.append(j.level_path)
junction_data.append(j.data)
for m in MODES:
mode_list.add_item(m[1])
for t in TIMES:
time_list.add_item(t[1])
time_list.select(0)
if not car_paths.is_empty():
car_list.select(0)
if not level_paths.is_empty():
level_list.select(0)
mode_list.select(0)
$VBox/Bucks.text = "BUCKS: $%d" % Garage.bucks()
$VBox/Buttons/Start.pressed.connect(_start)
$VBox/Buttons/Garage.pressed.connect(_garage)
func _garage() -> void:
if car_list.get_selected_items().is_empty():
return
Garage.ui_stats_path = car_paths[car_list.get_selected_items()[0]]
get_tree().change_scene_to_file("res://src/garage.tscn")
func _start() -> void:
if car_list.get_selected_items().is_empty() or level_list.get_selected_items().is_empty():
return
Game.car_path = car_paths[car_list.get_selected_items()[0]]
var li: int = level_list.get_selected_items()[0]
Game.level_path = level_paths[li]
Game.junction = junction_data[li]
# picking a CRASH JCT entry forces junction mode, whatever the mode column says
Game.mode = "junction" if not Game.junction.is_empty() else MODES[mode_list.get_selected_items()[0]][0]
var ti := time_list.get_selected_items()
Game.time_of_day = TIMES[ti[0]][0] if not ti.is_empty() else "day"
get_tree().change_scene_to_file("res://src/game.tscn")