aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-09-21 12:24:35 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-09-21 12:31:15 +0200
commitdd015d3b3640fed0885fd94db78def42531b47d5 (patch)
tree14bc3940b6a30efdd6c3615e37a24e12133790e2
parent4f3084ad0268fb51d8f5873a69becea3deb785d4 (diff)
downloadevtclib-dd015d3b3640fed0885fd94db78def42531b47d5.tar.gz
evtclib-dd015d3b3640fed0885fd94db78def42531b47d5.tar.bz2
evtclib-dd015d3b3640fed0885fd94db78def42531b47d5.zip
fix CM detection for new Skorvald logs
The Sunqua Peak patch released on 2020-09-15 shifted fractals around (notably moving the old CMs to 98 & 99), which messed with the boss health in those fractals. As a result, the Skorvald CM detection (which relied on the health of Skorvald being higher in CM) was broken. This patch introduces a fallback mechanism which relies on the split-phase anomalies, as those are still different in the CM. It should be 100% accurate, as long as players actually make it to the split phase. Before that, we currently have to assume that the fight is non-CM, even if it's a log from a CM wiping before first split phase. There is some discussion in the Elite-Insights Discord here[1] about this change. [1]: https://discordapp.com/channels/456611641526845473/718866714527399976/755914037354692648
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/analyzers/fractals.rs22
-rw-r--r--tests/challenge_motes.rs1
-rw-r--r--tests/logs/skorvald-20200920.zevtcbin0 -> 283875 bytes
4 files changed, 21 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c79a723..4af377e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file.
- Handling of log files with "Claw of the Fallen" as the encounter id.
- Both bosses are now returned for the "Voice & Claw of the Fallen" strike
mission.
+- Fixed CM detection for Skorvald logs done after the 2020-09-15 patch
+ (introduction of Sunqua Peak).
## 0.4.2 - 2020-08-28
### Fixed
diff --git a/src/analyzers/fractals.rs b/src/analyzers/fractals.rs
index 910b182..69a908a 100644
--- a/src/analyzers/fractals.rs
+++ b/src/analyzers/fractals.rs
@@ -7,9 +7,18 @@ use crate::{
/// Health threshold for Skorvald to be detected as Challenge Mote.
pub const SKORVALD_CM_HEALTH: u64 = 5_551_340;
+/// Character IDs for the anomalies in Skorvald's Challenge Mote.
+pub static SKORVALD_CM_ANOMALY_IDS: &[u16] = &[17_599, 17_673, 17_770, 17_851];
+
/// Analyzer for the first boss of 100 CM, Skorvald.
///
-/// The CM is detected by the boss's health, which is higher in the challenge mote.
+/// The CM was detected by the boss's health, which was higher in the challenge mote.
+///
+/// The 2020-09-15 update which introduced a new fractal and shifted Shattered Observator CM to 99
+/// which changed the bosses' maximal health, so this method no longer works. Instead, we rely on
+/// the split phase to differentiate the "normal mode" flux anomalies from the "challenge mode"
+/// flux anomalies, with the downside that the CM detection is only working if players make it to
+/// the split phase.
#[derive(Debug, Clone, Copy)]
pub struct Skorvald<'log> {
log: &'log Log,
@@ -31,9 +40,14 @@ impl<'log> Analyzer for Skorvald<'log> {
}
fn is_cm(&self) -> bool {
- helpers::boss_health(self.log)
- .map(|h| h >= SKORVALD_CM_HEALTH)
- .unwrap_or(false)
+ // Shortcut for old logs for which this method still works.
+ if Some(true) == helpers::boss_health(self.log).map(|h| h >= SKORVALD_CM_HEALTH) {
+ return true;
+ }
+
+ self.log
+ .npcs()
+ .any(|character| SKORVALD_CM_ANOMALY_IDS.contains(&character.id()))
}
fn outcome(&self) -> Option<Outcome> {
diff --git a/tests/challenge_motes.rs b/tests/challenge_motes.rs
index 9460483..f07eee1 100644
--- a/tests/challenge_motes.rs
+++ b/tests/challenge_motes.rs
@@ -39,6 +39,7 @@ test!(test_sabir_cm, "logs/cms/sabir.zevtc");
test!(test_qadimp_cm, "logs/cms/qadimp.zevtc");
test!(test_skorvald_cm, "logs/skorvald-20200427.zevtc");
+test!(test_skorvald_cm_post_sunqua_patch, "logs/skorvald-20200920.zevtc");
test!(test_artsariiv_cm, "logs/artsariiv-20200427.zevtc");
test!(test_arkk_cm, "logs/arkk-20200427.zevtc");
diff --git a/tests/logs/skorvald-20200920.zevtc b/tests/logs/skorvald-20200920.zevtc
new file mode 100644
index 0000000..448f466
--- /dev/null
+++ b/tests/logs/skorvald-20200920.zevtc
Binary files differ