Skip to content

Commit

Permalink
Splits TransFlame1, TransFlame2, TransFlame3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed Feb 21, 2024
1 parent 939a77a commit de7df84
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hollow_knight_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
18 changes: 18 additions & 0 deletions src/splits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)),
Expand Down

0 comments on commit de7df84

Please sign in to comment.