summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-07-03 22:58:47 -0400
committerGitHub <noreply@github.com>2017-07-03 22:58:47 -0400
commit86a4a2cd3b7cda3b1885e53e7c9ac4d31270bd6c (patch)
tree5b3c87ca05d93264a7a3e62347a571299ce90795 /src
parent8d82578d3a101b06f9d2ced31738021007c4e533 (diff)
parentd8bfc0998dec654e908caddccf8147ea62c0ea4a (diff)
Merge pull request #328 from PikalaxALT/pokemon_data
Pokémon data
Diffstat (limited to 'src')
-rw-r--r--src/calculate_base_damage.c6
-rw-r--r--src/pokemon_2.c11
-rw-r--r--src/pokemon_3.c28
-rw-r--r--src/pokemon_data.c128
4 files changed, 144 insertions, 29 deletions
diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c
index ae60e30fe..0f2605e5b 100644
--- a/src/calculate_base_damage.c
+++ b/src/calculate_base_damage.c
@@ -35,7 +35,11 @@ extern struct PokemonStorage gPokemonStorage;
extern u8 gBadEggNickname[];
extern struct SpriteTemplate gSpriteTemplate_8208288[];
-extern u8 gSecretBaseTrainerClasses[];
+extern u8 gTrainerClassToPicIndex[];
+extern u8 gTrainerClassToNameIndex[];
+extern u8 gUnknown_08208238[];
+extern u8 gUnknown_0820823C[];
+extern u8 gStatStageRatios[];
extern u8 gHoldEffectToType[][2];
#define APPLY_STAT_MOD(var, mon, stat, statIndex) \
diff --git a/src/pokemon_2.c b/src/pokemon_2.c
index 5acdae4d3..543b032e2 100644
--- a/src/pokemon_2.c
+++ b/src/pokemon_2.c
@@ -38,7 +38,12 @@ extern struct PokemonStorage gPokemonStorage;
extern u8 gBadEggNickname[];
extern const struct SpriteTemplate gSpriteTemplate_8208288[];
//array of pointers to arrays of pointers to union AnimCmd (We probably need to typedef this.)
-extern u8 gSecretBaseTrainerClasses[];
+extern u8 gTrainerClassToPicIndex[];
+extern u8 gTrainerClassToNameIndex[];
+extern u8 gSecretBaseTrainerClasses[][5];
+extern u8 gUnknown_08208238[];
+extern u8 gUnknown_0820823C[];
+extern u8 gStatStageRatios[][2];
extern u8 gHoldEffectToType[][2];
u8 CountAliveMons(u8 a1)
@@ -1184,13 +1189,13 @@ void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord)
u8 GetSecretBaseTrainerPicIndex(void)
{
- u8 trainerClass = gSecretBaseTrainerClasses[(gSecretBaseRecord.trainerId[0] % 5) + (5 * gSecretBaseRecord.gender)];
+ u8 trainerClass = gSecretBaseTrainerClasses[gSecretBaseRecord.gender][gSecretBaseRecord.trainerId[0] % 5];
return gTrainerClassToPicIndex[trainerClass];
}
u8 GetSecretBaseTrainerNameIndex(void)
{
- u8 trainerClass = gSecretBaseTrainerClasses[(gSecretBaseRecord.trainerId[0] % 5) + (5 * gSecretBaseRecord.gender)];
+ u8 trainerClass = gSecretBaseTrainerClasses[gSecretBaseRecord.gender][gSecretBaseRecord.trainerId[0] % 5];
return gTrainerClassToNameIndex[trainerClass];
}
diff --git a/src/pokemon_3.c b/src/pokemon_3.c
index cb8eb2a46..c096e2e4b 100644
--- a/src/pokemon_3.c
+++ b/src/pokemon_3.c
@@ -23,28 +23,6 @@
#include "text.h"
#include "util.h"
-#define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220
-#define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220
-#define EVO_FRIENDSHIP_NIGHT 0x0003 // Pokémon levels up at night with friendship ≥ 220
-#define EVO_LEVEL 0x0004 // Pokémon reaches the specified level
-#define EVO_TRADE 0x0005 // Pokémon is traded
-#define EVO_TRADE_ITEM 0x0006 // Pokémon is traded while it's holding the specified item
-#define EVO_ITEM 0x0007 // specified item is used on Pokémon
-#define EVO_LEVEL_ATK_GT_DEF 0x0008 // Pokémon reaches the specified level with attack > defense
-#define EVO_LEVEL_ATK_EQ_DEF 0x0009 // Pokémon reaches the specified level with attack = defense
-#define EVO_LEVEL_ATK_LT_DEF 0x000a // Pokémon reaches the specified level with attack < defense
-#define EVO_LEVEL_SILCOON 0x000b // Pokémon reaches the specified level with a Silcoon personality value
-#define EVO_LEVEL_CASCOON 0x000c // Pokémon reaches the specified level with a Cascoon personality value
-#define EVO_LEVEL_NINJASK 0x000d // Pokémon reaches the specified level (special value for Ninjask)
-#define EVO_LEVEL_SHEDINJA 0x000e // Pokémon reaches the specified level (special value for Shedinja)
-#define EVO_BEAUTY 0x000f // Pokémon levels up with beauty ≥ specified value
-
-struct SpindaSpot
-{
- u8 x, y;
- u16 image[16];
-};
-
extern u8 gPlayerPartyCount;
extern u8 gEnemyPartyCount;
extern struct BattlePokemon gBattleMons[4];
@@ -103,8 +81,8 @@ bool8 HealStatusConditions(struct Pokemon *mon, u32 unused, u32 healMask, u8 bat
u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
{
- u8 *temp;
- u8 *itemEffect;
+ const u8 *temp;
+ const u8 *itemEffect;
u8 offset;
int i;
u8 j;
@@ -112,7 +90,7 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
offset = 6;
- temp = (u8 *) gItemEffectTable[itemId - 13];
+ temp = gItemEffectTable[itemId - 13];
if (!temp && itemId != ITEM_ENIGMA_BERRY)
return 0;
diff --git a/src/pokemon_data.c b/src/pokemon_data.c
new file mode 100644
index 000000000..6414134fb
--- /dev/null
+++ b/src/pokemon_data.c
@@ -0,0 +1,128 @@
+#include "global.h"
+#include "pokemon.h"
+#include "species.h"
+#include "trainer.h"
+#include "abilities.h"
+#include "moves.h"
+#include "hold_effects.h"
+#include "items.h"
+#include "sprite.h"
+#include "data2.h"
+
+#include "data/pokemon/dex_order.h"
+#include "data/pokemon/spinda_spots.h"
+#include "data/pokemon/item_effects.h"
+#include "data/pokemon/nature_stats.h"
+#include "data/pokemon/tmhm_learnsets.h"
+#include "data/pokemon/trainer_class_lookups.h"
+#include "data/pokemon/cry_ids.h"
+#include "data/pokemon/experience_tables.h"
+#include "data/pokemon/base_stats.h"
+#include "data/pokemon/level_up_learnsets.h"
+#include "data/pokemon/evolution.h"
+#include "data/pokemon/level_up_learnset_pointers.h"
+
+const u8 gUnknown_08208238[] = { // Masks for getting PP Up count, also PP Max values
+ 0x03, 0x0c, 0x30, 0xc0
+};
+
+const u8 gUnknown_0820823C[] = { // Masks for setting PP Up count
+ 0xFC, 0xF3, 0xCF, 0x3F
+};
+
+const u8 gUnknown_08208240[] = { // Values added to PP Up count
+ 0x01, 0x04, 0x10, 0x40
+};
+
+const u8 gStatStageRatios[][2] = {
+ {10, 40}, // -6
+ {10, 35}, // -5
+ {10, 30}, // -4
+ {10, 25}, // -3
+ {10, 20}, // -2
+ {10, 15}, // -1
+ {10, 10}, // 0
+ {15, 10}, // 1
+ {20, 10}, // 2
+ {25, 10}, // 3
+ {30, 10}, // 4
+ {35, 10}, // 5
+ {40, 10} // 6
+};
+
+const u8 unknownGameFreakAbbrev_820825E[] = _("ゲーフリ");
+
+const u8 gHoldEffectToType[][2] = {
+ {HOLD_EFFECT_BUG_POWER, TYPE_BUG},
+ {HOLD_EFFECT_STEEL_POWER, TYPE_STEEL},
+ {HOLD_EFFECT_GROUND_POWER, TYPE_GROUND},
+ {HOLD_EFFECT_ROCK_POWER, TYPE_ROCK},
+ {HOLD_EFFECT_GRASS_POWER, TYPE_GRASS},
+ {HOLD_EFFECT_DARK_POWER, TYPE_DARK},
+ {HOLD_EFFECT_FIGHTING_POWER, TYPE_FIGHTING},
+ {HOLD_EFFECT_ELECTRIC_POWER, TYPE_ELECTRIC},
+ {HOLD_EFFECT_WATER_POWER, TYPE_WATER},
+ {HOLD_EFFECT_FLYING_POWER, TYPE_FLYING},
+ {HOLD_EFFECT_POISON_POWER, TYPE_POISON},
+ {HOLD_EFFECT_ICE_POWER, TYPE_ICE},
+ {HOLD_EFFECT_GHOST_POWER, TYPE_GHOST},
+ {HOLD_EFFECT_PSYCHIC_POWER, TYPE_PSYCHIC},
+ {HOLD_EFFECT_FIRE_POWER, TYPE_FIRE},
+ {HOLD_EFFECT_DRAGON_POWER, TYPE_DRAGON},
+ {HOLD_EFFECT_NORMAL_POWER, TYPE_NORMAL}
+};
+
+extern void sub_80105A0(struct Sprite *);
+extern void oac_poke_opponent(struct Sprite *);
+
+const struct SpriteTemplate gSpriteTemplate_8208288[] = {
+ {0xFFFF, 0, &gOamData_81F96F0, NULL, gSpriteImageTable_81E7A10, gSpriteAffineAnimTable_81E7B70, sub_80105A0},
+ {0xFFFF, 0, &gOamData_81F96E8, NULL, gSpriteImageTable_81E7A30, gSpriteAffineAnimTable_81E7BEC, oac_poke_opponent},
+ {0xFFFF, 0, &gOamData_81F96F0, NULL, gSpriteImageTable_81E7A50, gSpriteAffineAnimTable_81E7B70, sub_80105A0},
+ {0xFFFF, 0, &gOamData_81F96E8, NULL, gSpriteImageTable_81E7A70, gSpriteAffineAnimTable_81E7BEC, oac_poke_opponent},
+};
+
+const u8 gSecretBaseTrainerClasses[][5] = {
+ // male
+ {TRAINER_CLASS_YOUNGSTER, TRAINER_CLASS_BUG_CATCHER, TRAINER_CLASS_RICH_BOY, TRAINER_CLASS_CAMPER, TRAINER_CLASS_COOL_TRAINER_M},
+ // female
+ {TRAINER_CLASS_LASS, TRAINER_CLASS_SCHOOL_KID_F, TRAINER_CLASS_LADY, TRAINER_CLASS_PICNICKER, TRAINER_CLASS_COOL_TRAINER_F}
+};
+
+const u8 gUnknown_082082F2[] = {
+ MON_DATA_HP_EV,
+ MON_DATA_ATK_EV,
+ MON_DATA_DEF_EV,
+ MON_DATA_SPD_EV,
+ MON_DATA_SPDEF_EV,
+ MON_DATA_SPATK_EV
+};
+
+const u8 gUnknown_082082F8[] = {1, 1, 3, 2, 4, 6};
+
+const s8 gUnknown_082082FE[][3] = {
+ // Happiness deltas
+ { 5, 3, 2},
+ { 5, 3, 2},
+ { 1, 1, 0},
+ { 3, 2, 1},
+ { 1, 1, 0},
+ { 1, 1, 1},
+ {-1, -1, -1},
+ {-5, -5, -10},
+ {-5, -5, -10}
+};
+
+const u16 gHMMoves[] = {
+ MOVE_CUT,
+ MOVE_FLY,
+ MOVE_SURF,
+ MOVE_STRENGTH,
+ MOVE_FLASH,
+ MOVE_ROCK_SMASH,
+ MOVE_WATERFALL,
+ MOVE_DIVE,
+ 0xffff
+};
+
+const u8 gJapaneseNidoranNames[][11] = {_("ニドラン♂"), _("ニドラン♀")};