Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
129bd69
SOS slot changes
serenagrace Oct 6, 2025
3c273d1
Fixed line endings
serenagrace Oct 6, 2025
7dab31a
0.7.5 Push
serenagrace Oct 6, 2025
7f6ec08
Move to v0.8.0, improved Gen7 SOS Functionality
serenagrace Oct 7, 2025
46a6465
v0.8.1 Cleaned up some output ordering
serenagrace Oct 7, 2025
b6128c4
0.8.2 Added annotation to Caller Slot on SOS menu
serenagrace Oct 7, 2025
4580e8f
Update reader.rs
serenagrace Oct 7, 2025
112bdb0
v0.8.3 - Refactored pp calls, updated brief IV drawing
serenagrace Oct 7, 2025
e5bf4b8
v0.8.4
serenagrace Oct 7, 2025
597918c
Implemented Code Review changes
serenagrace Oct 8, 2025
3fa9736
Added Help Menu with more control info
serenagrace Oct 8, 2025
f99f49b
Fixed coloration for crystal and overflow in specific help
serenagrace Oct 8, 2025
751687b
updated resource urls
serenagrace Oct 8, 2025
d77d6c0
Cleanup and corrected friendship
serenagrace Oct 9, 2025
06cbcae
Cleanup and corrected friendship
serenagrace Oct 9, 2025
8c5e49b
Cargo format and review round 3
serenagrace Oct 10, 2025
821bae7
Remove dead code
serenagrace Oct 10, 2025
fe8c619
Updated format config
serenagrace Oct 10, 2025
72c6739
Added formatting target
serenagrace Oct 10, 2025
c62f1bd
Enforced formatting
serenagrace Oct 10, 2025
9bd354d
Stabilize formatting
serenagrace Oct 10, 2025
2db4b87
Added SOS Index, Caller Slot Call Rate
serenagrace Oct 10, 2025
2573574
Merge branch 'main' into sos_index
serenagrace Oct 10, 2025
b8f72e5
Fixed call rates to use species enum
serenagrace Oct 11, 2025
483041a
Split SFMT -> 32/64bit impls
serenagrace Oct 11, 2025
eca5052
Implemented RNG wrapper for SOS Sfmt32
serenagrace Oct 11, 2025
7bc56fc
PP Coloration and Color Constants
serenagrace Oct 13, 2025
9f337c2
Added failbacks to drawpkx functions
serenagrace Oct 13, 2025
a29c0a9
Gen7 Reader Slot/Side Refactor + SOS Track
serenagrace Oct 13, 2025
e7055c6
PP Coloration and Color Constants
serenagrace Oct 13, 2025
55401e8
Merge branch 'color-fix' into sos_index
serenagrace Oct 13, 2025
a2c0a54
v0.8.2 Tested and Formatted
serenagrace Oct 13, 2025
5742799
More strict about hiding SOS Menu
serenagrace Oct 13, 2025
8cdb86b
Fix slot F & Cleanup constants
serenagrace Oct 13, 2025
51e87a8
Fixed SOS RNG Hook for SM
serenagrace Oct 13, 2025
7e321b0
Make draw_brief more brief
serenagrace Oct 13, 2025
0a2ba6d
Add main rng advances to SOS
serenagrace Oct 13, 2025
8343276
Cleanup constants and fix hooks
serenagrace Oct 13, 2025
cffaa3e
correct rng test suite and sfmt64 index bug
serenagrace Oct 13, 2025
d801ed1
SFMT Panic semantics
serenagrace Oct 13, 2025
5efec80
PP indicator correction
serenagrace Oct 14, 2025
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
2 changes: 1 addition & 1 deletion reader_core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion reader_core/Cargo.toml
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"
Copy link
Owner

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.

edition = "2021"

[dependencies]
Expand Down
62 changes: 46 additions & 16 deletions reader_core/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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,
Expand All @@ -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();

Expand Down Expand Up @@ -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.");
Copy link
Owner

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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() {
Expand Down
262 changes: 262 additions & 0 deletions reader_core/src/gen7/call_rates.rs
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,
}
}
Loading