From 4c02181067e789e41eb95c6f6e954e4de6277dc1 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 23 Jul 2020 03:00:53 +0200 Subject: implement Analyzer::outcome for wing 5 --- src/analyzers/raids/w5.rs | 24 ++++++++++++++++++++++-- 1 file 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::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::from_bool(helpers::boss_is_dead(self.log)) + } } -- cgit v1.2.3