From 77ef9f58b39035b1ca7b5bd7aebdfcb7edf850d9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Mon, 20 Nov 2017 19:39:39 +0900 Subject: [PATCH] =?utf8?q?=E5=A4=9C=E6=88=A6=E3=81=A7=E6=88=A6=E8=89=A6?= =?utf8?q?=E3=81=8C=E6=94=BB=E6=92=83=E3=81=99=E3=82=8B=E3=81=A8=E3=82=A8?= =?utf8?q?=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=AE=E3=82=92?= =?utf8?q?=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KancolleSniffer.Test/SnifferTest.cs | 12 ++++++++++++ KancolleSniffer.Test/logs | 2 +- KancolleSniffer/BattleInfo.cs | 6 ++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/KancolleSniffer.Test/SnifferTest.cs b/KancolleSniffer.Test/SnifferTest.cs index 9fa3e37..52b3a47 100644 --- a/KancolleSniffer.Test/SnifferTest.cs +++ b/KancolleSniffer.Test/SnifferTest.cs @@ -94,6 +94,18 @@ namespace KancolleSniffer.Test } /// + /// 夜戦で戦艦が攻撃すると一回で三発分のデータが来る + /// そのうち存在しない攻撃はターゲット、ダメージともに-1になる + /// + [TestMethod] + public void BattleShipAttackInMidnight() + { + var sniffer = new Sniffer(); + SniffLogFile(sniffer, "midnight_001"); + PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.S); + } + + /// /// 出撃時に大破している艦娘がいたら警告する /// [TestMethod] diff --git a/KancolleSniffer.Test/logs b/KancolleSniffer.Test/logs index e3f682f..e3d8d9f 160000 --- a/KancolleSniffer.Test/logs +++ b/KancolleSniffer.Test/logs @@ -1 +1 @@ -Subproject commit e3f682fca7209563e965aa823830fb3fb4e3c9de +Subproject commit e3d8d9f2f3814e8af506c90063e0c68dfc2c8faf diff --git a/KancolleSniffer/BattleInfo.cs b/KancolleSniffer/BattleInfo.cs index ce46403..addc669 100644 --- a/KancolleSniffer/BattleInfo.cs +++ b/KancolleSniffer/BattleInfo.cs @@ -455,9 +455,11 @@ namespace KancolleSniffer { foreach (var hit in turn.t.Zip(turn.d, (t, d) => new {t, d})) { + if (hit.t == -1) + continue; if (turn.e == 1) { - if (0 <= hit.t && hit.t < 6) + if (hit.t < 6) { friend[hit.t].ApplyDamage(hit.d); } @@ -468,7 +470,7 @@ namespace KancolleSniffer } else { - if (0 <= hit.t && hit.t < 6) + if (hit.t < 6) { enemy[hit.t] -= hit.d; } -- 2.11.0