#77 - the Distorder becomes the Energy Propulser. Renamed everywhere the player reads it, reskinned to match: a symmetric hull flaring into an engine skirt instead of the lopsided warped lump, an engine bell with a thrust plume instead of the wobbling ring glyph, and energy's own yellow instead of purple, since energy is what it burns. The internal id stays "distorder" - it is the capability string, the unlock key and the component scene name, and renaming the wiring would be a large mechanical change with no player-visible effect. Its speed ceiling now grows with the LOGARITHM of how many fly. Each one used to add a flat 1.0, so a fleet that could afford six simply drove at six times cruise and the vessel stopped being a choice. Base-2 makes the rule one sentence - every doubling adds another 1.0 - and leaves two propulsers worth exactly what they were worth before, so nothing already built is devalued. #78 - a gas burner can be paused. It converts gas the player may want for bombs into energy they may not need yet, and the only way to stop it was to demolish it. The action is data-driven like every other: the visual's ActionProvider lists "pause", and any converter can adopt it. Pause is the burner's PRIMARY action, so it is one tap rather than a menu; the button shows what it will DO, bars while running and a play triangle while stopped; and the building itself goes visibly cold, because a paused building that looked identical to a running one would be a setting to remember rather than see. Conversion progress is left where it was rather than reset, so switching off and on again does not discard a part-finished unit. #79 - picking something up says so. A "+N" with the resource's own mark rises and fades where it happened. Built from the SAME glyph the resource tables and transfer rows use, so a material added to the catalog later cannot end up with one mark in the HUD and a different one in the world. A pickup a full hold REFUSES raises nothing. Two Godot traps cost real time here and are now written down where the next person will hit them: - a `#` comment inside a .tres [resource] block is not a comment. It parses as part of the preceding value and silently blanks the property after it. One in DistorderVesselDefinition.tres left definition_id empty, which surfaced as "<blank> did not resolve its definition" in a test far from the edit. The note lives in VesselDefinition.gd now. - a global class_name is not reliably resolvable, INCLUDING a script's own inside its own static function. ResourcePickupVFX.new() failed to compile when reached through a preview scene, taking Rock and the gas vents with it. It has no class_name now and constructs itself by path. Suite 114/114. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
b999031e6a
commit
54287d27ea
14 changed files with 648 additions and 41 deletions
51
GameState.gd
51
GameState.gd
|
|
@ -31,8 +31,8 @@ var planet_definition_id: String = "rocky"
|
|||
# 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.
|
||||
# The ceiling ONE distorder vessel reaches. Each ADDITIONAL one raises it by
|
||||
# another 1.0 - see set_distorder_vessel_count(). Kept as the one-vessel
|
||||
# The ceiling ONE Energy Propulser reaches. Every DOUBLING of them raises it
|
||||
# by another 1.0 - see set_distorder_vessel_count(). Kept as the one-vessel
|
||||
# figure rather than an absolute cap so the fader's meaning at a single
|
||||
# vessel is unchanged.
|
||||
const MAX_FLEET_SPEED_MULTIPLIER: float = 3.0
|
||||
|
|
@ -67,8 +67,23 @@ func set_fleet_speed_multiplier(value: float) -> void:
|
|||
# Re-clamps the CURRENT multiplier, so losing a distorder vessel mid-boost
|
||||
# pulls the fleet down to the new ceiling instead of leaving it travelling
|
||||
# faster than its remaining crew can sustain.
|
||||
# #77: the ceiling grows with the LOGARITHM of how many propulsers fly, not
|
||||
# linearly. Each one used to add a flat 1.0, so a fleet that could afford six
|
||||
# of them simply drove at six times cruise and the vessel stopped being a
|
||||
# choice. Base-2, which makes the rule one sentence: every DOUBLING of
|
||||
# propulsers buys another 1.0.
|
||||
#
|
||||
# 1 -> 3.0 2 -> 4.0 4 -> 5.0 8 -> 6.0
|
||||
#
|
||||
# Two propulsers are worth exactly what they were worth before, so nothing a
|
||||
# player has already built is devalued; it is the fifth and sixth that stop
|
||||
# paying for themselves.
|
||||
func set_distorder_vessel_count(count: int) -> void:
|
||||
max_fleet_speed_multiplier = MAX_FLEET_SPEED_MULTIPLIER + maxf(float(count) - 1.0, 0.0)
|
||||
if count <= 1:
|
||||
max_fleet_speed_multiplier = MAX_FLEET_SPEED_MULTIPLIER
|
||||
return
|
||||
max_fleet_speed_multiplier = MAX_FLEET_SPEED_MULTIPLIER \
|
||||
+ log(float(count)) / log(2.0)
|
||||
set_fleet_speed_multiplier(fleet_speed_multiplier)
|
||||
|
||||
|
||||
|
|
@ -1337,6 +1352,31 @@ func _collectable_building_resource(building: Dictionary, minimum_amount: int) -
|
|||
return ""
|
||||
|
||||
|
||||
# #78: a converter can be switched off. A gas burner turns gas the player may
|
||||
# want for bombs into energy they may not need yet, and until now it did that
|
||||
# relentlessly - the only way to stop it was to demolish it. Paused is stored
|
||||
# on the building record like every other piece of its state.
|
||||
func is_building_paused(id: int) -> bool:
|
||||
return bool(find_building(id).get("paused", false))
|
||||
|
||||
|
||||
func set_building_paused(id: int, paused: bool) -> void:
|
||||
var building: Dictionary = find_building(id)
|
||||
if building.is_empty():
|
||||
return
|
||||
building.paused = paused
|
||||
building_paused_changed.emit(id, paused)
|
||||
|
||||
|
||||
func toggle_building_paused(id: int) -> bool:
|
||||
var paused: bool = not is_building_paused(id)
|
||||
set_building_paused(id, paused)
|
||||
return paused
|
||||
|
||||
|
||||
signal building_paused_changed(id: int, paused: bool)
|
||||
|
||||
|
||||
func _advance_resource_converters(delta: float) -> void:
|
||||
for building in buildings:
|
||||
var profile: Resource = building_logistics_profile(building)
|
||||
|
|
@ -1344,6 +1384,11 @@ func _advance_resource_converters(delta: float) -> void:
|
|||
or profile.conversion_output == "" or profile.conversion_rate <= 0.0 \
|
||||
or profile.conversion_yield <= 0:
|
||||
continue
|
||||
if bool(building.get("paused", false)):
|
||||
# Progress is left exactly where it was rather than reset, so
|
||||
# switching a burner off and on again does not throw away the
|
||||
# fraction of a unit it had already worked through.
|
||||
continue
|
||||
var inventory: RefCounted = _inventory_for_record(building)
|
||||
if inventory.amount(profile.conversion_input) <= 0:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in a new issue