Add laser ship vessel and its skill shot (#58)
A manually aimed instant beam, modelled on the gas bomber's press-drag-
release aiming (GasBombController/VesselGasBomberComponent) but firing
the moment the touch releases - no projectile travel time. Damage,
beam_range and cooldown are resolved per ship from base_stats/upgrades
(VesselLaserComponent.apply_stats(), the same pattern
VesselWeaponComponent uses) rather than hardcoded in the controller, so
the new damage/range/cooldown ship-lab upgrades actually reach them.
Cooldown lives on the component (per ship), not the controller (per
fleet) - two laser ships give two shots, the exact bug already fixed
for bombers in eb79efd.
LaserController.gd is reused unmodified by both Main.tscn and
PlanetSurface.tscn (relative ../Fleet, ../Camera2D, ../UI/LaserButton
paths, matching GasBombController), so it works identically in space
and on a landed surface. Wired into GameController's touch/drag
first-refusal chain alongside the bomb controller.
The crafter, hangar and ship-lab menus were already generic over
VesselDefinitions.fleet()/.all() - only the per-vessel Main.tscn nodes
are hand-placed, not the logic - so this repacks those rows to
5/5/6 columns and extends BuildController's onready arrays. No new
signal handlers were needed. Also fixes test_vessel_composition.gd's
hardcoded fleet-catalog size again (4 -> 5) now that laser is a fifth
fleet-eligible vessel.
Note for later tickets: a brand-new class_name script (LaserController)
resolves fine as a static type when its own file is the godot -s entry
point, but the identical type hint fails to parse ("Could not find
type") when the script holding it is only reached indirectly - e.g.
Main.tscn loaded from inside a _screenshot_tool.gd preview. Untyped
Node + duck-typed calls sidesteps it; GameController.gd's
laser_controller field documents this in place.
This commit is contained in:
parent
bbb1d4b0c5
commit
ed46cd77e6
18 changed files with 858 additions and 64 deletions
|
|
@ -38,6 +38,9 @@ enum Icon {
|
|||
# Same append-only rule (#57): a wide hauler hull, distinct from every
|
||||
# vessel glyph above.
|
||||
CARRIER_VESSEL,
|
||||
# #58: LASER_VESSEL is the ship glyph, LASER_SHOT the action button -
|
||||
# same two-icon split as GAS_BOMBER/GAS_BOMB above.
|
||||
LASER_VESSEL, LASER_SHOT,
|
||||
}
|
||||
|
||||
# Size the glyphs were originally drawn against. Every glyph dimension is
|
||||
|
|
@ -232,6 +235,10 @@ func _draw() -> void:
|
|||
_draw_gas_burner_icon(center, pulse, s)
|
||||
Icon.CARRIER_VESSEL:
|
||||
_draw_carrier(center, pulse, s)
|
||||
Icon.LASER_VESSEL:
|
||||
_draw_laser_vessel(center, pulse, s)
|
||||
Icon.LASER_SHOT:
|
||||
_draw_laser_shot(center, pulse, s)
|
||||
|
||||
|
||||
func _draw_close(center: Vector2, pulse: float, s: float) -> void:
|
||||
|
|
@ -270,6 +277,26 @@ func _draw_carrier(center: Vector2, pulse: float, s: float) -> void:
|
|||
NeonDraw.draw_glowing_polygon(self, hull, _active_color(), pulse, core_color)
|
||||
|
||||
|
||||
func _draw_laser_vessel(center: Vector2, pulse: float, s: float) -> void:
|
||||
# A slim dart rather than the interceptor's plain triangle - the notch at
|
||||
# the nose reads as a fixed forward-facing emitter, not a hull point.
|
||||
var hull := PackedVector2Array([
|
||||
center + Vector2(0, -13) * s,
|
||||
center + Vector2(-8, 9) * s,
|
||||
center + Vector2(-3, 6) * s,
|
||||
center + Vector2(3, 6) * s,
|
||||
center + Vector2(8, 9) * s,
|
||||
])
|
||||
NeonDraw.draw_glowing_polygon(self, hull, _active_color(), pulse, core_color)
|
||||
|
||||
|
||||
func _draw_laser_shot(center: Vector2, pulse: float, s: float) -> void:
|
||||
var from: Vector2 = center + Vector2(-9, 9) * s
|
||||
var to: Vector2 = center + Vector2(9, -9) * s
|
||||
NeonDraw.draw_glowing_line(self, from, to, _active_color(), pulse, 1.1, core_color)
|
||||
NeonDraw.draw_glowing_circle(self, to, 3.0 * s, _active_color(), pulse, core_color)
|
||||
|
||||
|
||||
func _draw_gas_bomber(center: Vector2, pulse: float, s: float) -> void:
|
||||
var hull := PackedVector2Array([
|
||||
center + Vector2(0, -12) * s,
|
||||
|
|
|
|||
Loading…
Reference in a new issue