Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splits GreatHuskSentry, SpireBenchExit #95

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/hollow_knight_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
killed_mage_lord: UnityPointer<3>,
mage_lord_dream_defeated: UnityPointer<3>,
mage_lord_orbs_collected: UnityPointer<3>,
killed_great_shield_zombie: UnityPointer<3>,
kills_great_shield_zombie: UnityPointer<3>,
watcher_chandelier: UnityPointer<3>,
killed_black_knight: UnityPointer<3>,
Expand Down Expand Up @@ -850,6 +851,7 @@
killed_mage_lord: UnityPointer::new("GameManager", 0, &["_instance", "playerData", "killedMageLord"]),
mage_lord_dream_defeated: UnityPointer::new("GameManager", 0, &["_instance", "playerData", "mageLordDreamDefeated"]),
mage_lord_orbs_collected: UnityPointer::new("GameManager", 0, &["_instance", "playerData", "mageLordOrbsCollected"]),
killed_great_shield_zombie: UnityPointer::new("GameManager", 0, &["_instance", "playerData", "killedGreatShieldZombie"]),
kills_great_shield_zombie: UnityPointer::new("GameManager", 0, &["_instance", "playerData", "killsGreatShieldZombie"]),
watcher_chandelier: UnityPointer::new("GameManager", 0, &["_instance", "playerData", "watcherChandelier"]),
killed_black_knight: UnityPointer::new("GameManager", 0, &["_instance", "playerData", "killedBlackKnight"]),
Expand Down Expand Up @@ -1170,7 +1172,7 @@
} else {
self.pointers.ui_state_vanilla.deref(process, &self.module, &self.image).ok()?
}
} else {

Check warning on line 1175 in src/hollow_knight_memory.rs

View workflow job for this annotation

GitHub Actions / Check clippy lints

this `else { if .. }` block can be collapsed
if let Ok(ui) = self.pointers.ui_state_vanilla.deref(process, &self.module, &self.image) {
self.modded.set(false).ok();
ui
Expand Down Expand Up @@ -2135,6 +2137,10 @@
self.player_data_pointers.mage_lord_orbs_collected.deref(process, &self.module, &self.image).ok()
}

pub fn killed_great_shield_zombie(&self, process: &Process) -> Option<bool> {
self.player_data_pointers.killed_great_shield_zombie.deref(process, &self.module, &self.image).ok()
}

pub fn kills_great_shield_zombie(&self, process: &Process) -> Option<i32> {
self.player_data_pointers.kills_great_shield_zombie.deref(process, &self.module, &self.image).ok()
}
Expand Down
11 changes: 11 additions & 0 deletions src/splits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,10 @@ pub enum Split {
///
/// Splits when sitting on the bench in King's Station
BenchKingsStation,
/// Great Husk Sentry (Killed)
///
/// Splits when killing a Great Husk Sentry
GreatHuskSentry,
/// Watcher's Spire (Bench)
///
/// Splits when sitting on the bench in Watcher's Spire
Expand All @@ -2088,6 +2092,10 @@ pub enum Split {
///
/// Splits when sitting on the bench in Watcher's Spire after killing a Great Husk Sentry
BenchSpireGHS,
/// Spire Bench Exit (Transition)
///
/// Splits on the transition out of the bench room in Watcher's Spire
SpireBenchExit,
EnterBlackKnight,
/// Chandelier - Watcher Knights (Event)
///
Expand Down Expand Up @@ -3303,6 +3311,8 @@ pub fn transition_splits(s: &Split, p: &Pair<&str>, prc: &Process, g: &GameManag
Split::EnterSoulMaster => should_split(p.current.starts_with("Ruins1_24") && p.current != p.old),
Split::TransShadeSoul => should_split(2 <= pds.get_fireball_level(prc, g) && p.current != p.old),
Split::MenuShadeSoul => should_split(2 <= pds.get_fireball_level(prc, g) && p.current == MENU_TITLE),
// since Ruins1_18 has both bench and bridge, don't include Ruins1_18 bridge to Ruins2_03b
Split::SpireBenchExit => should_split(p.old.starts_with("Ruins1_18") && p.current.starts_with("Ruins2_01")),
Split::EnterBlackKnight => should_split(p.current == "Ruins2_03" && p.current != p.old),
Split::BlackKnightTrans => should_split(pds.killed_black_knight(prc, g) && p.current != p.old),
Split::EnterLoveTower => should_split(p.current.starts_with("Ruins2_11") && p.current != p.old),
Expand Down Expand Up @@ -4010,6 +4020,7 @@ pub fn continuous_splits(s: &Split, p: &Process, g: &GameManagerFinder, pds: &mu
&& g.scenes_grub_rescued(p).is_some_and(|s| s.contains(&"Ruins1_32".to_string()))),
Split::BenchStorerooms => should_split(g.at_bench(p).is_some_and(|b| b) && g.get_scene_name(p).is_some_and(|s| s == "Ruins1_29")),
Split::BenchKingsStation => should_split(g.at_bench(p).is_some_and(|b| b) && g.get_scene_name(p).is_some_and(|s| s == "Ruins2_08")),
Split::GreatHuskSentry => should_split(g.killed_great_shield_zombie(p).is_some_and(|k| k)),
Split::BenchSpire => should_split(g.at_bench(p).is_some_and(|b| b) && g.get_scene_name(p).is_some_and(|s| s == "Ruins1_18")),
Split::BenchSpireGHS => should_split(g.at_bench(p).is_some_and(|b| b)
&& g.get_scene_name(p).is_some_and(|s| s == "Ruins1_18")
Expand Down
Loading