diff options
| author | Daniel Schadt <kingdread@gmx.de> | 2020-07-23 03:00:53 +0200 | 
|---|---|---|
| committer | Daniel Schadt <kingdread@gmx.de> | 2020-07-23 03:00:53 +0200 | 
| commit | 4c02181067e789e41eb95c6f6e954e4de6277dc1 (patch) | |
| tree | 30d7aaf8421324952e0a7bb47c99834ab724a9f7 | |
| parent | 962e2b9f8e17a50c7d7d37a424591b0df62f265c (diff) | |
| download | evtclib-4c02181067e789e41eb95c6f6e954e4de6277dc1.tar.gz evtclib-4c02181067e789e41eb95c6f6e954e4de6277dc1.tar.bz2 evtclib-4c02181067e789e41eb95c6f6e954e4de6277dc1.zip | |
implement Analyzer::outcome for wing 5
| -rw-r--r-- | src/analyzers/raids/w5.rs | 24 | 
1 files changed, 22 insertions, 2 deletions
| diff --git a/src/analyzers/raids/w5.rs b/src/analyzers/raids/w5.rs index b8c3f3c..b9668b7 100644 --- a/src/analyzers/raids/w5.rs +++ b/src/analyzers/raids/w5.rs @@ -1,11 +1,12 @@  //! Boss fight analyzers for Wing 5 (Hall of Chains)  use crate::{ -    analyzers::{helpers, Analyzer}, -    Log, +    analyzers::{helpers, Analyzer, Outcome}, +    EventKind, Log,  };  pub const DESMINA_BUFF_ID: u32 = 47414;  pub const DESMINA_MS_THRESHOLD: u64 = 11_000; +pub const DESMINA_DEATH_BUFF: u32 = 895;  /// Analyzer for the first fight of Wing 5, Soulless Horror (aka. Desmina).  /// @@ -31,6 +32,21 @@ impl<'log> Analyzer for SoullessHorror<'log> {          let tbb = helpers::time_between_buffs(self.log, DESMINA_BUFF_ID);          tbb > 0 && tbb <= DESMINA_MS_THRESHOLD      } + +    fn outcome(&self) -> Option<Outcome> { +        Outcome::from_bool(self.log.events().iter().any(|event| { +            if let EventKind::BuffApplication { +                buff_id, +                destination_agent_addr, +                .. +            } = event.kind() +            { +                self.log.is_boss(*destination_agent_addr) && *buff_id == DESMINA_DEATH_BUFF +            } else { +                false +            } +        })) +    }  }  pub const DHUUM_CM_HEALTH: u64 = 40_000_000; @@ -59,4 +75,8 @@ impl<'log> Analyzer for Dhuum<'log> {              .map(|h| h >= DHUUM_CM_HEALTH)              .unwrap_or(false)      } + +    fn outcome(&self) -> Option<Outcome> { +        Outcome::from_bool(helpers::boss_is_dead(self.log)) +    }  } | 
