diff options
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | src/gamedata.rs | 11 | ||||
-rw-r--r-- | src/lib.rs | 11 |
3 files changed, 26 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e92fd7..7109ce4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. ## Unreleased +### Fixed +- 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. ## 0.4.2 - 2020-08-28 ### Fixed diff --git a/src/gamedata.rs b/src/gamedata.rs index 5e83167..775cf30 100644 --- a/src/gamedata.rs +++ b/src/gamedata.rs @@ -63,6 +63,12 @@ pub enum Boss { // Strike missions IcebroodConstruct = 0x568A, + /// This is the ID of the Voice of the Fallen. + /// + /// The strike mission itself contains two bosses, the Voice of the Fallen and the Claw of the + /// Fallen. Consider using either [`VOICE_OF_THE_FALLEN_ID`][VOICE_OF_THE_FALLEN_ID] or + /// [`CLAW_OF_THE_FALLEN_ID`][CLAW_OF_THE_FALLEN_ID] if you refer to one of those bosses + /// specifically. VoiceOfTheFallen = 0x5747, FraenirOfJormag = 0x57DC, Boneskinner = 0x57F9, @@ -176,6 +182,11 @@ pub const NIKARE_ID: u16 = Boss::LargosTwins as u16; /// The ID of Kenut in the Twin Largos fight. pub const KENUT_ID: u16 = 21089; +/// The ID of the Voice of the Fallen. +pub const VOICE_OF_THE_FALLEN_ID: u16 = Boss::VoiceOfTheFallen as u16; +/// The ID of the Claw of the Fallen. +pub const CLAW_OF_THE_FALLEN_ID: u16 = 22481; + /// Error for when converting a string to a profession fails. #[derive(Debug, Clone, PartialEq, Eq, Hash, Error)] #[error("Invalid profession identifier: {0}")] @@ -762,6 +762,11 @@ impl Log { vec![self.boss_id, gamedata::XERA_PHASE2_ID] } else if self.boss_id == Boss::LargosTwins as u16 { vec![gamedata::NIKARE_ID, gamedata::KENUT_ID] + } else if self.encounter() == Some(Boss::VoiceOfTheFallen) { + vec![ + gamedata::VOICE_OF_THE_FALLEN_ID, + gamedata::CLAW_OF_THE_FALLEN_ID, + ] } else { vec![self.boss_id] }; @@ -789,6 +794,12 @@ impl Log { /// if we know about it in [`Boss`][Boss]. #[inline] pub fn encounter(&self) -> Option<Boss> { + // Sometimes, encounters of the strike mission "Voice of the Fallen and Claw of the Fallen" + // are saved with the ID of the Claw and sometimes with the Voice. Therefore, we need to + // unify those cases. + if self.boss_id == gamedata::CLAW_OF_THE_FALLEN_ID { + return Some(Boss::VoiceOfTheFallen); + } Boss::from_u16(self.boss_id) } |