diff options
-rw-r--r-- | gba/source/basestats.c | 41 | ||||
-rw-r--r-- | gba/source/basestats.h | 6 | ||||
-rw-r--r-- | gba/source/serialize.c | 5 |
3 files changed, 46 insertions, 6 deletions
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 @@ | |||
6 | * of the MIT license. See the LICENSE file for details. | 6 | * of the MIT license. See the LICENSE file for details. |
7 | */ | 7 | */ |
8 | #include "basestats.h" | 8 | #include "basestats.h" |
9 | #include "gamedata.h" | ||
9 | 10 | ||
10 | enum { | 11 | enum { |
11 | GROWTH_MEDIUM_FAST, | 12 | GROWTH_MEDIUM_FAST, |
@@ -1655,7 +1656,7 @@ const struct SmallBaseStats gSmallBaseStats[] = { | |||
1655 | 100, 100, 100, 100, 100, 100, | 1656 | 100, 100, 100, 100, 100, 100, |
1656 | 255, // gender | 1657 | 255, // gender |
1657 | GROWTH_SLOW | 1658 | GROWTH_SLOW |
1658 | }, { // Deoxys | 1659 | }, { // Deoxys Normal Forme |
1659 | 50, 150, 50, 150, 150, 50, | 1660 | 50, 150, 50, 150, 150, 50, |
1660 | 255, // gender | 1661 | 255, // gender |
1661 | GROWTH_SLOW | 1662 | GROWTH_SLOW |
@@ -1665,3 +1666,41 @@ const struct SmallBaseStats gSmallBaseStats[] = { | |||
1665 | GROWTH_FAST | 1666 | GROWTH_FAST |
1666 | } | 1667 | } |
1667 | }; | 1668 | }; |
1669 | |||
1670 | const struct SmallBaseStats gDeoxysBaseStats[] = { | ||
1671 | { // Attack Forme | ||
1672 | 50, 180, 20, 180, 20, 150, | ||
1673 | 255, // gender | ||
1674 | GROWTH_SLOW | ||
1675 | }, { // Defense Forme | ||
1676 | 50, 70, 160, 70, 160, 90, | ||
1677 | 255, // gender | ||
1678 | GROWTH_SLOW | ||
1679 | }, { // Speed Forme | ||
1680 | 50, 95, 90, 95, 90, 180, | ||
1681 | 255, // gender | ||
1682 | GROWTH_SLOW | ||
1683 | } | ||
1684 | }; | ||
1685 | |||
1686 | const struct SmallBaseStats* BaseStatsForSpecies(int species) | ||
1687 | { | ||
1688 | if ((species == DEOXYS_SPECIES_INDEX) && (!GAME_RS)) | ||
1689 | { | ||
1690 | if (GAME_FR) | ||
1691 | { | ||
1692 | return &gDeoxysBaseStats[0]; | ||
1693 | } else if (GAME_LG) | ||
1694 | { | ||
1695 | return &gDeoxysBaseStats[1]; | ||
1696 | } else if (GAME_EM) | ||
1697 | { | ||
1698 | return &gDeoxysBaseStats[2]; | ||
1699 | } else { | ||
1700 | // Impossible. | ||
1701 | return 0; | ||
1702 | } | ||
1703 | } else { | ||
1704 | return &gSmallBaseStats[species]; | ||
1705 | } | ||
1706 | } | ||
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 @@ | |||
10 | 10 | ||
11 | #include <gba.h> | 11 | #include <gba.h> |
12 | 12 | ||
13 | #define UNOWN_SPECIES_INDEX 201 | ||
14 | #define SHEDINJA_SPECIES_INDEX 303 | ||
15 | #define DEOXYS_SPECIES_INDEX 410 | ||
16 | |||
13 | struct SmallBaseStats { | 17 | struct SmallBaseStats { |
14 | u8 baseHP; | 18 | u8 baseHP; |
15 | u8 baseAttack; | 19 | u8 baseAttack; |
@@ -21,6 +25,6 @@ struct SmallBaseStats { | |||
21 | u8 growthRate; | 25 | u8 growthRate; |
22 | }; | 26 | }; |
23 | 27 | ||
24 | extern const struct SmallBaseStats gSmallBaseStats[]; | 28 | const struct SmallBaseStats* BaseStatsForSpecies(int species); |
25 | 29 | ||
26 | #endif | 30 | #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 @@ | |||
11 | #include "exptables.h" | 11 | #include "exptables.h" |
12 | #include "dexorder.h" | 12 | #include "dexorder.h" |
13 | 13 | ||
14 | #define UNOWN_SPECIES_INDEX 201 | ||
15 | #define SHEDINJA_SPECIES_INDEX 303 | ||
16 | |||
17 | enum Stat { | 14 | enum Stat { |
18 | StatAttack, | 15 | StatAttack, |
19 | StatDefense, | 16 | StatDefense, |
@@ -63,7 +60,7 @@ void PokemonIntermediateInit( | |||
63 | struct PokemonSubstruct2* sub2 = GetBoxPokemonSubstruct2(bpkm); | 60 | struct PokemonSubstruct2* sub2 = GetBoxPokemonSubstruct2(bpkm); |
64 | struct PokemonSubstruct3* sub3 = GetBoxPokemonSubstruct3(bpkm); | 61 | struct PokemonSubstruct3* sub3 = GetBoxPokemonSubstruct3(bpkm); |
65 | 62 | ||
66 | const struct SmallBaseStats* baseStats = &gSmallBaseStats[sub0->species]; | 63 | const struct SmallBaseStats* baseStats = BaseStatsForSpecies(sub0->species); |
67 | 64 | ||
68 | for (int i=0; i<POKEMON_NAME_LENGTH; i++) | 65 | for (int i=0; i<POKEMON_NAME_LENGTH; i++) |
69 | { | 66 | { |