Skip to content
Open
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: 0 additions & 1 deletion build_resources/cached_build.ron
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,6 @@
15200413822669298636: 1710479452,
15207095098433440528: 1680496635,
15450820022852980103: 1710724046,
15480219162363041159: 1730591229,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this is needed as this was automatically changed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol yes :) please always include this file with your prs.

15555440237134489310: 1680496635,
15660932891370033553: 1712955561,
15838371886896816978: 1712898526,
Expand Down
2 changes: 1 addition & 1 deletion src/perks/perk_options_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ fn hash_to_perk_option_data(_hash: u32) -> Option<PerkOptionData> {
//episode 2 | year 7
Perks::AirTrigger => Some(PerkOptionData::toggle()),
Perks::ClosingTime => Some(PerkOptionData::options(["Base", "Max Effect"].to_vec())),
Perks::LoneWolf => Some(PerkOptionData::options(["Base", "Alone"].to_vec())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it is a two state perk and it did always bother me about the 'none' option but seeing this pr reminded me of the options_raw perk option as well. It's basically the same as options but doesnt include a none by default so _input.value = 0 is whatever the first value you give is. A toggle in our current UX usually means no effect so thats why i think this option fits a little better than a toggle.

Perks::LoneWolf => Some(PerkOptionData::options_raw(["Base", "Alone"].to_vec())),

Perks::LoneWolf => Some(PerkOptionData::toggle()),
Perks::SplicerSurge => Some(PerkOptionData::stacking(3)),

//episode 3 | year 7
Expand Down
23 changes: 9 additions & 14 deletions src/perks/year_7_perks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,24 @@ pub fn year_7_perks() {
Box::new(|_input: ModifierResponseInput| -> HashMap<u32, i32> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've been adding in clamped values simply as a protection from editing the value in the url or otherwise. it would look like this as an end result.

add_sbr(
        Perks::LoneWolf,
        Box::new(|_input: ModifierResponseInput| -> HashMap<u32, i32> {
            let mut stats = HashMap::new();
            let val = clamp(_input.value, 0, 1);
            let enhance_buff = if _input.is_enhanced { 1 } else { 0 };
            stats.insert(
                StatHashes::AIRBORNE.into(),
                (15 + 2 * enhance_buff) * (val + 1) as i32,
            );
            stats.insert(
                StatHashes::AIM_ASSIST.into(),
                (5 + enhance_buff) * (val + 1)  as i32,
            );
            stats
        }),
    );
    add_hmr(
        Perks::LoneWolf,
        Box::new(
            |_input: ModifierResponseInput| -> HandlingModifierResponse {
                let val = clamp(_input.value, 0, 1);
                let enhance_buff = if _input.is_enhanced { 0.05 } else { 0.0 };
                HandlingModifierResponse {
                    ads_scale: 0.9 - (0.1 * val as f64) - enhance_buff,
                    ..Default::default()
                }
            },
        ),
    );

let mut stats = HashMap::new();
let enhance_buff = if _input.is_enhanced { 1 } else { 0 };
if _input.value > 0 {
stats.insert(
StatHashes::AIRBORNE.into(),
(15 + 2 * enhance_buff) * _input.value as i32,
);
stats.insert(
StatHashes::AIM_ASSIST.into(),
(5 + enhance_buff) * _input.value as i32,
);
}
stats.insert(
StatHashes::AIRBORNE.into(),
(15 + 2 * enhance_buff) * (_input.value + 1) as i32,
);
stats.insert(
StatHashes::AIM_ASSIST.into(),
(5 + enhance_buff) * (_input.value + 1) as i32,
);
stats
}),
);
add_hmr(
Perks::LoneWolf,
Box::new(
|_input: ModifierResponseInput| -> HandlingModifierResponse {
if _input.value == 0 {
HandlingModifierResponse::default();
}
let enhance_buff = if _input.is_enhanced { 0.05 } else { 0.0 };
HandlingModifierResponse {
ads_scale: 1.0 - (0.1 * _input.value as f64) - enhance_buff,
ads_scale: 0.9 - (0.1 * _input.value as f64) - enhance_buff,
..Default::default()
}
},
Expand Down