From 9e6d53867a94dd49fb81c8e8ad344214e1f3ce18 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 6 May 2026 23:31:12 +0200 Subject: [PATCH] feat(game): add special stage type every 3rd level Every 3rd stage (3, 6, 9, ...) is now a special stage with no enemy dive attacks and no enemy shooting. Enemies still spawn in the default grid formation (32 enemies) but remain in formation without attacking. Changes: - Add SPECIAL_STAGE_INTERVAL constant and is_special_stage() function - Add special_stage config to StageConfigurations with empty attack_patterns - Modify for_stage() to route special stages to special config - Guard enemy_shoot system to skip shooting during special stages - Show '*' suffix in window title for special stages Refs: GAL-39 --- src/constants.rs | 3 + src/enemy.rs | 5 ++ src/resources.rs | 31 +++++++-- src/systems.rs | 9 ++- tests/special_stage.rs | 140 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 182 insertions(+), 6 deletions(-) create mode 100644 tests/special_stage.rs diff --git a/src/constants.rs b/src/constants.rs index 61828df..42db1da 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -47,6 +47,9 @@ pub const BEAM_CORE_COLOR: Color = Color::srgba(0.7, 0.2, 1.0, 0.7); pub const BEAM_PULSE_FREQ: f32 = 3.0; pub const BEAM_PULSE_AMPLITUDE: f32 = 0.15; +// Special stages +pub const SPECIAL_STAGE_INTERVAL: u32 = 3; + // Starfield pub const STAR_COUNT: usize = 150; pub const STAR_MIN_SIZE: f32 = 1.0; diff --git a/src/enemy.rs b/src/enemy.rs index 2d7bee2..20f59c8 100644 --- a/src/enemy.rs +++ b/src/enemy.rs @@ -12,6 +12,7 @@ use crate::constants::{ }; use crate::resources::{ AttackDiveTimer, CurrentStage, EnemySpawnTimer, FormationState, StageConfigurations, + is_special_stage, }; const BOSS_BASE_CHANCE: f32 = 0.30; @@ -341,7 +342,11 @@ pub fn enemy_shoot( mut commands: Commands, time: Res