diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-07-23 02:47:52 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-07-23 02:47:52 +0200 |
commit | 962e2b9f8e17a50c7d7d37a424591b0df62f265c (patch) | |
tree | 61efe53eae3768aca9d5ce1eb89c91f5adaceeba /src/analyzers/raids/w3.rs | |
parent | 0978345648cf9cdad6222f583dd21497b409d07e (diff) | |
download | evtclib-962e2b9f8e17a50c7d7d37a424591b0df62f265c.tar.gz evtclib-962e2b9f8e17a50c7d7d37a424591b0df62f265c.tar.bz2 evtclib-962e2b9f8e17a50c7d7d37a424591b0df62f265c.zip |
implement proper outcome for w1-w4
It turns out that `was_rewarded` is a pretty bad heuristic if you ever
kill a boss a second time per week (basically, was_rewarded=false does
not imply that the boss was unsuccessful). Therefore, we need a proper
detection of when a fight failed and when a fight succeeded.
This is the first batch that implements this as part of the Analyzer
trait for bosses of wings 1 to 4.
Diffstat (limited to 'src/analyzers/raids/w3.rs')
-rw-r--r-- | src/analyzers/raids/w3.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/analyzers/raids/w3.rs b/src/analyzers/raids/w3.rs new file mode 100644 index 0000000..82c007d --- /dev/null +++ b/src/analyzers/raids/w3.rs @@ -0,0 +1,30 @@ +use crate::{ + analyzers::{helpers, Analyzer, Outcome}, + Log, +}; + +/// Analyzer for the final fight of Wing 3, Xera. +#[derive(Debug, Clone, Copy)] +pub struct Xera<'log> { + log: &'log Log, +} + +impl<'log> Xera<'log> { + pub fn new(log: &'log Log) -> Self { + Xera { log } + } +} + +impl<'log> Analyzer for Xera<'log> { + fn log(&self) -> &Log { + self.log + } + + fn is_cm(&self) -> bool { + false + } + + fn outcome(&self) -> Option<Outcome> { + Outcome::from_bool(helpers::players_exit_after_boss(self.log)) + } +} |