From de7df84ffef9de7588289204358f6d59fe756140 Mon Sep 17 00:00:00 2001 From: AlexKnauth Date: Wed, 21 Feb 2024 17:02:14 -0500 Subject: [PATCH] Splits TransFlame1, TransFlame2, TransFlame3 --- src/hollow_knight_memory.rs | 4 ++++ src/splits.rs | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/hollow_knight_memory.rs b/src/hollow_knight_memory.rs index cc6d3598..bc0d24c6 100644 --- a/src/hollow_knight_memory.rs +++ b/src/hollow_knight_memory.rs @@ -2750,6 +2750,10 @@ impl PlayerDataStore { self.get_bool(p, g, "got_charm_31", &g.player_data_pointers.got_charm_31).unwrap_or(false) } + pub fn flames_collected(&mut self, p: &Process, g: &GameManagerFinder) -> i32 { + self.get_i32(p, g, "flames_collected", &g.player_data_pointers.flames_collected).unwrap_or(0) + } + pub fn got_shade_charm(&mut self, p: &Process, g: &GameManagerFinder) -> bool { self.get_bool(p, g, "got_shade_charm", &g.player_data_pointers.got_shade_charm).unwrap_or(false) } diff --git a/src/splits.rs b/src/splits.rs index 0dd83cea..a25223a4 100644 --- a/src/splits.rs +++ b/src/splits.rs @@ -879,6 +879,18 @@ pub enum Split { /// /// Splits after obtaining the third flame. Flame3, + /// Grimm Flame 1 (Transition) + /// + /// Splits on transition after obtaining the first flame on current Grimmchild cycle. + TransFlame1, + /// Grimm Flame 2 (Transition) + /// + /// Splits on transition after obtaining the second flame on current Grimmchild cycle. + TransFlame2, + /// Grimm Flame 3 (Transition) + /// + /// Splits on transition after obtaining the third flame on current Grimmchild cycle. + TransFlame3, /// Brumm Flame (NPC) /// /// Splits when collecting Brumm's flame in Deepnest @@ -3259,6 +3271,9 @@ pub fn transition_splits(s: &Split, p: &Pair<&str>, prc: &Process, g: &GameManag Split::SlyShopExit => should_split(p.old == "Room_shop" && p.current != p.old), Split::LumaflyLanternTransition | Split::PreGrimmShopTrans => should_split(pds.has_lantern(prc, g) && !p.current.starts_with("Room_shop")), Split::SlyShopFinished => should_split(pds.sly_shop_finished(prc, g) && !p.current.starts_with("Room_shop")), + Split::TransFlame1 => should_split(1 <= pds.flames_collected(prc, g)), + Split::TransFlame2 => should_split(2 <= pds.flames_collected(prc, g)), + Split::TransFlame3 => should_split(3 <= pds.flames_collected(prc, g)), Split::EnterTMG => should_split(p.current.starts_with("Grimm_Main_Tent") && p.current != p.old && g.equipped_charm_40(prc).is_some_and(|e| e) @@ -3690,6 +3705,9 @@ pub fn continuous_splits(s: &Split, p: &Process, g: &GameManagerFinder, pds: &mu Split::Flame1 => should_split(g.flames_collected(p).is_some_and(|f| 1 <= f)), Split::Flame2 => should_split(g.flames_collected(p).is_some_and(|f| 2 <= f)), Split::Flame3 => should_split(g.flames_collected(p).is_some_and(|f| 3 <= f)), + Split::TransFlame1 => { pds.flames_collected(p, g); should_split(false) }, + Split::TransFlame2 => { pds.flames_collected(p, g); should_split(false) }, + Split::TransFlame3 => { pds.flames_collected(p, g); should_split(false) }, Split::BrummFlame => should_split(g.got_brumms_flame(p).is_some_and(|f| f)), // Kingsoul / VoidHeart Split::WhiteFragmentLeft => should_split(g.got_queen_fragment(p).is_some_and(|c| c)),