From 0882d1020d75bbddc8e8fbe30aed435e8814988a Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 29 Aug 2017 19:12:06 -0400 Subject: Added base stats for all of Deoxys's Formes --- gba/source/basestats.c | 41 ++++++++++++++++++++++++++++++++++++++++- gba/source/basestats.h | 6 +++++- gba/source/serialize.c | 5 +---- 3 files changed, 46 insertions(+), 6 deletions(-) (limited to 'gba') diff --git a/gba/source/basestats.c b/gba/source/basestats.c index a8c335b..759e7b5 100644 --- a/gba/source/basestats.c +++ b/gba/source/basestats.c @@ -6,6 +6,7 @@ * of the MIT license. See the LICENSE file for details. */ #include "basestats.h" +#include "gamedata.h" enum { GROWTH_MEDIUM_FAST, @@ -1655,7 +1656,7 @@ const struct SmallBaseStats gSmallBaseStats[] = { 100, 100, 100, 100, 100, 100, 255, // gender GROWTH_SLOW - }, { // Deoxys + }, { // Deoxys Normal Forme 50, 150, 50, 150, 150, 50, 255, // gender GROWTH_SLOW @@ -1665,3 +1666,41 @@ const struct SmallBaseStats gSmallBaseStats[] = { GROWTH_FAST } }; + +const struct SmallBaseStats gDeoxysBaseStats[] = { + { // Attack Forme + 50, 180, 20, 180, 20, 150, + 255, // gender + GROWTH_SLOW + }, { // Defense Forme + 50, 70, 160, 70, 160, 90, + 255, // gender + GROWTH_SLOW + }, { // Speed Forme + 50, 95, 90, 95, 90, 180, + 255, // gender + GROWTH_SLOW + } +}; + +const struct SmallBaseStats* BaseStatsForSpecies(int species) +{ + if ((species == DEOXYS_SPECIES_INDEX) && (!GAME_RS)) + { + if (GAME_FR) + { + return &gDeoxysBaseStats[0]; + } else if (GAME_LG) + { + return &gDeoxysBaseStats[1]; + } else if (GAME_EM) + { + return &gDeoxysBaseStats[2]; + } else { + // Impossible. + return 0; + } + } else { + return &gSmallBaseStats[species]; + } +} diff --git a/gba/source/basestats.h b/gba/source/basestats.h index 8adb031..97d5fb7 100644 --- a/gba/source/basestats.h +++ b/gba/source/basestats.h @@ -10,6 +10,10 @@ #include +#define UNOWN_SPECIES_INDEX 201 +#define SHEDINJA_SPECIES_INDEX 303 +#define DEOXYS_SPECIES_INDEX 410 + struct SmallBaseStats { u8 baseHP; u8 baseAttack; @@ -21,6 +25,6 @@ struct SmallBaseStats { u8 growthRate; }; -extern const struct SmallBaseStats gSmallBaseStats[]; +const struct SmallBaseStats* BaseStatsForSpecies(int species); #endif diff --git a/gba/source/serialize.c b/gba/source/serialize.c index 086e751..4a80bdf 100644 --- a/gba/source/serialize.c +++ b/gba/source/serialize.c @@ -11,9 +11,6 @@ #include "exptables.h" #include "dexorder.h" -#define UNOWN_SPECIES_INDEX 201 -#define SHEDINJA_SPECIES_INDEX 303 - enum Stat { StatAttack, StatDefense, @@ -63,7 +60,7 @@ void PokemonIntermediateInit( struct PokemonSubstruct2* sub2 = GetBoxPokemonSubstruct2(bpkm); struct PokemonSubstruct3* sub3 = GetBoxPokemonSubstruct3(bpkm); - const struct SmallBaseStats* baseStats = &gSmallBaseStats[sub0->species]; + const struct SmallBaseStats* baseStats = BaseStatsForSpecies(sub0->species); for (int i=0; i