Gas bombers consume gas from the fleet hold when firing #60
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Gas bomb shots are currently free. Make each shot cost gas from the fleet hold (
GameState.fleet_inventory), not from the bank - the fleet has to be carrying its own ammunition.Scope
const GAS_PER_SHOT: intonGasBombController(suggest 5).GasBombController._fire(): beforecomponent.consume_shot(COOLDOWN), requireGameState.fleet_resource(GameState.RESOURCE_GAS) >= GAS_PER_SHOTand withdraw it. If it cannot be paid, do not consume the bomber's cooldown, do not launch, and cancel the aim cleanly (_cancel_aim()).button.enabled = _next_ready_bomber() != null, to also require affordability - a control the player can press to no effect is exactly whatIconButton's "greyed but still pressable, and explains itself" convention exists to avoid.BuildControllerexplains an unaffordable build). No new modal.Acceptance criteria
GAS_PER_SHOTfrom the fleet hold.Tests
New
tests/test_gas_bomber_ammo.gd(bash tests/run_tests.sh bomber), plus the existingtest_gas_bomber.gdandtest_gas_bomber_cooldowns.gd, which will need fleet gas added to their setup.Repo notes (read before starting)
/storage/emulated/0/GodotProjects/SpaceshipTest.touchon it. Android FUSE does not bump mtime under~/storage/shared, and Godot's import cache will silently keep serving the old version, making a correct fix look like it did nothing.bash tests/run_tests.sh <substring>; full suite with no argument. Tests areSceneTreescripts printingTEST_NAME: PASS/TEST_NAME: FAIL (reason)and callingquit(0|1)- copy the shape oftests/test_capture_points.gd.bash tests/screenshot.sh <res://Scene.tscn> <out.png> <frames> 720x1280. Use few frames (~15); the software rasterizer is slow.--headlessrenders nothing at all, so it cannot validate visuals.NeonDraw/NeonPiece; do not introduce a different visual idiom.*Definitionresources plus capability component scenes. Do not addif type == "..."branches.FileAccess, nouser://).GameStateis an in-memory autoload. Do not invent a save system.Traps that have already cost hours on this codebase
const X = preload(...)in a test file that is itself the-sentry point. It evaluates during that file's own early compilation, which can run before autoloads are registered; any script it pulls in that referencesGameStateinside a function body then fails to compile withIdentifier not found: GameState. Usevar X: Scriptplusload()inside_initialize()instead. See the header comment intests/test_capture_points.gd.[]to a typedArray[Resource]export from another script fails at runtime - the compiler only sees the target asResourceand cannot confirm the element type. Leave the declared default alone, or build the typed array inside the owning script.Fleet.spawn_ships(0, ...)does not empty the fleet - it falls back to one default interceptor by design. Clearfleet.shipsexplicitly if a test or preview needs genuinely zero ships.ship.positionwithout also settingship.move_targetletsShip._physics_processsteer it straight back toward the stale target within a few frames.SceneTreetest's own_process()clock under device load, even with--fixed-fps 60. Gate waits on the system's own state (a component's timer or flag), not onelapsed >= duration.queue_free()s itself (projectiles, shells) must not be re-read inside a per-frame wait condition - cache the scalar you need before the wait._screenshot_tool.gd's_initialize(), so their_ready()races the game scene's own_ready(). Do setup on the first_process()tick, andget_tree().paused = trueonce everything is placed if the scene must hold still.