diff options
-rw-r--r-- | Attributes.cpp | 424 | ||||
-rw-r--r-- | PartyEdit.cpp | 420 | ||||
-rwxr-xr-x | SE.o | bin | 132376 -> 161688 bytes | |||
-rw-r--r-- | SavEdit.h | 6 | ||||
-rw-r--r-- | compile.sh | 2 | ||||
-rw-r--r-- | notes.txt | 116 |
6 files changed, 666 insertions, 302 deletions
diff --git a/Attributes.cpp b/Attributes.cpp new file mode 100644 index 0000000..65303f3 --- /dev/null +++ b/Attributes.cpp @@ -0,0 +1,424 @@ +/* Programmer's name: Ashton + * Contact info: [HIDDEN] + * Date Created: Dec 7, 2023 + * Version: 1.0.0 + * Purpose: Handles the hashmap for species, moves, and items + * also print lists. + * Issue: + * 1.) Items not handled yet. + * 2.) print lists are sloppy, should call the maps instead. + */ + +#include <iostream> +#include "SavEdit.h" + + +void SavEdit::pkmnMap() +{ + /* + * Generates the mapping for pkmn values. + */ + + pkmn["94"] = "Abra"; + pkmn["ab"] = "Aerodactyl"; + pkmn["95"] = "Alakazam"; + pkmn["02"] = "Kangaskhan"; + pkmn["2d"] = "Arbok"; + pkmn["14"] = "Arcanine"; + pkmn["4a"] = "Articuno"; + pkmn["72"] = "Beedrill"; + pkmn["bc"] = "Bellsprout"; + pkmn["1c"] = "Blastoise"; + pkmn["99"] = "Bulbasaur"; + pkmn["7d"] = "Butterfree"; + pkmn["7b"] = "Caterpie"; + pkmn["28"] = "Chansey"; + pkmn["b4"] = "Charizard"; + pkmn["b0"] = "Charmander"; + pkmn["b2"] = "Charmeleon"; + pkmn["8e"] = "Clefable"; + pkmn["8b"] = "Cloyster"; + pkmn["11"] = "Cubone"; + pkmn["78"] = "Dewgong"; + pkmn["3b"] = "Diglett"; + pkmn["4c"] = "Ditto"; + pkmn["74"] = "Dodrio"; + pkmn["46"] = "Doduo"; + pkmn["59"] = "Dragonair"; + pkmn["42"] = "Dragonite"; + pkmn["58"] = "Dratini"; + pkmn["30"] = "Drowzee"; + pkmn["76"] = "Dugtrio"; + pkmn["66"] = "Eevee"; + pkmn["6c"] = "Ekans"; + pkmn["35"] = "Electabuzz"; + pkmn["8d"] = "Electrode"; + pkmn["0c"] = "Exeggcute"; + pkmn["0a"] = "Exeggutor"; + pkmn["40"] = "Farfetch'd"; + pkmn["23"] = "Fearow"; + pkmn["67"] = "Flareon"; + pkmn["19"] = "Gastly"; + pkmn["0e"] = "Gengar"; + pkmn["a9"] = "Geodude"; + pkmn["ba"] = "Gloom"; + pkmn["82"] = "Golbat"; + pkmn["9d"] = "Goldeen"; + pkmn["80"] = "Golduck"; + pkmn["31"] = "Golem"; + pkmn["27"] = "Graveler"; + pkmn["0d"] = "Grimer"; + pkmn["21"] = "Growlithe"; + pkmn["16"] = "Gyarados"; + pkmn["93"] = "Haunter"; + pkmn["2c"] = "Hitmonchan"; + pkmn["2b"] = "Hitmonlee"; + pkmn["5c"] = "Horsea"; + pkmn["01"] = "hydon"; + pkmn["81"] = "Hypno"; + pkmn["07"] = "Nidoking"; + pkmn["03"] = "Nidoran(M)"; + pkmn["64"] = "Jigglypuff"; + pkmn["68"] = "Jolteon"; + pkmn["48"] = "Jynx"; + pkmn["5a"] = "Kabuto"; + pkmn["5b"] = "Kabutops"; + pkmn["26"] = "Kadabra"; + pkmn["71"] = "Kakuna"; + pkmn["8a"] = "Kingler"; + pkmn["37"] = "Koffing"; + pkmn["4e"] = "Krabby"; + pkmn["13"] = "Lapras"; + pkmn["04"] = "Clefairy"; + pkmn["0b"] = "Lickitung"; + pkmn["08"] = "Slowbro"; + pkmn["7e"] = "Machamp"; + pkmn["29"] = "Machoke"; + pkmn["6a"] = "Machop"; + pkmn["85"] = "Magikarp"; + pkmn["33"] = "Magmar"; + pkmn["ad"] = "Magnemite"; + pkmn["36"] = "Magneton"; + pkmn["39"] = "Mankey"; + pkmn["91"] = "Marowak"; + pkmn["4d"] = "Meowth"; + pkmn["7c"] = "Metapod"; + pkmn["15"] = "Mew"; + pkmn["83"] = "Mewtwo"; + pkmn["49"] = "Moltres"; + pkmn["2a"] = "Mr. Mime"; + pkmn["88"] = "Muk"; + pkmn["10"] = "Nidoqueen"; + pkmn["0f"] = "Nidoran(F)"; + pkmn["a8"] = "Nidorina"; + pkmn["a7"] = "Nidorino"; + pkmn["53"] = "Ninetales"; + pkmn["b9"] = "Oddish"; + pkmn["06"] = "Voltorb"; + pkmn["62"] = "Omanyte"; + pkmn["63"] = "Omastar"; + pkmn["22"] = "Onix"; + pkmn["6d"] = "Paras"; + pkmn["2e"] = "Parasect"; + pkmn["05"] = "Spearow"; + pkmn["90"] = "Persian"; + pkmn["97"] = "Pidgeot"; + pkmn["96"] = "Pidgeotto"; + pkmn["24"] = "Pidgey"; + pkmn["54"] = "Pikachu"; + pkmn["1d"] = "Pinsir"; + pkmn["47"] = "Poliwag"; + pkmn["6e"] = "Poliwhirl"; + pkmn["6f"] = "Poliwrath"; + pkmn["a3"] = "Ponyta"; + pkmn["aa"] = "Porygon"; + pkmn["75"] = "Primeape"; + pkmn["2f"] = "Psyduck"; + pkmn["55"] = "Raichu"; + pkmn["a4"] = "Rapidash"; + pkmn["a6"] = "Raticate"; + pkmn["a5"] = "Rattata"; + pkmn["12"] = "Rhyhorn"; + pkmn["60"] = "Sandshrew"; + pkmn["61"] = "Sandslash"; + pkmn["1a"] = "Scyther"; + pkmn["5d"] = "Seadra"; + pkmn["9e"] = "Seaking"; + pkmn["3a"] = "Seel"; + pkmn["17"] = "Shellder"; + pkmn["25"] = "Slowpoke"; + pkmn["84"] = "Snorlax"; + pkmn["b1"] = "Squirtle"; + pkmn["98"] = "Starmie"; + pkmn["1b"] = "Staryu"; + pkmn["1e"] = "Tangela"; + pkmn["3c"] = "Tauros"; + pkmn["18"] = "Tentacool"; + pkmn["9b"] = "Tentacruel"; + pkmn["69"] = "Vaporeon"; + pkmn["77"] = "Venomoth"; + pkmn["41"] = "Venonat"; + pkmn["9a"] = "Venusaur"; + pkmn["be"] = "Victreebel"; + pkmn["bb"] = "Vileplume"; + pkmn["52"] = "Vulpix"; + pkmn["09"] = "Ivysaur"; + pkmn["b3"] = "Wartortle"; + pkmn["70"] = "Weedle"; + pkmn["bd"] = "Weepinbell"; + pkmn["8f"] = "Weezing"; + pkmn["65"] = "Wigglytuff"; + pkmn["4b"] = "Zapdos"; + pkmn["6b"] = "Zubat"; +} + +void SavEdit::moveMap() +{ + /* + * Generate mapping for moves. + */ + + move["01"] = "Pound"; + move["22"] = "Body Slam"; + move["43"] = "Low Kick"; + move["64"] = "Teleport"; + move["85"] = "Amnesia"; + move["02"] = "Karate Chop"; + move["23"] = "Wrap"; + move["44"] = "Counter"; + move["65"] = "Night Shade"; + move["86"] = "Kinesis"; + move["03"] = "Double Slap"; + move["24"] = "Take Down"; + move["45"] = "Seismic Toss"; + move["66"] = "Mimic"; + move["87"] = "Soft-Boiled"; + move["04"] = "Comet Punch"; + move["25"] = "Thrash"; + move["46"] = "Strength"; + move["67"] = "Screech"; + move["88"] = "High Jump Kick"; + move["05"] = "Mega Punch"; + move["26"] = "Double-Edge"; + move["47"] = "Absorb"; + move["68"] = "Double Team"; + move["89"] = "Glare"; + move["06"] = "Pay Day"; + move["27"] = "Tail Whip"; + move["48"] = "Mega Drain"; + move["69"] = "Recover"; + move["8a"] = "Dream Eater"; + move["07"] = "Fire Punch"; + move["28"] = "Poison Sting"; + move["49"] = "Leech Seed"; + move["6a"] = "Harden"; + move["8b"] = "Poison Gas"; + move["08"] = "Ice Punch"; + move["29"] = "Twineedle"; + move["4a"] = "Growth"; + move["6b"] = "Minimize"; + move["8c"] = "Barrage"; + move["09"] = "Thunder Punch"; + move["2a"] = "Pin Missile"; + move["4b"] = "Razor Leaf"; + move["6c"] = "Smokescreen"; + move["8d"] = "Leech Life"; + move["0a"] = "Scratch"; + move["2b"] = "Leer"; + move["4c"] = "Solar Beam"; + move["6d"] = "Confuse Ray"; + move["8e"] = "Lovely Kiss"; + move["0b"] = "Vice Grip"; + move["2c"] = "Bite"; + move["4d"] = "Poison Powder"; + move["6e"] = "Withdraw"; + move["8f"] = "Sky Attack"; + move["0c"] = "Guillotine"; + move["2d"] = "Growl"; + move["4e"] = "Stun Spore"; + move["6f"] = "Defense Curl"; + move["90"] = "Transform"; + move["0d"] = "Razor Wind"; + move["2e"] = "Roar"; + move["4f"] = "Sleep Powder"; + move["70"] = "Barrier"; + move["91"] = "Bubble"; + move["0e"] = "Swords Dance"; + move["2f"] = "Sing"; + move["50"] = "Petal Dance"; + move["71"] = "Light Screen"; + move["92"] = "Dizzy Punch"; + move["0f"] = "Cut"; + move["30"] = "Supersonic"; + move["51"] = "String Shot"; + move["72"] = "Haze"; + move["93"] = "Spore"; + move["10"] = "Gust"; + move["31"] = "Sonic Boom"; + move["52"] = "Dragon Rage"; + move["73"] = "Reflect"; + move["94"] = "Flash"; + move["11"] = "Wing Attack"; + move["32"] = "Disable"; + move["53"] = "Fire Spin"; + move["74"] = "Focus Energy"; + move["95"] = "Psywave"; + move["12"] = "Whirlwind"; + move["33"] = "Acid"; + move["54"] = "Thunder Shock"; + move["75"] = "Bide"; + move["96"] = "Splash"; + move["13"] = "Fly"; + move["34"] = "Ember"; + move["55"] = "Thunderbolt"; + move["76"] = "Metronome"; + move["97"] = "Acid Armor"; + move["14"] = "Bind"; + move["35"] = "Flamethrower"; + move["56"] = "Thunder Wave"; + move["77"] = "Mirror Move"; + move["98"] = "Crabhammer"; + move["15"] = "Slam"; + move["36"] = "Mist"; + move["57"] = "Thunder"; + move["78"] = "Self-Destruct"; + move["99"] = "Explosion"; + move["16"] = "Vine Whip"; + move["37"] = "Water Gun"; + move["58"] = "Rock Throw"; + move["79"] = "Egg Bomb"; + move["9a"] = "Fury Swipes"; + move["17"] = "Stomp"; + move["38"] = "Hydro Pump"; + move["59"] = "Earthquake"; + move["7a"] = "Lick"; + move["9b"] = "Bonemerang"; + move["18"] = "Double Kick"; + move["39"] = "Surf"; + move["5a"] = "Fissure"; + move["7b"] = "Smog"; + move["9c"] = "Rest"; + move["19"] = "Mega Kick"; + move["3a"] = "Ice Beam"; + move["5b"] = "Dig"; + move["7c"] = "Sludge"; + move["9d"] = "Rock Slide"; + move["1a"] = "Jump Kick"; + move["3b"] = "Blizzard"; + move["5c"] = "Toxic"; + move["7d"] = "Bone Club"; + move["9e"] = "Hyper Fang"; + move["1b"] = "Rolling Kick"; + move["3c"] = "Psybeam"; + move["5d"] = "Confusion"; + move["7e"] = "Fire Blast"; + move["9f"] = "Sharpen"; + move["1c"] = "Sand Attack"; + move["3d"] = "Bubble Beam"; + move["5e"] = "Psychic"; + move["7f"] = "Waterfall"; + move["a0"] = "Conversion"; + move["1d"] = "Headbutt"; + move["3e"] = "Aurora Beam"; + move["5f"] = "Hypnosis"; + move["80"] = "Clamp"; + move["a1"] = "Tri Attack"; + move["1e"] = "Horn Attack"; + move["3f"] = "Hyper Beam"; + move["60"] = "Meditate"; + move["81"] = "Swift"; + move["a2"] = "Super Fang"; + move["1f"] = "Fury Attack"; + move["40"] = "Peck"; + move["61"] = "Agility"; + move["82"] = "Skull Bash"; + move["a3"] = "Slash"; + move["20"] = "Horn Drill"; + move["41"] = "Drill Peck"; + move["62"] = "Quick Attack"; + move["83"] = "Spike Cannon"; + move["a4"] = "Substitute"; + move["21"] = "Tackle"; + move["42"] = "Submission"; + move["63"] = "Rage"; + move["84"] = "Constrict"; + move["a5"] = "Struggle"; +} + + +void SavEdit::printPkmnlist() +{ + /* + * Print pokemon list + */ + std::cout << "\n[Pokemon]\n" << std::endl; + + printf("%-18s%-18s%-18s%-18s%-18s%-18s%-18s\n","94: Abra","59: Dragonair","16: Gyarados","AD: Magnemite","97: Pidgeot","08: Slowbro","6B: Zubat"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","AB: Aerodactyl","42: Dragonite","93: Haunter","36: Magneton","96: Pidgeotto","25: Slowpoke"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","95: Alakazam","58: Dratini","2C: Hitmonchan","39: Mankey","24: Pidgey","84: Snorlax"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","2D: Arbok","30: Drowzee","2B: Hitmonlee","91: Marowak","54: Pikachu","05: Spearow"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","14: Arcanine","76: Dugtrio","5C: Horsea","4D: Meowth","1D: Pinsir","B1: Squirtle"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","4A: Articuno","66: Eevee","81: Hypno","7C: Metapod","47: Poliwag","98: Starmie"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","72: Beedrill","6C: Ekans","09: Ivysaur","15: Mew","6E: Poliwhirl","1B: Staryu"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","BC: Bellsprout","35: Electabuzz","64: Jigglypuff","83: Mewtwo","6F: Poliwrath","1E: Tangela"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","1C: Blastoise","8D: Electrode","68: Jolteon","49: Moltres","A3: Ponyta","3C: Tauros"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","99: Bulbasaur","0C: Exeggcute","48: Jynx","2A: Mr. Mime","AA: Porygon","18: Tentacool"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","7D: Butterfree","0A: Exeggutor","5A: Kabuto","88: Muk","75: Primeape","9B: Tentacruel"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","7B: Caterpie","40: Farfetch'd","5B: Kabutops","07: Nidoking","2F: Psyduck","69: Vaporeon"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","28: Chansey","23: Fearow","26: Kadabra","10: Nidoqueen","55: Raichu","77: Venomoth"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","B4: Charizard","67: Flareon","71: Kakuna","03: Nidoran(M)","A4: Rapidash","41: Venonat"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","B0: Charmander","19: Gastly","02: Kangaskhan","0F: Nidoran(F)","A6: Raticate","9A: Venusaur"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","B2: Charmeleon","0E: Gengar","8A: Kingler","A8: Nidorina","A5: Rattata","BE: Victreebel"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","8E: Clefable","A9: Geodude","37: Koffing","A7: Nidorino","01: Rhydon","BB: Vileplume"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","04: Clefairy","BA: Gloom","4E: Krabby","53: Ninetales","12: Rhyhorn","06: Voltorb"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","8B: Cloyster","82: Golbat","13: Lapras","B9: Oddish","60: Sandshrew","52: Vulpix"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","11: Cubone","9D: Goldeen","0B: Lickitung","62: Omanyte","61: Sandslash","B3: Wartortle"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","78: Dewgong","80: Golduck","7E: Machamp","63: Omastar","1A: Scyther","70: Weedle"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","3B: Diglett","31: Golem","29: Machoke","22: Onix","5D: Seadra","BD: Weepinbell"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","4C: Ditto","27: Graveler","6A: Machop","6D: Paras","9E: Seaking","8F: Weezing"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","74: Dodrio","0D: Grimer","85: Magikarp","2E: Parasect","3A: Seel","65: Wigglytuff"); + printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","46: Doduo","21: Growlithe","33: Magmar","90: Persian","17: Shellder","4B: Zapdos"); +} + +void SavEdit::printMovelist() +{ + /* + * Print move options. + */ + std::cout << "\n[Moveset]\n" << std::endl; + + printf("%-18s%-18s%-18s%-18s%-18s\n","01: Pound","22: Body Slam","43: Low Kick","64: Teleport","85: Amnesia"); + printf("%-18s%-18s%-18s%-18s%-18s\n","02: Karate Chop","23: Wrap","44: Counter","65: Night Shade","86: Kinesis"); + printf("%-18s%-18s%-18s%-18s%-18s\n","03: Double Slap","24: Take Down","45: Seismic Toss","66: Mimic","87: Soft-Boiled"); + printf("%-18s%-18s%-18s%-18s%-18s\n","04: Comet Punch","25: Thrash","46: Strength","67: Screech","88: High Jump Kick"); + printf("%-18s%-18s%-18s%-18s%-18s\n","05: Mega Punch","26: Double-Edge","47: Absorb","68: Double Team","89: Glare"); + printf("%-18s%-18s%-18s%-18s%-18s\n","06: Pay Day","27: Tail Whip","48: Mega Drain","69: Recover","8a: Dream Eater"); + printf("%-18s%-18s%-18s%-18s%-18s\n","07: Fire Punch","28: Poison Sting","49: Leech Seed","6a: Harden","8b: Poison Gas"); + printf("%-18s%-18s%-18s%-18s%-18s\n","08: Ice Punch","29: Twineedle","4a: Growth","6b: Minimize","8c: Barrage"); + printf("%-18s%-18s%-18s%-18s%-18s\n","09: Thunder Punch","2a: Pin Missile","4b: Razor Leaf","6c: Smokescreen","8d: Leech Life"); + printf("%-18s%-18s%-18s%-18s%-18s\n","0a: Scratch","2b: Leer","4c: Solar Beam","6d: Confuse Ray","8e: Lovely Kiss"); + printf("%-18s%-18s%-18s%-18s%-18s\n","0b: Vice Grip","2c: Bite","4d: Poison Powder","6e: Withdraw","8f: Sky Attack"); + printf("%-18s%-18s%-18s%-18s%-18s\n","0c: Guillotine","2d: Growl","4e: Stun Spore","6f: Defense Curl","90: Transform"); + printf("%-18s%-18s%-18s%-18s%-18s\n","0d: Razor Wind","2e: Roar","4f: Sleep Powder","70: Barrier","91: Bubble"); + printf("%-18s%-18s%-18s%-18s%-18s\n","0e: Swords Dance","2f: Sing","50: Petal Dance","71: Light Screen","92: Dizzy Punch"); + printf("%-18s%-18s%-18s%-18s%-18s\n","0f: Cut","30: Supersonic","51: String Shot","72: Haze","93: Spore"); + printf("%-18s%-18s%-18s%-18s%-18s\n","10: Gust","31: Sonic Boom","52: Dragon Rage","73: Reflect","94: Flash"); + printf("%-18s%-18s%-18s%-18s%-18s\n","11: Wing Attack","32: Disable","53: Fire Spin","74: Focus Energy","95: Psywave"); + printf("%-18s%-18s%-18s%-18s%-18s\n","12: Whirlwind","33: Acid","54: Thunder Shock","75: Bide","96: Splash"); + printf("%-18s%-18s%-18s%-18s%-18s\n","13: Fly","34: Ember","55: Thunderbolt","76: Metronome","97: Acid Armor"); + printf("%-18s%-18s%-18s%-18s%-18s\n","14: Bind","35: Flamethrower","56: Thunder Wave","77: Mirror Move","98: Crabhammer"); + printf("%-18s%-18s%-18s%-18s%-18s\n","15: Slam","36: Mist","57: Thunder","78: Self-Destruct","99: Explosion"); + printf("%-18s%-18s%-18s%-18s%-18s\n","16: Vine Whip","37: Water Gun","58: Rock Throw","79: Egg Bomb","9a: Fury Swipes"); + printf("%-18s%-18s%-18s%-18s%-18s\n","17: Stomp","38: Hydro Pump","59: Earthquake","7a: Lick","9b: Bonemerang"); + printf("%-18s%-18s%-18s%-18s%-18s\n","18: Double Kick","39: Surf","5a: Fissure","7b: Smog","9c: Rest"); + printf("%-18s%-18s%-18s%-18s%-18s\n","19: Mega Kick","3a: Ice Beam","5b: Dig","7c: Sludge","9d: Rock Slide"); + printf("%-18s%-18s%-18s%-18s%-18s\n","1a: Jump Kick","3b: Blizzard","5c: Toxic","7d: Bone Club","9e: Hyper Fang"); + printf("%-18s%-18s%-18s%-18s%-18s\n","1b: Rolling Kick","3c: Psybeam","5d: Confusion","7e: Fire Blast","9f: Sharpen"); + printf("%-18s%-18s%-18s%-18s%-18s\n","1c: Sand Attack","3d: Bubble Beam","5e: Psychic","7f: Waterfall","a0: Conversion"); + printf("%-18s%-18s%-18s%-18s%-18s\n","1d: Headbutt","3e: Aurora Beam","5f: Hypnosis","80: Clamp","a1: Tri Attack"); + printf("%-18s%-18s%-18s%-18s%-18s\n","1e: Horn Attack","3f: Hyper Beam","60: Meditate","81: Swift","a2: Super Fang"); + printf("%-18s%-18s%-18s%-18s%-18s\n","1f: Fury Attack","40: Peck","61: Agility","82: Skull Bash","a3: Slash"); + printf("%-18s%-18s%-18s%-18s%-18s\n","20: Horn Drill","41: Drill Peck","62: Quick Attack","83: Spike Cannon","a4: Substitute"); + printf("%-18s%-18s%-18s%-18s%-18s\n","21: Tackle","42: Submission","63: Rage","84: Constrict","a5: Struggle"); +} + diff --git a/PartyEdit.cpp b/PartyEdit.cpp index e635ef2..6c1bf12 100644 --- a/PartyEdit.cpp +++ b/PartyEdit.cpp @@ -3,7 +3,21 @@ * Date Created: Nov 18, 2023 * Version: 1.0.0 * Purpose: Edit the user's party and their individual attributes. - * Issues: None noticed at the moment. + * Issue: Aesthetically, the specific details could look nice. + * For example, subroutines `printMoves` and `printStats` should + * probably print to be side-by-side. + * + * ---------- EXAMPLE ------------------- + * [Party Member #3] Nidorano(M) + * LVL: 3 + * HP : 16 MOVE #1: Leer + * ATK: 8 MOVE #2: Tackle + * DEF: 7 MOVE #3: Toxic + * SPD: 8 MOVE #4: Peck + * SPE: 7 + * ---------- EXAMPLE ------------------- + * or something like this. + * */ #include <iostream> @@ -14,242 +28,6 @@ #include "SavEdit.h" -void SavEdit::pkmnMap() -{ - /* - * Generates the mapping for pkmn values. - */ - - pkmn["94"] = "Abra"; - pkmn["ab"] = "Aerodactyl"; - pkmn["95"] = "Alakazam"; - pkmn["02"] = "Kangaskhan"; - pkmn["2d"] = "Arbok"; - pkmn["14"] = "Arcanine"; - pkmn["4a"] = "Articuno"; - pkmn["72"] = "Beedrill"; - pkmn["bc"] = "Bellsprout"; - pkmn["1c"] = "Blastoise"; - pkmn["99"] = "Bulbasaur"; - pkmn["7d"] = "Butterfree"; - pkmn["7b"] = "Caterpie"; - pkmn["28"] = "Chansey"; - pkmn["b4"] = "Charizard"; - pkmn["b0"] = "Charmander"; - pkmn["b2"] = "Charmeleon"; - pkmn["8e"] = "Clefable"; - pkmn["8b"] = "Cloyster"; - pkmn["11"] = "Cubone"; - pkmn["78"] = "Dewgong"; - pkmn["3b"] = "Diglett"; - pkmn["4c"] = "Ditto"; - pkmn["74"] = "Dodrio"; - pkmn["46"] = "Doduo"; - pkmn["59"] = "Dragonair"; - pkmn["42"] = "Dragonite"; - pkmn["58"] = "Dratini"; - pkmn["30"] = "Drowzee"; - pkmn["76"] = "Dugtrio"; - pkmn["66"] = "Eevee"; - pkmn["6c"] = "Ekans"; - pkmn["35"] = "Electabuzz"; - pkmn["8d"] = "Electrode"; - pkmn["0c"] = "Exeggcute"; - pkmn["0a"] = "Exeggutor"; - pkmn["40"] = "Farfetch'd"; - pkmn["23"] = "Fearow"; - pkmn["67"] = "Flareon"; - pkmn["19"] = "Gastly"; - pkmn["0e"] = "Gengar"; - pkmn["a9"] = "Geodude"; - pkmn["ba"] = "Gloom"; - pkmn["82"] = "Golbat"; - pkmn["9d"] = "Goldeen"; - pkmn["80"] = "Golduck"; - pkmn["31"] = "Golem"; - pkmn["27"] = "Graveler"; - pkmn["0d"] = "Grimer"; - pkmn["21"] = "Growlithe"; - pkmn["16"] = "Gyarados"; - pkmn["93"] = "Haunter"; - pkmn["2c"] = "Hitmonchan"; - pkmn["2b"] = "Hitmonlee"; - pkmn["5c"] = "Horsea"; - pkmn["01"] = "hydon"; - pkmn["81"] = "Hypno"; - pkmn["07"] = "Nidoking"; - pkmn["03"] = "Nidoran♂"; - pkmn["64"] = "Jigglypuff"; - pkmn["68"] = "Jolteon"; - pkmn["48"] = "Jynx"; - pkmn["5a"] = "Kabuto"; - pkmn["5b"] = "Kabutops"; - pkmn["26"] = "Kadabra"; - pkmn["71"] = "Kakuna"; - pkmn["8a"] = "Kingler"; - pkmn["37"] = "Koffing"; - pkmn["4e"] = "Krabby"; - pkmn["13"] = "Lapras"; - pkmn["04"] = "lefairy"; - pkmn["0b"] = "Lickitung"; - pkmn["08"] = "lowbro"; - pkmn["7e"] = "Machamp"; - pkmn["29"] = "Machoke"; - pkmn["6a"] = "Machop"; - pkmn["85"] = "Magikarp"; - pkmn["33"] = "Magmar"; - pkmn["ad"] = "Magnemite"; - pkmn["36"] = "Magneton"; - pkmn["39"] = "Mankey"; - pkmn["91"] = "Marowak"; - pkmn["4d"] = "Meowth"; - pkmn["7c"] = "Metapod"; - pkmn["15"] = "Mew"; - pkmn["83"] = "Mewtwo"; - pkmn["49"] = "Moltres"; - pkmn["2a"] = "Mr. Mime"; - pkmn["88"] = "Muk"; - pkmn["10"] = "Nidoqueen"; - pkmn["0f"] = "Nidoran♀"; - pkmn["a8"] = "Nidorina"; - pkmn["a7"] = "Nidorino"; - pkmn["53"] = "Ninetales"; - pkmn["b9"] = "Oddish"; - pkmn["06"] = "oltorb"; - pkmn["62"] = "Omanyte"; - pkmn["63"] = "Omastar"; - pkmn["22"] = "Onix"; - pkmn["6d"] = "Paras"; - pkmn["2e"] = "Parasect"; - pkmn["05"] = "pearow"; - pkmn["90"] = "Persian"; - pkmn["97"] = "Pidgeot"; - pkmn["96"] = "Pidgeotto"; - pkmn["24"] = "Pidgey"; - pkmn["54"] = "Pikachu"; - pkmn["1d"] = "Pinsir"; - pkmn["47"] = "Poliwag"; - pkmn["6e"] = "Poliwhirl"; - pkmn["6f"] = "Poliwrath"; - pkmn["a3"] = "Ponyta"; - pkmn["aa"] = "Porygon"; - pkmn["75"] = "Primeape"; - pkmn["2f"] = "Psyduck"; - pkmn["55"] = "Raichu"; - pkmn["a4"] = "Rapidash"; - pkmn["a6"] = "Raticate"; - pkmn["a5"] = "Rattata"; - pkmn["12"] = "Rhyhorn"; - pkmn["60"] = "Sandshrew"; - pkmn["61"] = "Sandslash"; - pkmn["1a"] = "Scyther"; - pkmn["5d"] = "Seadra"; - pkmn["9e"] = "Seaking"; - pkmn["3a"] = "Seel"; - pkmn["17"] = "Shellder"; - pkmn["25"] = "Slowpoke"; - pkmn["84"] = "Snorlax"; - pkmn["b1"] = "Squirtle"; - pkmn["98"] = "Starmie"; - pkmn["1b"] = "Staryu"; - pkmn["1e"] = "Tangela"; - pkmn["3c"] = "Tauros"; - pkmn["18"] = "Tentacool"; - pkmn["9b"] = "Tentacruel"; - pkmn["69"] = "Vaporeon"; - pkmn["77"] = "Venomoth"; - pkmn["41"] = "Venonat"; - pkmn["9a"] = "Venusaur"; - pkmn["be"] = "Victreebel"; - pkmn["bb"] = "Vileplume"; - pkmn["52"] = "Vulpix"; - pkmn["09"] = "Ivysaur"; - pkmn["b3"] = "Wartortle"; - pkmn["70"] = "Weedle"; - pkmn["bd"] = "Weepinbell"; - pkmn["8f"] = "Weezing"; - pkmn["65"] = "Wigglytuff"; - pkmn["4b"] = "Zapdos"; - pkmn["6b"] = "Zubat"; -} - - -void SavEdit::printPkmnlist() -{ - /* - * Print pokemon list - */ - std::cout << "\n[Pokemon]\n" << std::endl; - - printf("%-18s%-18s%-18s%-18s%-18s%-18s%-18s\n","94: Abra","59: Dragonair","16: Gyarados","AD: Magnemite","97: Pidgeot","08: Slowbro","6B: Zubat"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","AB: Aerodactyl","42: Dragonite","93: Haunter","36: Magneton","96: Pidgeotto","25: Slowpoke"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","95: Alakazam","58: Dratini","2C: Hitmonchan","39: Mankey","24: Pidgey","84: Snorlax"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","2D: Arbok","30: Drowzee","2B: Hitmonlee","91: Marowak","54: Pikachu","05: Spearow"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","14: Arcanine","76: Dugtrio","5C: Horsea","4D: Meowth","1D: Pinsir","B1: Squirtle"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","4A: Articuno","66: Eevee","81: Hypno","7C: Metapod","47: Poliwag","98: Starmie"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","72: Beedrill","6C: Ekans","09: Ivysaur","15: Mew","6E: Poliwhirl","1B: Staryu"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","BC: Bellsprout","35: Electabuzz","64: Jigglypuff","83: Mewtwo","6F: Poliwrath","1E: Tangela"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","1C: Blastoise","8D: Electrode","68: Jolteon","49: Moltres","A3: Ponyta","3C: Tauros"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","99: Bulbasaur","0C: Exeggcute","48: Jynx","2A: Mr. Mime","AA: Porygon","18: Tentacool"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","7D: Butterfree","0A: Exeggutor","5A: Kabuto","88: Muk","75: Primeape","9B: Tentacruel"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","7B: Caterpie","40: Farfetch'd","5B: Kabutops","07: Nidoking","2F: Psyduck","69: Vaporeon"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","28: Chansey","23: Fearow","26: Kadabra","10: Nidoqueen","55: Raichu","77: Venomoth"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","B4: Charizard","67: Flareon","71: Kakuna","03: Nidoran(M)","A4: Rapidash","41: Venonat"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","B0: Charmander","19: Gastly","02: Kangaskhan","0F: Nidoran(F)","A6: Raticate","9A: Venusaur"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","B2: Charmeleon","0E: Gengar","8A: Kingler","A8: Nidorina","A5: Rattata","BE: Victreebel"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","8E: Clefable","A9: Geodude","37: Koffing","A7: Nidorino","01: Rhydon","BB: Vileplume"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","04: Clefairy","BA: Gloom","4E: Krabby","53: Ninetales","12: Rhyhorn","06: Voltorb"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","8B: Cloyster","82: Golbat","13: Lapras","B9: Oddish","60: Sandshrew","52: Vulpix"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","11: Cubone","9D: Goldeen","0B: Lickitung","62: Omanyte","61: Sandslash","B3: Wartortle"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","78: Dewgong","80: Golduck","7E: Machamp","63: Omastar","1A: Scyther","70: Weedle"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","3B: Diglett","31: Golem","29: Machoke","22: Onix","5D: Seadra","BD: Weepinbell"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","4C: Ditto","27: Graveler","6A: Machop","6D: Paras","9E: Seaking","8F: Weezing"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","74: Dodrio","0D: Grimer","85: Magikarp","2E: Parasect","3A: Seel","65: Wigglytuff"); - printf("%-18s%-18s%-18s%-18s%-18s%-18s\n","46: Doduo","21: Growlithe","33: Magmar","90: Persian","17: Shellder","4B: Zapdos"); -} - -void SavEdit::printMovelist() -{ - /* - * Print move options. - */ - std::cout << "\n[Moveset]\n" << std::endl; - - printf("%-18s%-18s%-18s%-18s%-18s\n","01: Pound","22: Body Slam","43: Low Kick","64: Teleport","85: Amnesia"); - printf("%-18s%-18s%-18s%-18s%-18s\n","02: Karate Chop","23: Wrap","44: Counter","65: Night Shade","86: Kinesis"); - printf("%-18s%-18s%-18s%-18s%-18s\n","03: Double Slap","24: Take Down","45: Seismic Toss","66: Mimic","87: Soft-Boiled"); - printf("%-18s%-18s%-18s%-18s%-18s\n","04: Comet Punch","25: Thrash","46: Strength","67: Screech","88: High Jump Kick"); - printf("%-18s%-18s%-18s%-18s%-18s\n","05: Mega Punch","26: Double-Edge","47: Absorb","68: Double Team","89: Glare"); - printf("%-18s%-18s%-18s%-18s%-18s\n","06: Pay Day","27: Tail Whip","48: Mega Drain","69: Recover","8a: Dream Eater"); - printf("%-18s%-18s%-18s%-18s%-18s\n","07: Fire Punch","28: Poison Sting","49: Leech Seed","6a: Harden","8b: Poison Gas"); - printf("%-18s%-18s%-18s%-18s%-18s\n","08: Ice Punch","29: Twineedle","4a: Growth","6b: Minimize","8c: Barrage"); - printf("%-18s%-18s%-18s%-18s%-18s\n","09: Thunder Punch","2a: Pin Missile","4b: Razor Leaf","6c: Smokescreen","8d: Leech Life"); - printf("%-18s%-18s%-18s%-18s%-18s\n","0a: Scratch","2b: Leer","4c: Solar Beam","6d: Confuse Ray","8e: Lovely Kiss"); - printf("%-18s%-18s%-18s%-18s%-18s\n","0b: Vise Grip","2c: Bite","4d: Poison Powder","6e: Withdraw","8f: Sky Attack"); - printf("%-18s%-18s%-18s%-18s%-18s\n","0c: Guillotine","2d: Growl","4e: Stun Spore","6f: Defense Curl","90: Transform"); - printf("%-18s%-18s%-18s%-18s%-18s\n","0d: Razor Wind","2e: Roar","4f: Sleep Powder","70: Barrier","91: Bubble"); - printf("%-18s%-18s%-18s%-18s%-18s\n","0e: Swords Dance","2f: Sing","50: Petal Dance","71: Light Screen","92: Dizzy Punch"); - printf("%-18s%-18s%-18s%-18s%-18s\n","0f: Cut","30: Supersonic","51: String Shot","72: Haze","93: Spore"); - printf("%-18s%-18s%-18s%-18s%-18s\n","10: Gust","31: Sonic Boom","52: Dragon Rage","73: Reflect","94: Flash"); - printf("%-18s%-18s%-18s%-18s%-18s\n","11: Wing Attack","32: Disable","53: Fire Spin","74: Focus Energy","95: Psywave"); - printf("%-18s%-18s%-18s%-18s%-18s\n","12: Whirlwind","33: Acid","54: Thunder Shock","75: Bide","96: Splash"); - printf("%-18s%-18s%-18s%-18s%-18s\n","13: Fly","34: Ember","55: Thunderbolt","76: Metronome","97: Acid Armor"); - printf("%-18s%-18s%-18s%-18s%-18s\n","14: Bind","35: Flamethrower","56: Thunder Wave","77: Mirror Move","98: Crabhammer"); - printf("%-18s%-18s%-18s%-18s%-18s\n","15: Slam","36: Mist","57: Thunder","78: Self-Destruct","99: Explosion"); - printf("%-18s%-18s%-18s%-18s%-18s\n","16: Vine Whip","37: Water Gun","58: Rock Throw","79: Egg Bomb","9a: Fury Swipes"); - printf("%-18s%-18s%-18s%-18s%-18s\n","17: Stomp","38: Hydro Pump","59: Earthquake","7a: Lick","9b: Bonemerang"); - printf("%-18s%-18s%-18s%-18s%-18s\n","18: Double Kick","39: Surf","5a: Fissure","7b: Smog","9c: Rest"); - printf("%-18s%-18s%-18s%-18s%-18s\n","19: Mega Kick","3a: Ice Beam","5b: Dig","7c: Sludge","9d: Rock Slide"); - printf("%-18s%-18s%-18s%-18s%-18s\n","1a: Jump Kick","3b: Blizzard","5c: Toxic","7d: Bone Club","9e: Hyper Fang"); - printf("%-18s%-18s%-18s%-18s%-18s\n","1b: Rolling Kick","3c: Psybeam","5d: Confusion","7e: Fire Blast","9f: Sharpen"); - printf("%-18s%-18s%-18s%-18s%-18s\n","1c: Sand Attack","3d: Bubble Beam","5e: Psychic","7f: Waterfall","a0: Conversion"); - printf("%-18s%-18s%-18s%-18s%-18s\n","1d: Headbutt","3e: Aurora Beam","5f: Hypnosis","80: Clamp","a1: Tri Attack"); - printf("%-18s%-18s%-18s%-18s%-18s\n","1e: Horn Attack","3f: Hyper Beam","60: Meditate","81: Swift","a2: Super Fang"); - printf("%-18s%-18s%-18s%-18s%-18s\n","1f: Fury Attack","40: Peck","61: Agility","82: Skull Bash","a3: Slash"); - printf("%-18s%-18s%-18s%-18s%-18s\n","20: Horn Drill","41: Drill Peck","62: Quick Attack","83: Spike Cannon","a4: Substitute"); - printf("%-18s%-18s%-18s%-18s%-18s\n","21: Tackle","42: Submission","63: Rage","84: Constrict","a5: Struggle"); -} - int SavEdit::selectStat() { /* @@ -257,10 +35,10 @@ int SavEdit::selectStat() */ bool safe = false; - int stat_val_offset; + int stat_val_offset = 0; - std::cout << " 1: Hitpoints\n"; - std::cout << " 2: Level\n"; + std::cout << " 1: Level\n"; + std::cout << " 2: Hitpoints\n"; std::cout << " 3: Attack\n"; std::cout << " 4: Defense\n"; std::cout << " 5: Speed\n"; @@ -271,34 +49,36 @@ int SavEdit::selectStat() std::cout << " 0: MOVE 4\n"; std::cout << "10: Pokemon\n" << std::endl; + std::cout << "Select:"; + while(!safe) { - std::cin >> stat_val_offset; + std::cin >> std::dec >> stat_val_offset; switch(stat_val_offset) { case 1: - stat_val_offset = 0x2B; // NOTE: 0x0A is CURRENTLY HP + stat_val_offset = 0x00; safe = true; break; case 2: - stat_val_offset = 0x29; + stat_val_offset = 0x01; safe = true; break; case 3: - stat_val_offset = 0x2D; + stat_val_offset = 0x02; safe = true; break; case 4: - stat_val_offset = 0x2F; + stat_val_offset = 0x03; safe = true; break; case 5: - stat_val_offset = 0x31; + stat_val_offset = 0x04; safe = true; break; case 6: - stat_val_offset = 0x33; + stat_val_offset = 0x05; safe = true; break; case 7: @@ -318,14 +98,14 @@ int SavEdit::selectStat() safe = true; break; case 10: - stat_val_offset = 0x01; + stat_val_offset = 0x14; safe = true; break; default: std::cout << "Try again." << std::endl; break; } - // clear buf + // clear buffer std::cin.clear(); std::cin.ignore(); } @@ -338,38 +118,72 @@ void SavEdit::printParty() /* * Iterates through current party. */ - for(int i = 0; i < 6; ++i) + + int start_addr = 0x2f2c; + + for(int i = 1; i <= 6; ++i) { std::stringstream mem_to_hex; - mem_to_hex << std::hex << mem.at(0x2F2C + (i + 1) + 0x01); + mem_to_hex << std::setw(2) << std::setfill('0') << std::hex << mem.at(start_addr + i); std::string char_loc(mem_to_hex.str()); - std::cout << i + 1 << ": " << pkmn[char_loc] << std::endl; - //std::cout << i + 1 << ": " << mem.at(0x2F2C + (i+1) + 0x01) << std::endl; - //std::string party_mem = mem.at(0x2F2C + (i+1)); - //std::string party_name = mem.at(party_mem + 0x01); // Name offset. - //std::cout << i+1 << ": " << party_name << std::endl; + std::cout << i << ": " << pkmn[char_loc] << std::endl; } } +void SavEdit::printMoves(int party_member) +{ + /* + * Iterate through given move set of selected party member. + */ + int loc = 0x2f0f + (0x2C * party_member); + + for(int i = 1; i <= 4; ++i) + { + std::stringstream mem_to_hex; + mem_to_hex << std::setw(2) << std::setfill('0') << std::hex << mem.at(loc + i); + std::string char_loc(mem_to_hex.str()); + std::cout << "MOVE #" << i << ": " << move[char_loc] << std::endl; + } +} + +void SavEdit::printStats(int party_member) +{ + /* + * Displays stats of selected party member + */ + int loc = 0x2f29 + (44 * party_member); + std::cout << "LVL: " << mem.at(loc + 0x0) << std::endl; + std::cout << "HP: " << mem.at(loc + 0x2) << std::endl; + std::cout << "ATK: " << mem.at(loc + 0x4) << std::endl; + std::cout << "DEF: " << mem.at(loc + 0x6) << std::endl; + std::cout << "SPD: " << mem.at(loc + 0x8) << std::endl; + std::cout << "SPE: " << mem.at(loc + 0xA) << std::endl; +} + void SavEdit::modMainMenu() { /* * State for editing */ - int party_member_offset; - int stat_val_offset; - int state_value; + int start_point = 0x2f29; + int party_member_offset = 0; + int stat_val_offset = 0; + int state_value = 0; int party_member = 0; + // Make room + clear(); + // Create the pkmn name map pkmnMap(); + // Create the move name map + moveMap(); // Print a list of party members for the user to edit printParty(); - - std::cout << "Select party member: " << std::endl; + std::cout << "Select party member: "; while((party_member > 6) || (party_member < 1)) { @@ -381,68 +195,74 @@ void SavEdit::modMainMenu() } } - // Zero-indexed update - party_member-=1; + // Display party member being edited: + + // Make room again + clear(); - // Display party member being edited. // First we need to convert deci -> hex before searching. std::stringstream mem_to_hex; - // The addr has to be hard coded. - mem_to_hex << std::hex << mem.at(0x2F2C + (party_member + 0x01)); + mem_to_hex << std::setw(2) << std::setfill('0') << std::hex << mem.at(start_point + 0x03 + party_member); // Convert to a string. std::string char_loc(mem_to_hex.str()); - std::cout << "[EDITING: " << pkmn[char_loc] << "]" << std::endl; + std::cout << "[Party Member #" << party_member << "] "; + std::cout << pkmn[char_loc] << std::endl; + + // Print out stats of party member to edit. + printStats(party_member); + // Print moves list + printMoves(party_member); + + std::cout << std::endl; + + std::cout << "Options:" << std::endl; // Get the stat address stat_val_offset = selectStat(); - // The party member attribute block is +44 times its party position - // with an exception for the pkmn id. - party_member_offset = 44 * party_member; - // Get stat value std::cout << "What would you like to set this to?" << std::endl; - if( (stat_val_offset == 0x10) || - (stat_val_offset == 0x11) || - (stat_val_offset == 0x12) || - (stat_val_offset == 0x13)) + switch(stat_val_offset) { - printMovelist(); - // Move sets require hex. - std::cin >> std::hex >> state_value; - }else if (stat_val_offset == 0x01){ - // The only value not in the +44(n-1), where n is party pos, block is - // the pkmn id. - party_member_offset = party_member+1; - printPkmnlist(); - // Pokemon list requires hex. - std::cin >> std::hex >> state_value; - }else{ - // All other stats require deci. - std::cin >> state_value; + case 0x14: + // Change species. + // TODO: update next memory to 0xFF if creating a new party member. + // TODO: update 0x2F2C to the number of party members. + party_member_offset = start_point + 0x03 + party_member; + printPkmnlist(); + std::cin >> std::hex >> state_value; + break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + // Change move. + printMovelist(); + std::cin >> std::hex >> state_value; // TODO: Check user input + party_member_offset = (start_point - 0x1A) + (0x2C * party_member) + (stat_val_offset - 0x0F); + //party_member_offset = 0x2f0f + (0x2C * party_member) + (stat_val_offset - 0x0F); + break; + default: + party_member_offset = start_point + (44 * party_member) + (stat_val_offset * 0x02); + std::cin >> state_value; // TODO: Check user input. + break; } - - modStats(party_member_offset, stat_val_offset, state_value); - + + modStats(party_member_offset, state_value); } -void SavEdit::modStats(int party_member_offset, int stat_val_offset, int state_value) +void SavEdit::modStats(int party_member_offset, int state_value) { /* * Edit given party member's given stat. */ - // Start of memory block for the party - int party_offset = 0x2F2C; - - // Final memory address to edit. int mem_to_edit; - // jump to proper memory - mem_to_edit = party_offset + party_member_offset + stat_val_offset; + // Set memory address + mem_to_edit = party_member_offset; - // Edit that memory. + // Edit that memory mem.at(mem_to_edit) = state_value; - } Binary files differ@@ -30,12 +30,15 @@ class SavEdit void debug(); void displayItems(); void pkmnMap(); + void moveMap(); void printPkmnlist(); void printMovelist(); int selectStat(); void modMainMenu(); - void modStats(int, int, int); + void modStats(int, int); void printParty(); + void printStats(int); + void printMoves(int); private: std::string filename; std::vector<int> mem; @@ -43,6 +46,7 @@ class SavEdit int lang; int m_changes = 0; std::map<std::string, std::string> pkmn; + std::map<std::string, std::string> move; }; #endif @@ -1 +1 @@ -g++ -Wall main.cpp SavEdit.cpp PrivateAccess.cpp UserOptions.cpp TextOptions.cpp PartyEdit.cpp -o SE.o +g++ -Wall main.cpp SavEdit.cpp PrivateAccess.cpp UserOptions.cpp TextOptions.cpp PartyEdit.cpp Attributes.cpp -o SE.o @@ -38,3 +38,119 @@ NOTE: This is the identifier for ITEM #0 OFFSET: 0x25CB NOTE: This is the quantity for ITEM #0 + +--------- +# Trying to find the party stats. +--------- + +00002F2C: THE AMOUNT OF PARTY MEMBERS. * note: The next slot MAY need to be 0xFF? +00002F2D: PARTY #1 SPECIES ID +00002F2E: PARTY #2 SPECIES ID +00002F2F: PARTY #3 SPECIES ID +00002F30: PARTY #4 SPECIES ID +00002F31: PARTY #5 SPECIES ID +00002F32: PARTY #6 SPECIES ID + +** START NTOES ** +note: (0x2F2C + 0x2A + SLOT_NUM(0x01) +note: (0x2F2C + (0x2B * 0x02) - 0x01 + 2C(SLOT_NUM - 0x01) +It may be 0x2F2C + 0x2B (SLOT_NUM) - + +I can arrive at the Party #1 attrib with: +>0x2f2c + (0x29 * 1) = 0x2f57 (PARTY #1 HP) +This is fine. No additions required. + +But we want 0x2f81 for party #2. This means +>0x2f2c + (0x29 * 2) = 0x2f7e +So we need to add 3 to this. + +We want 0x2fad for party #3. +>0x2f2c + (0x29 * 3) = 0x2fa7 +So we need to add 6 to this. + +Perhaps I need to consider this algorithm instead: +0x2f2c + (0x29 * n) + (3 * (n - 1)) +This makes for: 0x2FC7 + +(ALSO, please check to see if 0x2f31 changes to 255) +(if it does, the next memory point has to be 0xff) +(in the list.) <-- (UPDATE: It does) + +-- trying this: + +Subtracting the addr of P3.SPE - P2.SPE: +0x2FB7 - 0x2F8B = 2C [44] + +0x2F8B - 0x2C = 0x2F5F (P1.SPE) + +By this logic, adding 0x2C to P3.SPE should send me to +P4.SPE, right? + +00002FE3: 08 (the 4th party has 8sp.) + +So, we should just have a starting point, jump to the point +0x2f29. Then we can just add 44i, where i is the position. +Then we add 2j where j is the attribute type. LVL=0, HP=1, +and so on. + +** END NOTES ** + +00002F55: PARTY #1 LVL +00002F57: PARTY #1 HP +00002F59: PARTY #1 ATK +00002F5B: PARTY #1 DEF +00002F5D: PARTY #1 SPD +00002F5F: PARTY #1 SPE + +00002F81: PARTY #2 LVL +00002F83: PARTY #2 HP +00002F85: PARTY #2 ATK +00002F87: PARTY #2 DEF +00002F89: PARTY #2 SPD +00002F8B: PARTY #2 SPE + +00002FAD: PARTY #3 LVL +00002FAF: PARTY #3 HP +00002FB1: PARTY #3 ATK +00002FB3: PARTY #3 DEF +00002FB5: PARTY #3 SPD +00002FB7: PARTY #3 SPE + + +** Notes on move list ** + +00002F3C: PARTY #1 MOVE 1 +00002F3D: PARTY #1 MOVE 2 +00002F3E: PARTY #1 MOVE 3 +00002F3F: PARTY #1 MOVE 4 + +00002F68: PARTY #2 MOVE 1 +00002F69: PARTY #2 MOVE 2 +00002F6A: PARTY #2 MOVE 3 +00002F6B: PARTY #2 MOVE 4 + +So, it looks like this is another (2C * position) situation [+44] +If this is true then PARTY #3 MOVE 1 will be: 0x2f94 + +IT WAS. THANK GOD. So the starting point is: +0x2F0F + (2C * position) + MOVE_NUMBER +(ALT: 0x2f10 + (2c * position) + (MOVE_NUMBER-1)) but that seems pointlessly +long. + +00002F94: PARTY #3 MOVE 1 +00002F95: PARTY #3 MOVE 2 +00002F96: PARTY #3 MOVE 3 +00002F97: PARTY #3 MOVE 4 + + + +I need to catch a pokemon to see what +number 2 is, probably. + + + +** END notes on move list ** + + + + |