json.api_at_eflag() && json.api_at_eflag != null))\r
return;\r
\r
- var targets = ((dynamic[])json.api_df_list).Select(x => (int[])x);\r
- var damages = ((dynamic[])json.api_damage).Select(x => (int[])x);\r
+ var targets = (int[][])json.api_df_list;\r
+ var damages = (int[][])json.api_damage;\r
var eflags = (int[])json.api_at_eflag;\r
- foreach (var turn in\r
- targets.Zip(damages, (t, d) => new {t, d}).Zip(eflags, (td, e) => new {e, td.t, td.d}))\r
+\r
+ for (var i = 0; i < eflags.Length; i++)\r
{\r
- foreach (var hit in turn.t.Zip(turn.d, (t, d) => new {t, d}))\r
+ // 一度に複数の目標を狙う攻撃はないものと仮定する\r
+ var hit = new {t = targets[i][0], d = damages[i].Sum()};\r
+ if (hit.t == -1)\r
+ continue;\r
+ if (eflags[i] == 1)\r
+ {\r
+ if (hit.t < _friend.Length)\r
+ {\r
+ _friend[hit.t].ApplyDamage(hit.d);\r
+ }\r
+ else\r
+ {\r
+ _guard[hit.t - 6].ApplyDamage(hit.d);\r
+ }\r
+ }\r
+ else\r
{\r
- if (hit.t == -1)\r
- continue;\r
- if (turn.e == 1)\r
+ if (hit.t < _enemyHp.Length)\r
{\r
- if (hit.t < _friend.Length)\r
- {\r
- _friend[hit.t].ApplyDamage(hit.d);\r
- }\r
- else\r
- {\r
- _guard[hit.t - 6].ApplyDamage(hit.d);\r
- }\r
+ _enemyHp[hit.t] -= hit.d;\r
}\r
else\r
{\r
- if (hit.t < _enemyHp.Length)\r
- {\r
- _enemyHp[hit.t] -= hit.d;\r
- }\r
- else\r
- {\r
- _enemyGuardHp[hit.t - 6] -= hit.d;\r
- }\r
+ _enemyGuardHp[hit.t - 6] -= hit.d;\r
}\r
}\r
}\r