From 4ba2419acb9165bafe44277a55555ad144fb6fc9 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Wed, 11 May 2022 22:42:55 +0200 Subject: add Ankka CM detection --- CHANGELOG.md | 2 ++ src/analyzers/strikes.rs | 5 +++-- tests/challenge_motes.rs | 1 + tests/logs/cms/ankka.zevtc | Bin 0 -> 311529 bytes 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 tests/logs/cms/ankka.zevtc diff --git a/CHANGELOG.md b/CHANGELOG.md index e243e79..9e9bc6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. ## Unreleased +### Added +- Support for Xunlai Jade Junkyard with the Challenge Mote active ## 0.7.2 - 2022-04-20 ### Added diff --git a/src/analyzers/strikes.rs b/src/analyzers/strikes.rs index bc994e4..02c2217 100644 --- a/src/analyzers/strikes.rs +++ b/src/analyzers/strikes.rs @@ -135,6 +135,8 @@ impl<'log> Ankka<'log> { pub const DURATION_CUTOFF: i32 = i32::MAX; /// The expected number of times that Ankka needs to phase before we consider it a success. pub const EXPECTED_PHASE_COUNT: usize = 3; + /// Cutoff for when the fight is considered CM. + pub const ANKKA_CM_HEALTH: u64 = 50_000_000; /// Create a new [`Ankka`] analyzer for the given log. /// @@ -151,8 +153,7 @@ impl<'log> Analyzer for Ankka<'log> { } fn is_cm(&self) -> bool { - // EoD strike CMs are not implemented yet as of 2022-03-31 - false + helpers::boss_health(self.log).unwrap_or_default() > Self::ANKKA_CM_HEALTH } fn outcome(&self) -> Option { diff --git a/tests/challenge_motes.rs b/tests/challenge_motes.rs index 3d66b55..434463e 100644 --- a/tests/challenge_motes.rs +++ b/tests/challenge_motes.rs @@ -53,3 +53,4 @@ test!(test_siax_cm, "logs/siax-20200427.zevtc"); test!(test_ensolyss_cm, "logs/ensolyss-20200427.zevtc"); test!(test_mai_trin_cm, "logs/cms/mai-trin.zevtc"); +test!(test_ankka_cm, "logs/cms/ankka.zevtc"); diff --git a/tests/logs/cms/ankka.zevtc b/tests/logs/cms/ankka.zevtc new file mode 100644 index 0000000..60cf1d9 Binary files /dev/null and b/tests/logs/cms/ankka.zevtc differ -- cgit v1.2.3