id: ZACUS_V1_UNLOCK_ETAPE2
version: 2
initial_step: STEP_WAIT_UNLOCK

app_bindings:
  - id: APP_LA
    app: LA_DETECTOR
    config:
      hold_ms: 3000
      unlock_event: UNLOCK
      require_listening: true
  - id: APP_AUDIO
    app: AUDIO_PACK
  - id: APP_SCREEN
    app: SCREEN_SCENE
  - id: APP_GATE
    app: MP3_GATE

steps:
  - step_id: STEP_WAIT_UNLOCK
    screen_scene_id: SCENE_LOCKED
    audio_pack_id: ""
    actions: [ACTION_TRACE_STEP]
    apps: [APP_LA, APP_SCREEN, APP_GATE]
    mp3_gate_open: false
    transitions:
      - trigger: on_event
        event_type: unlock
        event_name: UNLOCK
        target_step_id: STEP_UNLOCK_WIN
        after_ms: 0
        priority: 100

  - step_id: STEP_UNLOCK_WIN
    screen_scene_id: SCENE_REWARD
    audio_pack_id: PACK_WIN
    actions: [ACTION_TRACE_STEP]
    apps: [APP_AUDIO, APP_SCREEN, APP_GATE]
    mp3_gate_open: false
    transitions:
      - trigger: on_event
        event_type: audio_done
        event_name: AUDIO_DONE
        target_step_id: ETAPE2_HINT
        after_ms: 0
        priority: 100

  - step_id: ETAPE2_HINT
    screen_scene_id: SCENE_INFO
    audio_pack_id: PACK_ETAPE2_HINT
    actions: [ACTION_TRACE_STEP]
    apps: [APP_AUDIO, APP_SCREEN, APP_GATE]
    mp3_gate_open: false
    transitions:
      - trigger: after_ms
        event_type: timer
        event_name: DELAY_ETAPE2
        target_step_id: STEP_DONE
        after_ms: 12000
        priority: 90

  - step_id: STEP_DONE
    screen_scene_id: SCENE_READY
    audio_pack_id: ""
    actions: [ACTION_TRACE_STEP, ACTION_REFRESH_SD]
    apps: [APP_SCREEN, APP_GATE]
    mp3_gate_open: true
    transitions: []
