@startuml
'==============================
'【誘発アクション処理】（即時・通常 統合）
'==============================

start
note right
  呼び出し元から次の条件が指定されます:
  ・対象プレイヤー
  ・タイミング（メイン/クイック）
  ・スピード（即時/通常）
end note
while ([6-D-1] バッファから指定条件に\n該当するリクエストはあるか？) is (Yes)
  :[6-D-2] バッファからリクエストを取り出す;

  if ([6-D-3] スピード=即時か？) then (Yes)
    '--- 即時処理 ---
    :[6-D-4] 取り出したリクエストを解決する;
    if ([6-D-5] 勝敗判定) then (決着)
      stop
    endif
  else (No)
    '--- 通常処理 ---
    if ([6-D-6] タイミング=メインか？) then (Yes)
      if ([6-D-7] ステージが空か？) then (Yes)
        :[6-D-8] リクエストをステージに追加;
      else (No)
        :[6-D-9] リクエストを破棄;
      endif
    else (No)
      :[6-D-10] リクエストをステージに追加;
    endif
  endif

  if ([6-D-11] リクエストが新たな誘発を発生させたか？) then (Yes)
    :[6-D-12] 誘発したリクエストをバッファに追加;
    note left
      誘発したリクエストのコントローラーは
      起因となったアクションのオーナー
      になります。
    end note
  endif
endwhile (No)
stop
@enduml
