# stages.yaml - Configuració de les fases d'Orni Attack
# © 2026 JailDesigner
#
# Format basat en onades (waves). Cada wave:
#   - spawn: list d'enemics a generar, en ordre.
#   - spawn_interval: segons entre spawns interns (default 0 = simultanis).
#   - next: condició per avançar a la wave següent.
#       - "all_dead" / "end" → quan tots els enemics de l'arena han mort.
#       - { timeout: T }     → quan han passat T segons des de l'inici de la wave.
#       - { all_dead: true, timeout: T } → el que arribe abans (amuntegament si vas lent).
#
# Tipus d'enemic: pentagon, square (alias: cuadrado), pinwheel (alias: molinillo), star, orb.

metadata:
  version: "2.0"
  total_stages: 10
  description: "Wave-based progression"

stages:
  # STAGE 1 — Tutorial: contacte amb pentagons i un cuadrado.
  # (Test: també hi ha un orb a la primera onada per provar el contra-atac.)
  - stage_id: 1
    multipliers: { velocity: 0.85, rotation: 0.9, tracking: 0.3 }
    waves:
      - spawn: [pentagon, pentagon, orb]
        spawn_interval: 0.6
        next: all_dead
      - spawn: [pentagon, pentagon, square]
        spawn_interval: 0.5
        next: all_dead
      - spawn: [pentagon, pentagon, square, square]
        spawn_interval: 0.4
        next: end

  # STAGE 2 — Apareixen molinillos.
  - stage_id: 2
    multipliers: { velocity: 0.95, rotation: 1.0, tracking: 0.4 }
    waves:
      - spawn: [pentagon, pentagon, pentagon]
        spawn_interval: 0.5
        next: all_dead
      - spawn: [pinwheel]
        next: all_dead
      - spawn: [pentagon, square, pinwheel]
        spawn_interval: 0.6
        next: all_dead
      - spawn: [pinwheel, pinwheel, pentagon]
        spawn_interval: 0.5
        next: end

  # STAGE 3 — Primer orb (HP=10).
  - stage_id: 3
    multipliers: { velocity: 1.0, rotation: 1.0, tracking: 0.5 }
    waves:
      - spawn: [pentagon, pentagon, square]
        spawn_interval: 0.4
        next: all_dead
      - spawn: [orb]
        next: { all_dead: true, timeout: 12.0 }
      - spawn: [pinwheel, pinwheel]
        spawn_interval: 0.5
        next: all_dead
      - spawn: [pentagon, square, pinwheel, pinwheel]
        spawn_interval: 0.4
        next: end

  # STAGE 4 — Pressió creixent: timeouts curts que poden encavalcar onades.
  - stage_id: 4
    multipliers: { velocity: 1.05, rotation: 1.1, tracking: 0.6 }
    waves:
      - spawn: [pentagon, pentagon, pentagon]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 5.0 }
      - spawn: [square, square]
        spawn_interval: 0.4
        next: { all_dead: true, timeout: 6.0 }
      - spawn: [pinwheel, pinwheel, pinwheel]
        spawn_interval: 0.4
        next: all_dead
      - spawn: [orb, pentagon, pentagon]
        spawn_interval: 0.5
        next: end

  # STAGE 5 — Apareix la star (zigzag clon del pentagon).
  - stage_id: 5
    multipliers: { velocity: 1.1, rotation: 1.2, tracking: 0.7 }
    waves:
      - spawn: [star, star]
        spawn_interval: 0.4
        next: all_dead
      - spawn: [pentagon, square, star]
        spawn_interval: 0.4
        next: { all_dead: true, timeout: 6.0 }
      - spawn: [pinwheel, pinwheel, star, star]
        spawn_interval: 0.4
        next: all_dead
      - spawn: [orb, square, square]
        spawn_interval: 0.5
        next: end

  # STAGE 6 — Densitat alta, mix amb timeouts agressius.
  - stage_id: 6
    multipliers: { velocity: 1.15, rotation: 1.25, tracking: 0.8 }
    waves:
      - spawn: [pentagon, pinwheel, pentagon, pinwheel]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 5.0 }
      - spawn: [square, square, star]
        spawn_interval: 0.4
        next: { all_dead: true, timeout: 5.0 }
      - spawn: [pinwheel, pinwheel, pinwheel]
        spawn_interval: 0.3
        next: all_dead
      - spawn: [orb, pinwheel, pinwheel]
        spawn_interval: 0.4
        next: end

  # STAGE 7 — Tiradors i agressivitat.
  - stage_id: 7
    multipliers: { velocity: 1.25, rotation: 1.35, tracking: 0.9 }
    waves:
      - spawn: [square, square, square]
        spawn_interval: 0.5
        next: { all_dead: true, timeout: 6.0 }
      - spawn: [pinwheel, pinwheel, pentagon, pentagon]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 5.0 }
      - spawn: [star, star, star]
        spawn_interval: 0.4
        next: all_dead
      - spawn: [orb, pinwheel, pinwheel, square]
        spawn_interval: 0.5
        next: end

  # STAGE 8 — Pressió constant.
  - stage_id: 8
    multipliers: { velocity: 1.35, rotation: 1.45, tracking: 1.0 }
    waves:
      - spawn: [pinwheel, pinwheel, pinwheel]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 4.0 }
      - spawn: [square, square, star, star]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 5.0 }
      - spawn: [orb]
        next: { all_dead: true, timeout: 8.0 }
      - spawn: [pinwheel, pinwheel, square, star, pentagon]
        spawn_interval: 0.3
        next: end

  # STAGE 9 — Quasi-final.
  - stage_id: 9
    multipliers: { velocity: 1.5, rotation: 1.6, tracking: 1.1 }
    waves:
      - spawn: [pinwheel, pinwheel, star, star]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 4.0 }
      - spawn: [orb, square, square]
        spawn_interval: 0.4
        next: { all_dead: true, timeout: 8.0 }
      - spawn: [pinwheel, pinwheel, pinwheel, pinwheel]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 5.0 }
      - spawn: [orb, pinwheel, pinwheel, square, star]
        spawn_interval: 0.4
        next: end

  # STAGE 10 — Repte final.
  - stage_id: 10
    multipliers: { velocity: 1.7, rotation: 1.8, tracking: 1.2 }
    waves:
      - spawn: [pinwheel, pinwheel, pinwheel, pinwheel]
        spawn_interval: 0.25
        next: { all_dead: true, timeout: 4.0 }
      - spawn: [orb, square, star]
        spawn_interval: 0.4
        next: { all_dead: true, timeout: 6.0 }
      - spawn: [pinwheel, pinwheel, star, star, square]
        spawn_interval: 0.3
        next: { all_dead: true, timeout: 5.0 }
      - spawn: [orb, orb, pinwheel, pinwheel, star]
        spawn_interval: 0.4
        next: end
