-
Notifications
You must be signed in to change notification settings - Fork 9
SOS Index and Call Rate #71
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
base: main
Are you sure you want to change the base?
Changes from all commits
129bd69
3c273d1
7dab31a
7f6ec08
46a6465
b6128c4
4580e8f
112bdb0
e5bf4b8
597918c
3fa9736
f99f49b
751687b
d77d6c0
06cbcae
8c5e49b
821bae7
fe8c619
72c6739
c62f1bd
9bd354d
2db4b87
2573574
b8f72e5
483041a
eca5052
7bc56fc
9f337c2
a29c0a9
e7055c6
55401e8
a2c0a54
5742799
8cdb86b
51e87a8
7e321b0
0a2ba6d
8343276
cffaa3e
d801ed1
5efec80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [package] | ||
| name = "pokereader" | ||
| version = "0.8.0" | ||
| version = "0.8.2" | ||
| edition = "2021" | ||
|
|
||
| [dependencies] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,18 @@ use crate::{pnp, utils::menu::MenuOptionValue}; | |
| use pkm_rs::{Nature, Pkx, Shiny}; | ||
|
|
||
| pub const WHITE: u32 = 0xffffff; | ||
| pub const GREEN: u32 = 0x00cc00; | ||
| pub const RED: u32 = 0xff0000; | ||
| pub const MAGMA_RED: u32 = 0xFF4433; | ||
| pub const ORANGE: u32 = 0xd75f00; | ||
| pub const ULTRA_ORANGE: u32 = 0xff5f1f; | ||
| pub const YELLOW: u32 = 0xd7ff00; | ||
| pub const GREEN: u32 = 0x00cc00; | ||
| pub const CYAN: u32 = 0x00ffff; | ||
| pub const MUTED_CYAN: u32 = 0x00cccc; | ||
| pub const BLUE: u32 = 0x0000ff; | ||
| pub const PURPLE: u32 = 0xaf5fff; | ||
| pub const ULTRA_PURPLE: u32 = 0xaf00ff; | ||
| pub const HOT_PINK: u32 = 0xd7005f; | ||
|
|
||
| fn get_shiny_color(is_shiny: bool) -> u32 { | ||
| match is_shiny { | ||
|
|
@@ -116,21 +125,29 @@ macro_rules! print_stat { | |
| } | ||
|
|
||
| pub fn print_pp(pp: u32) { | ||
| pnp::println!(color = if pp > 1 { WHITE } else { RED }, "PP Remaining: {}", pp); | ||
| let color = match pp >> 1 { | ||
| 0 => RED, | ||
| 1 => MAGMA_RED, | ||
| 2 => ORANGE, | ||
| 3 => ULTRA_ORANGE, | ||
| 4 => YELLOW, | ||
| _ => WHITE, | ||
| }; | ||
| pnp::println!(color = color, "PP Remaining: {}", pp); | ||
| } | ||
|
|
||
| pub fn print_title() { | ||
| match loaded_title() { | ||
| Ok(title) => match title { | ||
| LoadedTitle::S => pnp::println!(color = 0xd75f00, " Pokemon Sun"), | ||
| LoadedTitle::M => pnp::println!(color = 0xaf5fff, " Pokemon Moon"), | ||
| LoadedTitle::Us => pnp::println!(color = 0xff5f1f, " Pokemon Ultra Sun"), | ||
| LoadedTitle::Um => pnp::println!(color = 0xaf00ff, " Pokemon Ultra Moon"), | ||
| LoadedTitle::X => pnp::println!(color = 0x00ffff, " Pokemon X"), | ||
| LoadedTitle::Y => pnp::println!(color = 0xd7005f, " Pokemon Y"), | ||
| LoadedTitle::Or => pnp::println!(color = 0xFF4433, " Pokemon Omega Ruby"), | ||
| LoadedTitle::As => pnp::println!(color = 0x0000ff, " Pokemon Alpha Sapphire"), | ||
| LoadedTitle::Transporter => pnp::println!(color = 0xd7ff00, " Pokemon Transporter"), | ||
| LoadedTitle::S => pnp::println!(color = ORANGE, " Pokemon Sun"), | ||
| LoadedTitle::M => pnp::println!(color = PURPLE, " Pokemon Moon"), | ||
| LoadedTitle::Us => pnp::println!(color = ULTRA_ORANGE, " Pokemon Ultra Sun"), | ||
| LoadedTitle::Um => pnp::println!(color = ULTRA_PURPLE, " Pokemon Ultra Moon"), | ||
| LoadedTitle::X => pnp::println!(color = CYAN, " Pokemon X"), | ||
| LoadedTitle::Y => pnp::println!(color = HOT_PINK, " Pokemon Y"), | ||
| LoadedTitle::Or => pnp::println!(color = MAGMA_RED, " Pokemon Omega Ruby"), | ||
| LoadedTitle::As => pnp::println!(color = BLUE, " Pokemon Alpha Sapphire"), | ||
| LoadedTitle::Transporter => pnp::println!(color = YELLOW, " Pokemon Transporter"), | ||
| LoadedTitle::CrystalEn | ||
| | LoadedTitle::CrystalDe | ||
| | LoadedTitle::CrystalFr | ||
|
|
@@ -153,8 +170,10 @@ pub fn shiny_type(pkx: &impl Pkx) -> &'static str { | |
| } | ||
| } | ||
|
|
||
| pub fn draw_pkx_brief(pkx: &impl Pkx) { | ||
| let species = pkx.species_t().to_string(); | ||
| pub fn draw_pkx_brief(pkx: &impl Pkx) -> bool { | ||
| if !pkx.is_valid() { | ||
| return draw_invalid_pkx(); | ||
| } | ||
| let ability = pkx.ability_t().to_string(); | ||
|
|
||
| let shiny_type = shiny_type(pkx); | ||
|
|
@@ -168,11 +187,10 @@ pub fn draw_pkx_brief(pkx: &impl Pkx) { | |
|
|
||
| let nature = pkx.nature_t(); | ||
|
|
||
| pnp::println!("{} {}", nature, species); | ||
| pnp::println!("Ability: ({}) {}", pkx.ability_number_t(), ability); | ||
| pnp::println!("PID: {:08X}", pkx.pid()); | ||
| pnp::println!(color = shiny_color, "PSV: {:04}, {}", pkx.psv(), shiny_type); | ||
| pnp::println!("HPower: {}", pkx.hidden_power_t()); | ||
| pnp::println!("Nature: {}", nature); | ||
| pnp::println!( | ||
| "IVs: {}/{}/{}/{}/{}/{}", | ||
| iv_hp, | ||
|
|
@@ -182,9 +200,14 @@ pub fn draw_pkx_brief(pkx: &impl Pkx) { | |
| iv_spd, | ||
| iv_spe | ||
| ); | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| pub fn draw_pkx(pkx: &impl Pkx, pkx_type: PkxType) { | ||
| pub fn draw_pkx(pkx: &impl Pkx, pkx_type: PkxType) -> bool { | ||
| if !pkx.is_valid() { | ||
| return draw_invalid_pkx(); | ||
| } | ||
| let species = pkx.species_t().to_string(); | ||
| let ability = pkx.ability_t().to_string(); | ||
|
|
||
|
|
@@ -227,6 +250,13 @@ pub fn draw_pkx(pkx: &impl Pkx, pkx_type: PkxType) { | |
| print_stat!(iv_spa, ev_spa, SpA, &nature_stat, "SpA "); | ||
| print_stat!(iv_spd, ev_spd, SpD, &nature_stat, "SpD "); | ||
| print_stat!(iv_spe, ev_spe, Spe, &nature_stat, "Spe "); | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| pub fn draw_invalid_pkx() -> bool { | ||
| pnp::println!("No Data."); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think showing a blank Pokemon might be more helpful. Someone brand new to RNG who downloaded Reader for the first time and isn't sure if they set things up correctly might see "No Data." and be confused about if they did something wrong. This message also doesn't have a way to self serve – there's no indication of how to fix the problem. New people sometimes follow a YouTube video or a website tutorial with screenshots, and it's helpful if the video/images visually match what they're seeing. Showing a blank PKX seems like it might be more intuitive for people.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree we can change the message itself, as "No Data" is a bit misleading... For Wild we can put "Not in Battle" or "Slot Empty" maybe? "Slot Empty" would also work well for Party, and "No Ally" would work for SOS. Personally I believe that showing a blank Pkx really clutters the display when it doesn't need to-- especially for users who may X+Y lock the menu on Wild/SOS and getting in and out of several encounters. I agree that "No Data" is misleading, but I disagree that showing a blank Pkx is more intuitive, especially for things like cycling through party slots, it's a lot more convenient to see at a glance that there is nothing there. |
||
| return true; | ||
| } | ||
|
|
||
| pub fn draw_controls_help() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,262 @@ | ||
| use pkm_rs::{Pkx, Species::*}; | ||
|
|
||
| pub fn lookup_call_rate(pkx: &impl Pkx, is_usum: bool) -> u32 { | ||
| match pkx.species_t() { | ||
| Slowbro | ||
| | Dhelmise | ||
| | Drampa | ||
| | Turtonator | ||
| | Lurantis | ||
| | Lycanroc | ||
| | Relicanth | ||
| | Glalie | ||
| | Absol | ||
| | Sharpedo | ||
| | Miltank | ||
| | Lapras | ||
| | Gyarados | ||
| | Tauros | ||
| | Pinsir | ||
| | Scyther | ||
| | Kangaskhan | ||
| | Marowak => 3, | ||
| Raticate | ||
| | HakamoO | ||
| | Bruxish | ||
| | Pyukumuku | ||
| | Palossand | ||
| | Steenee | ||
| | Bewear | ||
| | Shiinotic | ||
| | Araquanid | ||
| | Mudsdale | ||
| | Ribombee | ||
| | Oricorio | ||
| | Gumshoos | ||
| | Klefki | ||
| | Fletchinder | ||
| | Mandibuzz | ||
| | Braviary | ||
| | Alomomola | ||
| | Garbodor | ||
| | Krokorok | ||
| | Boldore | ||
| | Herdier | ||
| | Lumineon | ||
| | Munchlax | ||
| | Drifblim | ||
| | Gastrodon | ||
| | Metang | ||
| | Shelgon | ||
| | Luvdisc | ||
| | Whiscash | ||
| | Vibrava | ||
| | Spinda | ||
| | Torkoal | ||
| | Wailord | ||
| | Hariyama | ||
| | Masquerain | ||
| | Pelipper | ||
| | Skarmory | ||
| | Granbull | ||
| | Lanturn | ||
| | Ariados | ||
| | Ledian | ||
| | Dragonair | ||
| | Magmar | ||
| | Electabuzz | ||
| | Seaking | ||
| | Hypno | ||
| | Haunter | ||
| | Muk | ||
| | Magneton | ||
| | Graveler | ||
| | Tentacruel | ||
| | Machoke | ||
| | Kadabra | ||
| | Poliwhirl | ||
| | Primeape | ||
| | Golduck | ||
| | Persian | ||
| | Dugtrio | ||
| | Parasect | ||
| | Jigglypuff | ||
| | Clefairy | ||
| | Pikachu | ||
| | Fearow => 6, | ||
| Rattata | ||
| | JangmoO | ||
| | Mimikyu | ||
| | Togedemaru | ||
| | Sandygast | ||
| | Comfey | ||
| | Bounsweet | ||
| | Stufful | ||
| | Salandit | ||
| | Morelull | ||
| | Fomantis | ||
| | Dewpider | ||
| | Mudbray | ||
| | Wishiwashi | ||
| | Rockruff | ||
| | Cutiefly | ||
| | Crabrawler | ||
| | Grubbin | ||
| | Yungoos | ||
| | Trumbeak | ||
| | Phantump | ||
| | Carbink | ||
| | Pancham | ||
| | Fletchling | ||
| | Vullaby | ||
| | Rufflet | ||
| | Emolga | ||
| | Trubbish | ||
| | Sandile | ||
| | Petilil | ||
| | Cottonee | ||
| | Roggenrola | ||
| | Lillipup | ||
| | Finneon | ||
| | Drifloon | ||
| | Shellos | ||
| | Beldum | ||
| | Bagon | ||
| | Snorunt | ||
| | Feebas | ||
| | Barboach | ||
| | Trapinch | ||
| | Wailmer | ||
| | Carvanha | ||
| | Nosepass | ||
| | Makuhita | ||
| | Surskit | ||
| | Wingull | ||
| | Smeargle | ||
| | Delibird | ||
| | Corsola | ||
| | Sneasel | ||
| | Snubbull | ||
| | Misdreavus | ||
| | Murkrow | ||
| | Chinchou | ||
| | Spinarak | ||
| | Ledyba | ||
| | Dratini | ||
| | Eevee | ||
| | Ditto | ||
| | Magikarp | ||
| | Staryu | ||
| | Goldeen | ||
| | Drowzee | ||
| | Gastly | ||
| | Shellder | ||
| | Grimer | ||
| | Magnemite | ||
| | Slowpoke | ||
| | Geodude | ||
| | Machop | ||
| | Abra | ||
| | Poliwag | ||
| | Growlithe | ||
| | Mankey | ||
| | Meowth | ||
| | Diglett | ||
| | Paras | ||
| | Golbat | ||
| | Vulpix | ||
| | Sandshrew | ||
| | Spearow => 9, | ||
| Caterpie | ||
| | Passimian | ||
| | Oranguru | ||
| | Salazzle | ||
| | Charjabug | ||
| | Pikipek | ||
| | Riolu | ||
| | Bonsly | ||
| | Magby | ||
| | Elekid | ||
| | Igglybuff | ||
| | Cleffa | ||
| | Pichu | ||
| | Cubone | ||
| | Exeggcute | ||
| | Tentacool | ||
| | Psyduck | ||
| | Zubat | ||
| | Metapod => 15, | ||
| Lickitung | ||
| | Hawlucha | ||
| | Larvesta | ||
| | Druddigon | ||
| | Mienshao | ||
| | Tropius | ||
| | Remoraid | ||
| | Heracross | ||
| | Dunsparce => if is_usum { 3 } else { 0 }, | ||
| Arbok | ||
| | Noivern | ||
| | Clawitzer | ||
| | Dragalge | ||
| | Malamar | ||
| | Furfrou | ||
| | Pyroar | ||
| | Mienfoo | ||
| | Jellicent | ||
| | Zoroark | ||
| | Scrafty | ||
| | Lopunny | ||
| | Banette | ||
| | Crawdaunt | ||
| | Manectric | ||
| | Mawile | ||
| | Houndoom | ||
| | Forretress | ||
| | Flaaffy | ||
| | Xatu | ||
| | Noctowl | ||
| | Dewgong => if is_usum { 6 } else { 0 }, | ||
| Chansey | ||
| | Noibat | ||
| | Dedenne | ||
| | Clauncher | ||
| | Skrelp | ||
| | Inkay | ||
| | Floette // Warn: Apparently Only red Floette can call SOS | ||
| | Litleo | ||
| | Frillish | ||
| | Minccino | ||
| | Zorua | ||
| | Scraggy | ||
| | Basculin | ||
| | Buneary | ||
| | Shuppet | ||
| | Kecleon | ||
| | Corphish | ||
| | Electrike | ||
| | Pupitar | ||
| | Larvitar | ||
| | Houndour | ||
| | Pineco | ||
| | Aipom | ||
| | Mareep | ||
| | Natu | ||
| | Hoothoot | ||
| | Seel | ||
| | Ekans => if is_usum { 9 } else { 0 }, | ||
| Smoochum | ||
| | Flabebe | ||
| | Bisharp | ||
| | Golurk | ||
| | Golett | ||
| | Beheeyem | ||
| | Elgyem | ||
| | Mantyke | ||
| | MimeJr | ||
| | Clamperl | ||
| | Claydol | ||
| | Baltoy => if is_usum { 15 } else { 0 }, | ||
| _ => 0, | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this at 0.8.0 – it can be incremented later.