Sharpen upgrades, mark the convoy's destination, and give the world sound
#204 the Beam Collimator widens the beam instead of adding range to one that already crosses the screen; beam width becomes a per-shot vessel stat. #205 the Energy Propulser gains three upgrades - dash recharge, dash reach, and boosted-cruise drain - which turns three constants into vessel stats. #206 three further doctrines carry the fleet from ten to twenty. #207 the prologue's World Ship gets a marker, through the scanner's own guidance arrow rather than a second one. #208 #210 #213 #214 four new synthesised sounds: the breach opening, cargo reaching the hold, a rock breaking, and a gas bomb blooming. #215 building health bars are larger, plated and framed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
This commit is contained in:
parent
2239235993
commit
78836882af
33 changed files with 716 additions and 52 deletions
|
|
@ -27,7 +27,6 @@ const DRAG_RADIUS: float = 260.0
|
|||
# it on the edge of the screen, which is the half that matters when the point
|
||||
# of dragging further is to reach past what is already close.
|
||||
const FRAMING_FACTOR: float = 2.0
|
||||
const BEAM_HALF_WIDTH := BEAM_EFFECT.BEAM_HALF_WIDTH
|
||||
const FLASH_DURATION := BEAM_EFFECT.FLASH_DURATION
|
||||
const ENERGY_PER_SHOT: int = VesselLaserComponent.ENERGY_PER_SHOT
|
||||
|
||||
|
|
@ -44,10 +43,22 @@ func _status_path() -> NodePath: return "../UI/LaserStatus"
|
|||
func _component_id() -> String: return "laser"
|
||||
func _ammo_resource() -> String: return GameState.RESOURCE_ENERGY
|
||||
func _ammo_cost() -> int: return ENERGY_PER_SHOT
|
||||
func _aim_padding() -> float: return BEAM_HALF_WIDTH
|
||||
func _aim_padding() -> float: return _aim_half_width()
|
||||
func _has_effect_visuals() -> bool: return not beams.is_empty()
|
||||
|
||||
|
||||
# The width the next shot will cut, off the hull that will cut it. Same shape
|
||||
# and same reason as _aim_max_range() below: #204 made this upgradeable, so a
|
||||
# constant here would draw last research's beam.
|
||||
func _aim_half_width() -> float:
|
||||
var ship: Node2D = _next_ready_ship()
|
||||
if ship != null:
|
||||
var component: Node = ship.get_component(_component_id())
|
||||
if component != null:
|
||||
return component.beam_half_width
|
||||
return GameState.vessel_stat(GameState.VESSEL_LASER, "beam_half_width")
|
||||
|
||||
|
||||
func _aim_max_range() -> float:
|
||||
# Falls back to the VESSEL DEFINITION's own beam_range, not to a copy of
|
||||
# the number. This used to hardcode 950.0 in both branches, which silently
|
||||
|
|
@ -108,7 +119,8 @@ func _perform_shot(ship: Node2D, component: Node) -> void:
|
|||
var direction: Vector2 = aim_target - ship.global_position
|
||||
direction = direction.normalized() if direction.length() > 0.001 else Vector2.UP
|
||||
var effect: Node2D = BEAM_EFFECT.fire(get_tree().root, ship.global_position,
|
||||
direction, component.beam_range, int(component.damage))
|
||||
direction, component.beam_range, int(component.damage),
|
||||
component.beam_half_width)
|
||||
beams.append(effect)
|
||||
last_hit_count = int(effect.hit_count)
|
||||
|
||||
|
|
@ -160,14 +172,14 @@ func _draw() -> void:
|
|||
# units puts the camera far enough out that a mark measured in world units
|
||||
# would be a few pixels of nothing at the moment it matters most.
|
||||
var across: Vector2 = far_end.direction_to(origin).orthogonal() \
|
||||
* _screen_units(END_TICK_PIXELS)
|
||||
* maxf(_aim_half_width(), _screen_units(END_TICK_PIXELS))
|
||||
NeonDraw.draw_glowing_line(self, far_end - across, far_end + across,
|
||||
TARGET_COLOR, 0.7, 0.5)
|
||||
# What the assist picked, when that is nearer than the far end. The line
|
||||
# still runs past it - everything behind it on the same line is hit too.
|
||||
if origin.distance_to(aim_target) < reach - 1.0:
|
||||
NeonDraw.draw_glowing_circle(self, aim_target,
|
||||
maxf(BEAM_HALF_WIDTH, _screen_units(TARGET_RING_PIXELS)),
|
||||
maxf(_aim_half_width(), _screen_units(TARGET_RING_PIXELS)),
|
||||
TARGET_COLOR, 0.7)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue