Complete lab, quest, garrison, and energy tickets

This commit is contained in:
Loïc Wisniewski 2026-09-03 00:12:08 +02:00
commit 0f7edff15a
20 changed files with 238 additions and 45 deletions

View file

@ -3,6 +3,7 @@ extends Area2D
signal destroyed
const VESSEL_DEFINITIONS = preload("res://vessels/VesselDefinitions.gd")
const COMBAT_TARGET = preload("res://core/CombatTarget.gd")
@export var max_speed: float = 460.0
@export var acceleration: float = 450.0
@ -200,17 +201,14 @@ func _breakaway_direction() -> Vector2:
func _on_area_entered(area: Area2D) -> void:
if not (area.is_in_group("enemies") or area.is_in_group("asteroids")):
if not area.is_in_group(COMBAT_TARGET.GROUP):
return
# The enemy is told about the impact BEFORE this ship resolves its own
# damage, because resolving it can free this node - and a ship that dies
# to a ramming chaser must still take the chaser with it. Whether the
# impact actually destroys the enemy is the enemy's decision (#82).
if area.is_in_group("enemies") and area.has_method("collide_with_player_vessel"):
# A target is told about the impact BEFORE this ship resolves its own
# damage, because resolving it can free this node. Whether the impact does
# anything to the target is part of that target's composition (#82).
if area.has_method("collide_with_player_vessel"):
area.collide_with_player_vessel()
var absorbed: bool = take_damage(1)
if absorbed and area.is_in_group("asteroids") and is_instance_valid(area):
area.queue_free()
take_damage(1)
func _draw() -> void: