     when '/kcsapi/api_req_battle_midnight/sp_midnight'
       battled = true
       enemyShipId = body.api_ship_ke.slice 1, 7
+      enemyFormation = body.api_formation[1] if body.api_formation?
       nowHp = body.api_nowhps.slice 1, 13
       hougekiAttack nowHp, body.api_hougeki if body.api_hougeki?
     when '/kcsapi/api_req_sortie/airbattle'
       battled = true
       enemyShipId = body.api_ship_ke.slice 1, 7
+      enemyFormation = body.api_formation[1] if body.api_formation?
       nowHp = body.api_nowhps.slice 1, 13
       koukuAttack nowHp, body.api_kouku.api_stage3 if body.api_kouku? && body.api_kouku.api_stage3?
       koukuAttack nowHp, body.api_kouku2.api_stage3 if body.api_kouku2? && body.api_kouku2.api_stage3?

      nowHp = []
      enemyShipId = []
      colorNo = -1
    when '/kcsapi/api_req_sortie/battle'
      battled = true
      enemyShipId = body.api_ship_ke.slice 1, 7
      nowHp = body.api_nowhps.slice 1, 13
      koukuAttack nowHp, body.api_kouku.api_stage3 if body.api_kouku.api_stage3?
      openAttack nowHp, body.api_opening_atack if body.api_opening_atack?

battled = false
nowHp = []
enemyShipId = []
# Formation: 0 - 単縦陣, 1 - 複縦陣, 2 - 輪形陣, 3 - 梯形陣, 4 - 単横陣,
# 5 - 第一警戒航行序列, 6 - 第二警戒航行序列, 7 - 第三警戒航行序列, 8 - 第四警戒航行序列
enemyFormation = 0
colorNo = -1

koukuAttack = (nowHp, kouku) ->
