From 891dec1e144c74bb9747a92dca9e65eb15570ef7 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 16 Nov 2021 00:02:33 +0100 Subject: Add Statues of Grenth --- src/analyzers/mod.rs | 3 ++ src/gamedata.rs | 61 ++++++++++++++++++++++++++++++++++ tests/logs/broken-king-20211115.zevtc | Bin 0 -> 890888 bytes tests/logs/eater-20211115.zevtc | Bin 0 -> 757126 bytes tests/logs/eyes-20211115.zevtc | Bin 0 -> 350793 bytes tests/parsing.rs | 54 ++++++++++++++++++++++++++++++ 6 files changed, 118 insertions(+) create mode 100644 tests/logs/broken-king-20211115.zevtc create mode 100644 tests/logs/eater-20211115.zevtc create mode 100644 tests/logs/eyes-20211115.zevtc diff --git a/src/analyzers/mod.rs b/src/analyzers/mod.rs index a5f3cbf..fcec7cf 100644 --- a/src/analyzers/mod.rs +++ b/src/analyzers/mod.rs @@ -101,6 +101,9 @@ pub fn for_log<'l>(log: &'l Log) -> Option> { Encounter::SoullessHorror => Some(Box::new(raids::SoullessHorror::new(log))), Encounter::RiverOfSouls => Some(Box::new(raids::RiverOfSouls::new(log))), + Encounter::BrokenKing | Encounter::EaterOfSouls | Encounter::StatueOfDarkness => { + Some(Box::new(raids::GenericRaid::new(log))) + } Encounter::VoiceInTheVoid => Some(Box::new(raids::Dhuum::new(log))), Encounter::ConjuredAmalgamate => Some(Box::new(raids::ConjuredAmalgamate::new(log))), diff --git a/src/gamedata.rs b/src/gamedata.rs index 3c48b71..24ce288 100644 --- a/src/gamedata.rs +++ b/src/gamedata.rs @@ -53,6 +53,15 @@ pub enum Encounter { /// /// [Guild Wars 2 Wiki](https://wiki.guildwars2.com/wiki/Traverse_the_River_of_Souls) RiverOfSouls = 0x4D74, + BrokenKing = Boss::BrokenKing as u16, + EaterOfSouls = Boss::EaterOfSouls as u16, + /// The Statue of Darkness consists of killing the Eye of Judgment and the Eye of Fate. + /// + /// Colloquially known as just "eyes". + /// + /// [Guild Wars 2 Wiki](https://wiki.guildwars2.com/wiki/Statue_of_Darkness) + StatueOfDarkness = Boss::EyeOfJudgment as u16, + VoiceInTheVoid = Boss::Dhuum as u16, // Wing 6 @@ -116,6 +125,9 @@ impl Encounter { Encounter::Deimos => &[Boss::Deimos], Encounter::SoullessHorror => &[Boss::SoullessHorror], Encounter::RiverOfSouls => &[], + Encounter::BrokenKing => &[Boss::BrokenKing], + Encounter::EaterOfSouls => &[Boss::EaterOfSouls], + Encounter::StatueOfDarkness => &[Boss::EyeOfJudgment, Boss::EyeOfFate], Encounter::VoiceInTheVoid => &[Boss::Dhuum], Encounter::ConjuredAmalgamate => &[Boss::ConjuredAmalgamate], Encounter::TwinLargos => &[Boss::Nikare, Boss::Kenut], @@ -182,6 +194,7 @@ impl FromStr for Encounter { match &lower as &str { "trio" | "bandit trio" => Ok(Encounter::BanditTrio), "river" | "river of souls" => Ok(Encounter::RiverOfSouls), + "eyes" | "statue of darkness" => Ok(Encounter::StatueOfDarkness), "largos" | "twins" | "largos twins" | "twin largos" => Ok(Encounter::TwinLargos), "kodans" | "super kodan brothers" => Ok(Encounter::SuperKodanBrothers), @@ -207,6 +220,9 @@ impl Display for Encounter { Encounter::Deimos => "Deimos", Encounter::SoullessHorror => "Soulless Horror", Encounter::RiverOfSouls => "River of Souls", + Encounter::BrokenKing => "Broken King", + Encounter::EaterOfSouls => "Eater of Souls", + Encounter::StatueOfDarkness => "Statue of Darkness", Encounter::VoiceInTheVoid => "Voice in the Void", Encounter::ConjuredAmalgamate => "Conjured Amalgamate", Encounter::TwinLargos => "Twin Largos", @@ -322,6 +338,22 @@ pub enum Boss { /// /// [Guild Wars 2 Wiki](https://wiki.guildwars2.com/wiki/Soulless_Horror) SoullessHorror = 0x4D37, + /// Broken King, part of the Statues of Grenth event in the Hall of Chains. + /// + /// [Guild Wars 2 Wiki](https://wiki.guildwars2.com/wiki/Broken_King) + BrokenKing = 0x4CEB, + /// Eater of Souls, part of the Statues of Grenth event in the Hall of Chains. + /// + /// [Guild Wars 2 Wiki](https://wiki.guildwars2.com/wiki/Eater_of_Souls_(Hall_of_Chains)) + EaterOfSouls = 0x4C50, + /// The Eye of Judgment, part of the Statue of Darkness event in the Hall of Chains. + /// + /// [Guild Wars 2 Wiki](https://wiki.guildwars2.com/wiki/Eye_of_Judgment) + EyeOfJudgment = 0x4CC3, + /// The Eye of Fate, part of the Statue of Darkness event in the Hall of Chains. + /// + /// [Guild Wars 2 Wiki](https://wiki.guildwars2.com/wiki/Eye_of_Fate) + EyeOfFate = 0x4D84, /// Dhuum, second boss of the Hall of Chains. /// /// The encounter to this boss is called [Voice in the Void][Encounter::VoiceInTheVoid]. @@ -458,6 +490,10 @@ impl Boss { Boss::Samarog => Encounter::Samarog, Boss::Deimos => Encounter::Deimos, Boss::SoullessHorror => Encounter::SoullessHorror, + Boss::BrokenKing => Encounter::BrokenKing, + Boss::EaterOfSouls => Encounter::EaterOfSouls, + Boss::EyeOfJudgment => Encounter::StatueOfDarkness, + Boss::EyeOfFate => Encounter::StatueOfDarkness, Boss::Dhuum => Encounter::VoiceInTheVoid, Boss::ConjuredAmalgamate => Encounter::ConjuredAmalgamate, Boss::Nikare => Encounter::TwinLargos, @@ -516,6 +552,10 @@ impl FromStr for Boss { "deimos" => Ok(Boss::Deimos), "desmina" | "sh" | "soulless horror" => Ok(Boss::SoullessHorror), + "broken king" => Ok(Boss::BrokenKing), + "eater" | "eater of souls" => Ok(Boss::EaterOfSouls), + "eye of judgment" => Ok(Boss::EyeOfJudgment), + "eye of fate" => Ok(Boss::EyeOfFate), "dhuum" | "voice in the void" => Ok(Boss::Dhuum), "ca" | "conjured amalgamate" => Ok(Boss::ConjuredAmalgamate), @@ -572,6 +612,10 @@ impl Display for Boss { Boss::Samarog => "Samarog", Boss::Deimos => "Deimos", Boss::SoullessHorror => "Soulless Horror", + Boss::BrokenKing => "Broken King", + Boss::EaterOfSouls => "Eater of Souls", + Boss::EyeOfJudgment => "Eye of Judgment", + Boss::EyeOfFate => "Eye of Fate", Boss::Dhuum => "Dhuum", Boss::ConjuredAmalgamate => "Conjured Amalgamate", Boss::Nikare => "Nikare", @@ -826,6 +870,14 @@ mod tests { ("river", RiverOfSouls), ("River", RiverOfSouls), ("river of souls", RiverOfSouls), + ("broken king", BrokenKing), + ("Broken King", BrokenKing), + ("eater", EaterOfSouls), + ("eater of souls", EaterOfSouls), + ("Eater of Souls", EaterOfSouls), + ("eyes", StatueOfDarkness), + ("statue of darkness", StatueOfDarkness), + ("Statue of Darkness", StatueOfDarkness), ("dhuum", VoiceInTheVoid), ("Dhuum", VoiceInTheVoid), ("ca", ConjuredAmalgamate), @@ -945,6 +997,15 @@ mod tests { ("soulless horror", SoullessHorror), ("desmina", SoullessHorror), ("Desmina", SoullessHorror), + ("broken king", BrokenKing), + ("Broken King", BrokenKing), + ("eater", EaterOfSouls), + ("eater of souls", EaterOfSouls), + ("Eater of Souls", EaterOfSouls), + ("eye of judgment", EyeOfJudgment), + ("Eye of Judgment", EyeOfJudgment), + ("eye of fate", EyeOfFate), + ("Eye of Fate", EyeOfFate), ("dhuum", Dhuum), ("Dhuum", Dhuum), ("ca", ConjuredAmalgamate), diff --git a/tests/logs/broken-king-20211115.zevtc b/tests/logs/broken-king-20211115.zevtc new file mode 100644 index 0000000..17f17ba Binary files /dev/null and b/tests/logs/broken-king-20211115.zevtc differ diff --git a/tests/logs/eater-20211115.zevtc b/tests/logs/eater-20211115.zevtc new file mode 100644 index 0000000..577ce96 Binary files /dev/null and b/tests/logs/eater-20211115.zevtc differ diff --git a/tests/logs/eyes-20211115.zevtc b/tests/logs/eyes-20211115.zevtc new file mode 100644 index 0000000..af8c4ef Binary files /dev/null and b/tests/logs/eyes-20211115.zevtc differ diff --git a/tests/parsing.rs b/tests/parsing.rs index d69ef86..4949805 100644 --- a/tests/parsing.rs +++ b/tests/parsing.rs @@ -300,6 +300,60 @@ test! { ], } +test! { + name: parse_broken_king, + log: "logs/broken-king-20211115.zevtc", + boss: Encounter::BrokenKing, + players: &[ + (1, ":Dunje.4863", "Pallida Howhite", Warrior, Some(Berserker)), + (1, ":Straimer.1093", "I Want Smite Back", Guardian, Some(Dragonhunter)), + (1, ":Taniniver BlindDragon.9503", "Dragon Kills You", Necromancer, Some(Scourge)), + (1, ":xyoz.6710", "Xaphwen", Mesmer, Some(Chronomancer)), + (2, ":Jupp.4570", "Aldwor", Guardian, Some(Firebrand)), + (2, ":Kiki.9576", "Spooky Kiki", Necromancer, Some(Scourge)), + (2, ":Rajnesh.4526", "I Rajnesh I", Revenant, Some(Renegade)), + (2, ":TheMakNoon.5071", "Twosouls M", Mesmer, Some(Chronomancer)), + (2, ":Timothy.5829", "Annegret On Frenzy", Ranger, Some(Druid)), + (3, ":neko.9741", "Syberia Nótt", Elementalist, Some(Tempest)), + ], +} + +test! { + name: parse_eater, + log: "logs/eater-20211115.zevtc", + boss: Encounter::EaterOfSouls, + players: &[ + (1, ":Dunje.4863", "Pallida Howhite", Warrior, Some(Berserker)), + (1, ":Straimer.1093", "I Want Smite Back", Guardian, Some(Dragonhunter)), + (1, ":Taniniver BlindDragon.9503", "Dragon Kills You", Necromancer, Some(Scourge)), + (1, ":Timothy.5829", "Annegret On Frenzy", Ranger, Some(Druid)), + (1, ":xyoz.6710", "Xaphwen", Mesmer, Some(Chronomancer)), + (2, ":Jupp.4570", "Aldwor", Guardian, Some(Firebrand)), + (2, ":Kiki.9576", "Spooky Kiki", Necromancer, Some(Scourge)), + (2, ":Rajnesh.4526", "I Rajnesh I", Revenant, Some(Renegade)), + (2, ":TheMakNoon.5071", "Twosouls M", Mesmer, Some(Chronomancer)), + (2, ":neko.9741", "Syberia Nótt", Elementalist, Some(Tempest)), + ], +} + +test! { + name: parse_eyes, + log: "logs/eyes-20211115.zevtc", + boss: Encounter::StatueOfDarkness, + players: &[ + (1, ":Dunje.4863", "Pallida Howhite", Warrior, Some(Berserker)), + (1, ":Straimer.1093", "I Want Smite Back", Guardian, Some(Dragonhunter)), + (1, ":Taniniver BlindDragon.9503", "Dragon Kills You", Necromancer, Some(Scourge)), + (1, ":Timothy.5829", "Annegret On Frenzy", Ranger, Some(Druid)), + (1, ":xyoz.6710", "Xaphwen", Mesmer, Some(Chronomancer)), + (2, ":Jupp.4570", "Aldwor", Guardian, Some(Firebrand)), + (2, ":Kiki.9576", "Spooky Kiki", Necromancer, Some(Scourge)), + (2, ":Rajnesh.4526", "I Rajnesh I", Revenant, Some(Renegade)), + (2, ":TheMakNoon.5071", "Twosouls M", Mesmer, Some(Chronomancer)), + (2, ":neko.9741", "Syberia Nótt", Elementalist, Some(Tempest)), + ], +} + test! { name: parse_dhuum, log: "logs/dhuum-20200428.zevtc", -- cgit v1.2.3