add the exception for Spell Costs (fuck you wynncraft)

This commit is contained in:
endernon 2025-01-17 22:31:46 +00:00
parent 3d2d96f86e
commit c327fce4fb

View file

@ -32,18 +32,38 @@ pub fn gen_perfect(name: &str, frjson: &HashMap<String, GearJsonItem>) -> Result
Some(fr_idents) => { Some(fr_idents) => {
if let Some(fr_identmap) = &fr_idents.identifications { if let Some(fr_identmap) = &fr_idents.identifications {
for i in fr_identmap { for i in fr_identmap {
println!("{i:?}");
if let &GearJsonItemInner::Struct(e) = &i.1 { if let &GearJsonItemInner::Struct(e) = &i.1 {
a.push(
Identificationer { // hardcoded list of inverts. Don't question why it's like this, blame whatever the fuck wynncraft was smoking.
id: i.0.clone(), // I'm going to have to update this list manually too... why the fuck, wynncraft?
base: e.clone().raw, let invert_bool: bool = matches!(i.0.to_lowercase().as_str(),
roll: Some(match &e.clone().raw { "4thspellcost" |
fr if fr<&0 => 69, "3rdspellcost" |
fr if fr>&0 => 130, "2ndspellcost" |
_ => 0 "1stspellcost" |
}), "raw4thspellcost" |
} "raw3rdspellcost" |
) "raw2ndspellcost" |
"raw1stSpellCost");
let ider: Identificationer = Identificationer {
id: i.0.clone(),
base: {
if invert_bool {-e.clone().raw} // invert value if invert mode true
else {e.clone().raw} // else regular value
},
roll: Some(match &e.clone().raw {
fr if fr<&0 => 70,
fr if fr>&0 => {
if invert_bool {70} // value 70 if invert mode true
else {130}// else value 130
},
_ => 0
})
};
println!("ider: {ider:?}");
a.push(ider)
} }
} }
} }