     nowHp[i - 1] = nowHps[i]
   [maxHp, nowHp]
 
+getResult = (damageHp, nowHp) ->
+  friendDamage = 0.0
+  enemyDamage = 0.0
+  friendDrop = 0
+  enemyDrop = 0
+  enemyCount = 0
+  for tmp, i in nowHp
+    continue if i == 0
+    if i < 6
+      enemyDamage += damageHp[i]
+    else
+      enemyCount += 1
+      friendDamage += damageHp[i]
+      if nowHp[i] - damageHp[i] <= 0
+        enemyDrop += 1
+  tmpResult = "不明"
+  if enemyDrop == enemyCount
+    tmpResult = "S"
+  else if enemyDrop >= Math.ceil(enemyCount * 1.0 / 2.0)
+    tmpResult = "A"
+  else if nowHp[6] - damageHp[6] <= 0 || friendDamage >= 2.5 * enemyDamage
+    tmpResult = "B"
+  else if friendDamage >= 1 * enemyDamage && friendDamage <= 2.5 * enemyDamage
+    tmpResult = "C"
+  else
+    tmpResult = "D"
+  tmpResult
+
 koukuAttack = (afterHp, kouku) ->
   if kouku.api_edam?
     for damage, i in kouku.api_edam

          if body.api_kouku2?
            afterHp = koukuAttack afterHp, body.api_kouku2.api_stage3
          damageHp = getDamage damageHp, nowHp, afterHp, 0
          nowHp = Object.clone afterHp

        when '/kcsapi/api_req_battle_midnight/battle'

          if body.api_raigeki?
            afterHp = raigekiAttack afterHp, body.api_raigeki
          if body.api_support_info?
            if body.api_support_info.api_support_airatack?
              afterHp = supportAttack afterHp, body.api_support_info.api_support_airatack.api_stage3.api_edam
            else if body.api_support_info.api_support_hourai?
              afterHp = supportAttack afterHp, body.api_support_info.api_support_hourai.api_damage
            else
              afterHp = supportAttack afterHp, body.api_support_info.api_damage
          damageHp = getDamage damageHp, nowHp, afterHp, 0
          result = getResult damageHp, nowHp
          nowHp = Object.clone afterHp

        when '/kcsapi/api_req_battle_midnight/sp_midnight'
