Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
b2744bb6f7 | |||
f2cb7ab9c7 | |||
7a6af25bc2 | |||
fc4e92ed34 |
1 changed files with 16 additions and 31 deletions
47
src/main.rs
47
src/main.rs
|
@ -26,7 +26,7 @@ struct Args {
|
|||
|
||||
/// Enable debug mode
|
||||
#[arg(short, long, default_value_t = false)]
|
||||
debugmode: bool,
|
||||
debug: bool,
|
||||
}
|
||||
|
||||
// const fallbackconfigpath: String = "config.json".to_owned();
|
||||
|
@ -42,7 +42,7 @@ fn cook() -> Result<(), Errorfr> {
|
|||
let args = Args::parse();
|
||||
|
||||
let mut debug_mode = false;
|
||||
if args.debugmode == true {
|
||||
if args.debug == true {
|
||||
debug_mode = true;
|
||||
println!("Debug mode enabled");
|
||||
};
|
||||
|
@ -121,47 +121,32 @@ fn cook() -> Result<(), Errorfr> {
|
|||
let eletype = match eachpowder.r#type.to_ascii_lowercase() {
|
||||
'e' => {
|
||||
if debug_mode {
|
||||
println!("Powder type: Earth");
|
||||
|
||||
}
|
||||
Element::Earth
|
||||
}
|
||||
't' => {
|
||||
|
||||
if debug_mode {
|
||||
println!("Powder type: Thunder");
|
||||
}
|
||||
Element::Thunder
|
||||
}
|
||||
'w' => {
|
||||
if debug_mode {
|
||||
println!("Powder type: Water");
|
||||
}
|
||||
Element::Water
|
||||
}
|
||||
'f' => {
|
||||
if debug_mode {
|
||||
println!("Powder type: Fire");
|
||||
}
|
||||
Element::Fire
|
||||
}
|
||||
'a' => {
|
||||
if debug_mode {
|
||||
println!("Powder type: Air");
|
||||
}
|
||||
Element::Air
|
||||
}
|
||||
_ => {
|
||||
if debug_mode {
|
||||
println!("Powder type: Broken, fallback Thunder");
|
||||
}
|
||||
Element::Thunder
|
||||
}
|
||||
};
|
||||
powdervec.push(Some((eletype,powdertier)));
|
||||
if debug_mode {
|
||||
println!("Powder tier: {}", powdertier);
|
||||
println!("Powder amount: {}", powderamount);
|
||||
dbg!(powdertier);
|
||||
dbg!(eletype);
|
||||
}
|
||||
powdervec.push(Some((eletype,powdertier)));
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -170,7 +155,7 @@ fn cook() -> Result<(), Errorfr> {
|
|||
|
||||
}
|
||||
if debug_mode {
|
||||
println!("Powders Vec: {:?}", powdervec);
|
||||
dbg!(&powdervec);
|
||||
}
|
||||
|
||||
// old powder data encode kinda, takes data from new encode
|
||||
|
@ -182,16 +167,16 @@ fn cook() -> Result<(), Errorfr> {
|
|||
.unwrap();
|
||||
|
||||
match json_config.rerolls {
|
||||
Some(i) => {
|
||||
if i != 0 {
|
||||
RerollData(i).encode(ver, &mut out).unwrap();
|
||||
Some(rerollcount) => {
|
||||
if rerollcount != 0 {
|
||||
RerollData(rerollcount).encode(ver, &mut out).unwrap();
|
||||
if debug_mode {
|
||||
println!("Rerolls: {}", i)
|
||||
}
|
||||
}
|
||||
dbg!(rerollcount);
|
||||
};
|
||||
};
|
||||
}
|
||||
None => pass(),
|
||||
}
|
||||
};
|
||||
|
||||
let mut realshinykey: u8;
|
||||
if let Some(shiny) = json_config.shiny {
|
||||
|
@ -203,7 +188,7 @@ fn cook() -> Result<(), Errorfr> {
|
|||
if i.key == shiny.key {
|
||||
realshinykey = i.id;
|
||||
if debug_mode {
|
||||
println!("shiny key {}", shiny.key);
|
||||
dbg!(&shiny.key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue