Add tentacled boss planet encounter

This commit is contained in:
Loïc Wisniewski 2026-09-03 10:33:05 +02:00
commit 40f284dcdd
38 changed files with 1051 additions and 19 deletions

View file

@ -1,6 +1,8 @@
class_name LaserBeamEffect
extends Node2D
const COMBAT_TARGET = preload("res://core/CombatTarget.gd")
# The laser shot itself: the strike and the picture of it, with nothing in it
# about who fired or why.
#
@ -71,11 +73,9 @@ static func fire(world: Node, origin: Vector2, direction: Vector2,
func _strike(direction: Vector2, damage: int) -> void:
hit_count = 0
var range_along: float = from.distance_to(to)
# Asteroids share the enemies' take_damage() contract, so the beam sweeps
# both groups in one pass. Shooting a path clear through a field is a
# perfectly good use of a laser, and the ore it leaves behind is the point.
for enemy in get_tree().get_nodes_in_group("enemies") \
+ get_tree().get_nodes_in_group("asteroids"):
# Every attackable composition shares this contract, including opened boss
# eyes. Shooting a path through an asteroid field still works unchanged.
for enemy in get_tree().get_nodes_in_group(COMBAT_TARGET.GROUP):
if not is_instance_valid(enemy) or not (enemy is Node2D):
continue
var to_enemy: Vector2 = enemy.global_position - from