Skip to content
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
1 change: 1 addition & 0 deletions rust/maprando-web/src/randomize_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ pub fn render_seed(
.settings
.item_progression_settings
.key_item_priority,
&seed_data.settings.other_settings,
),
objective_names,
race_mode: seed_data.race_mode,
Expand Down
24 changes: 20 additions & 4 deletions rust/maprando/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use maprando_game::IndexedVec;

use crate::{
randomize::ItemPriorityGroup,
settings::{KeyItemPriority, KeyItemPrioritySetting},
settings::{KeyItemPriority, KeyItemPrioritySetting, OtherSettings, SpeedBooster, WallJump},
};
use maprando_game::IndexedVec;
use maprando_game::Item;

pub fn get_item_priorities(item_priorities: &[KeyItemPrioritySetting]) -> Vec<ItemPriorityGroup> {
pub fn get_item_priorities(
item_priorities: &[KeyItemPrioritySetting],
other_settings: &OtherSettings,
) -> Vec<ItemPriorityGroup> {
let mut priorities: IndexedVec<KeyItemPriority> = IndexedVec::default();
priorities.add(&KeyItemPriority::Early);
priorities.add(&KeyItemPriority::Default);
Expand All @@ -19,6 +22,19 @@ pub fn get_item_priorities(item_priorities: &[KeyItemPrioritySetting]) -> Vec<It
});
}
for x in item_priorities {
if other_settings.wall_jump == WallJump::Vanilla && x.item == Item::WallJump {
continue;
}

if other_settings.speed_booster == SpeedBooster::Vanilla
&& (x.item == Item::SparkBooster || x.item == Item::BlueBooster)
{
continue;
}

if other_settings.speed_booster == SpeedBooster::Split && x.item == Item::SpeedBooster {
continue;
}
let i = priorities.index_by_key[&x.priority];
out[i].items.push(format!("{:?}", x.item));
}
Expand Down
1 change: 1 addition & 0 deletions rust/maprando/src/randomize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,7 @@ impl<'r> Randomizer<'r> {
filler_priority_map,
item_priority_groups: get_item_priorities(
&settings.item_progression_settings.key_item_priority,
&settings.other_settings,
),
base_links_data,
seed_links_data: LinksDataGroup::new(
Expand Down
Loading