diff options
-rw-r--r-- | data/data.s | 9 | ||||
-rw-r--r-- | graphics/spinda_spots/spot_0.bin | bin | 0 -> 32 bytes | |||
-rw-r--r-- | graphics/spinda_spots/spot_1.bin | bin | 0 -> 32 bytes | |||
-rw-r--r-- | graphics/spinda_spots/spot_2.bin | bin | 0 -> 32 bytes | |||
-rw-r--r-- | graphics/spinda_spots/spot_3.bin | bin | 0 -> 32 bytes | |||
-rw-r--r-- | include/constants/item_effects.h | 79 | ||||
-rw-r--r-- | include/data2.h | 12 | ||||
-rw-r--r-- | src/data/pokemon/item_effects.h | 473 | ||||
-rw-r--r-- | src/pokemon.c | 55 |
9 files changed, 607 insertions, 21 deletions
diff --git a/data/data.s b/data/data.s index 74fee181f..6b46d5b99 100644 --- a/data/data.s +++ b/data/data.s @@ -368,15 +368,6 @@ gUnknown_8251FEE:: @ 8251FEE gUnknown_8252324:: @ 8252324 .incbin "baserom.gba", 0x252324, 0x338 -gSpindaSpotGraphics:: @ 825265C - .incbin "baserom.gba", 0x25265C, 0x260 - -gItemEffectTable:: @ 82528BC - .incbin "baserom.gba", 0x2528BC, 0x28C - -gNatureStatTable:: @ 8252B48 - .incbin "baserom.gba", 0x252B48, 0x80 - .section .rodata.825EF0C .align 2 diff --git a/graphics/spinda_spots/spot_0.bin b/graphics/spinda_spots/spot_0.bin Binary files differnew file mode 100644 index 000000000..938d1d592 --- /dev/null +++ b/graphics/spinda_spots/spot_0.bin diff --git a/graphics/spinda_spots/spot_1.bin b/graphics/spinda_spots/spot_1.bin Binary files differnew file mode 100644 index 000000000..db46b5de4 --- /dev/null +++ b/graphics/spinda_spots/spot_1.bin diff --git a/graphics/spinda_spots/spot_2.bin b/graphics/spinda_spots/spot_2.bin Binary files differnew file mode 100644 index 000000000..3b1bf7214 --- /dev/null +++ b/graphics/spinda_spots/spot_2.bin diff --git a/graphics/spinda_spots/spot_3.bin b/graphics/spinda_spots/spot_3.bin Binary files differnew file mode 100644 index 000000000..10c73f9ba --- /dev/null +++ b/graphics/spinda_spots/spot_3.bin diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h new file mode 100644 index 000000000..a5bb77035 --- /dev/null +++ b/include/constants/item_effects.h @@ -0,0 +1,79 @@ +#ifndef GUARD_CONSTANTS_ITEM_EFFECTS_H +#define GUARD_CONSTANTS_ITEM_EFFECTS_H + +// field 0 masks +#define ITEM0_X_ATTACK 0x0F +#define ITEM0_HIGH_CRIT 0x30 // For Dire Hit, works the same way as move Focus Energy. +#define ITEM0_SACRED_ASH 0x40 +#define ITEM0_INFATUATION 0x80 + +// field 1 masks +#define ITEM1_X_SPEED 0x0F +#define ITEM1_X_DEFEND 0xF0 + +// field 2 masks +#define ITEM2_X_SPATK 0x0F +#define ITEM2_X_ACCURACY 0xF0 + +// field 3 masks +#define ITEM3_CONFUSION 0x1 +#define ITEM3_PARALYSIS 0x2 +#define ITEM3_FREEZE 0x4 +#define ITEM3_BURN 0x8 +#define ITEM3_POISON 0x10 +#define ITEM3_SLEEP 0x20 +#define ITEM3_LEVEL_UP 0x40 +#define ITEM3_MIST 0x80 // For Guard Specs, works the same way as move Mist. + +#define ITEM3_STATUS_ALL (ITEM3_CONFUSION | ITEM3_PARALYSIS | ITEM3_FREEZE | ITEM3_BURN | ITEM3_POISON | ITEM3_SLEEP) + +// field 4 masks +#define ITEM4_EV_HP 0x1 +#define ITEM4_EV_ATK 0x2 +#define ITEM4_HEAL_HP 0x4 +#define ITEM4_HEAL_PP_ALL 0x8 +#define ITEM4_HEAL_PP_ONE 0x10 +#define ITEM4_PP_UP 0x20 +#define ITEM4_REVIVE 0x40 +#define ITEM4_EVO_STONE 0x80 + +// field 5 masks +#define ITEM5_EV_DEF 0x1 +#define ITEM5_EV_SPEED 0x2 +#define ITEM5_EV_SPDEF 0x4 +#define ITEM5_EV_SPATK 0x8 +#define ITEM5_PP_MAX 0x10 +#define ITEM5_FRIENDSHIP_LOW 0x20 +#define ITEM5_FRIENDSHIP_MID 0x40 +#define ITEM5_FRIENDSHIP_HIGH 0x80 + +#define ITEM5_FRIENDSHIP_ALL (ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID | ITEM5_FRIENDSHIP_HIGH) + +// fields 6 and onwards are item-specific arguments + +// Used for GetItemEffectType. +#define ITEM_EFFECT_X_ITEM 0 +#define ITEM_EFFECT_RAISE_LEVEL 1 +#define ITEM_EFFECT_HEAL_HP 2 +#define ITEM_EFFECT_CURE_POISON 3 +#define ITEM_EFFECT_CURE_SLEEP 4 +#define ITEM_EFFECT_CURE_BURN 5 +#define ITEM_EFFECT_CURE_FREEZE 6 +#define ITEM_EFFECT_CURE_PARALYSIS 7 +#define ITEM_EFFECT_CURE_CONFUSION 8 +#define ITEM_EFFECT_CURE_INFATUATION 9 +#define ITEM_EFFECT_SACRED_ASH 10 +#define ITEM_EFFECT_CURE_ALL_STATUS 11 +#define ITEM_EFFECT_ATK_EV 12 +#define ITEM_EFFECT_HP_EV 13 +#define ITEM_EFFECT_SPATK_EV 14 +#define ITEM_EFFECT_SPDEF_EV 15 +#define ITEM_EFFECT_SPEED_EV 16 +#define ITEM_EFFECT_DEF_EV 17 +#define ITEM_EFFECT_EVO_STONE 18 +#define ITEM_EFFECT_PP_UP 19 +#define ITEM_EFFECT_PP_MAX 20 +#define ITEM_EFFECT_HEAL_PP 21 +#define ITEM_EFFECT_NONE 22 + +#endif // GUARD_CONSTANTS_ITEM_EFFECTS_H diff --git a/include/data2.h b/include/data2.h index 045505364..f663df247 100644 --- a/include/data2.h +++ b/include/data2.h @@ -18,12 +18,12 @@ extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; extern const u8 gMoveNames[][13]; extern const u8 gAbilityNames[][13]; extern const u8 gTypeNames[][7]; -extern u16 gUnknown_8251CB8[]; -extern u16 gUnknown_8251FEE[]; -extern u16 gUnknown_8252324[]; -extern u16 gUnknown_82539D4[]; -extern struct SpindaSpot gSpindaSpotGraphics[]; -extern s8 gNatureStatTable[][5]; +extern const u16 gUnknown_8251CB8[]; +extern const u16 gUnknown_8251FEE[]; +extern const u16 gUnknown_8252324[]; +extern const u16 gUnknown_82539D4[]; +extern const struct SpindaSpot gSpindaSpotGraphics[]; +extern const s8 gNatureStatTable[][5]; extern const u32 gTMHMLearnsets[][2]; extern const struct CompressedSpritePalette gMonPaletteTable[]; diff --git a/src/data/pokemon/item_effects.h b/src/data/pokemon/item_effects.h new file mode 100644 index 000000000..a5b5e9f81 --- /dev/null +++ b/src/data/pokemon/item_effects.h @@ -0,0 +1,473 @@ +const u8 gItemEffect_Potion[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 20, +}; + +const u8 gItemEffect_Antidote[6] = { + [3] = ITEM3_POISON, +}; + +const u8 gItemEffect_BurnHeal[6] = { + [3] = ITEM3_BURN, +}; + +const u8 gItemEffect_IceHeal[6] = { + [3] = ITEM3_FREEZE, +}; + +const u8 gItemEffect_Awakening[6] = { + [3] = ITEM3_SLEEP, +}; + +const u8 gItemEffect_ParalyzeHeal[6] = { + [3] = ITEM3_PARALYSIS, +}; + +const u8 gItemEffect_FullRestore[7] = { + [3] = ITEM3_STATUS_ALL, + [4] = ITEM4_HEAL_HP, + [6] = -1, +}; + +const u8 gItemEffect_MaxPotion[7] = { + [4] = ITEM4_HEAL_HP, + [6] = -1, +}; + +const u8 gItemEffect_HyperPotion[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 200, +}; + +const u8 gItemEffect_SuperPotion[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 50, +}; + +const u8 gItemEffect_FullHeal[6] = { + [3] = ITEM3_STATUS_ALL, +}; + +const u8 gItemEffect_Revive[7] = { + [4] = ITEM4_REVIVE | ITEM4_HEAL_HP, + [6] = -2, +}; + +const u8 gItemEffect_MaxRevive[7] = { + [4] = ITEM4_REVIVE | ITEM4_HEAL_HP, + [6] = -1, +}; + +const u8 gItemEffect_FreshWater[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 50, +}; + +const u8 gItemEffect_SodaPop[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 60, +}; + +const u8 gItemEffect_Lemonade[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 80, +}; + +const u8 gItemEffect_MoomooMilk[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 100, +}; + +const u8 gItemEffect_EnergyPowder[10] = { + [4] = ITEM4_HEAL_HP, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = 50, + [7] = -5, + [8] = -5, + [9] = -10, +}; + +const u8 gItemEffect_EnergyRoot[10] = { + [4] = ITEM4_HEAL_HP, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = 200, + [7] = -10, + [8] = -10, + [9] = -15, +}; + +const u8 gItemEffect_HealPowder[9] = { + [3] = ITEM3_STATUS_ALL, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = -5, + [7] = -5, + [8] = -10, +}; + +const u8 gItemEffect_RevivalHerb[10] = { + [4] = ITEM4_REVIVE | ITEM4_HEAL_HP, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = -1, + [7] = -15, + [8] = -15, + [9] = -20, +}; + +const u8 gItemEffect_Ether[7] = { + [4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL, + [6] = 10, +}; + +const u8 gItemEffect_MaxEther[7] = { + [4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL, + [6] = 0x7F, +}; + +const u8 gItemEffect_Elixir[7] = { + [4] = ITEM4_HEAL_PP_ALL, + [6] = 10, +}; + +const u8 gItemEffect_MaxElixir[7] = { + [4] = ITEM4_HEAL_PP_ALL, + [6] = 0x7F, +}; + +const u8 gItemEffect_LavaCookie[6] = { + [3] = ITEM3_STATUS_ALL, +}; + +const u8 gItemEffect_BlueFlute[6] = { + [3] = ITEM3_SLEEP, +}; + +const u8 gItemEffect_YellowFlute[6] = { + [3] = ITEM3_CONFUSION, +}; + +const u8 gItemEffect_RedFlute[6] = { + [0] = ITEM0_INFATUATION, +}; + +const u8 gItemEffect_BerryJuice[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 20, +}; + +const u8 gItemEffect_SacredAsh[7] = { + [0] = ITEM0_SACRED_ASH, + [4] = ITEM4_REVIVE | ITEM4_HEAL_HP, + [6] = -1, +}; + +const u8 gItemEffect_HPUp[10] = { + [4] = ITEM4_EV_HP, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = 10, + [7] = 5, + [8] = 3, + [9] = 2, +}; + +const u8 gItemEffect_Protein[10] = { + [4] = ITEM4_EV_ATK, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = 10, + [7] = 5, + [8] = 3, + [9] = 2, +}; + +const u8 gItemEffect_Iron[10] = { + [5] = ITEM5_EV_DEF | ITEM5_FRIENDSHIP_ALL, + [6] = 10, + [7] = 5, + [8] = 3, + [9] = 2, +}; + +const u8 gItemEffect_Carbos[10] = { + [5] = ITEM5_EV_SPEED | ITEM5_FRIENDSHIP_ALL, + [6] = 10, + [7] = 5, + [8] = 3, + [9] = 2, +}; + +const u8 gItemEffect_Calcium[10] = { + [5] = ITEM5_EV_SPATK | ITEM5_FRIENDSHIP_ALL, + [6] = 10, + [7] = 5, + [8] = 3, + [9] = 2, +}; + +const u8 gItemEffect_RareCandy[10] = { + [3] = ITEM3_LEVEL_UP, + [4] = ITEM4_REVIVE | ITEM4_HEAL_HP, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = 0xFD, + [7] = 5, + [8] = 3, + [9] = 2, +}; + +const u8 gItemEffect_PPUp[9] = { + [4] = ITEM4_PP_UP, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = 5, + [7] = 3, + [8] = 2, +}; + +const u8 gItemEffect_Zinc[10] = { + [5] = ITEM5_EV_SPDEF | ITEM5_FRIENDSHIP_ALL, + [6] = 10, + [7] = 5, + [8] = 3, + [9] = 2, +}; + +const u8 gItemEffect_PPMax[9] = { + [5] = ITEM5_PP_MAX | ITEM5_FRIENDSHIP_ALL, + [6] = 5, + [7] = 3, + [8] = 2, +}; + +const u8 gItemEffect_GuardSpec[8] = { + [3] = ITEM3_MIST, + [5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID, + [6] = 1, + [7] = 1, +}; + +const u8 gItemEffect_DireHit[8] = { + [0] = 2 << 4, + [5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID, + [6] = 1, + [7] = 1, +}; + +const u8 gItemEffect_XAttack[8] = { + [0] = 1, + [5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID, + [6] = 1, + [7] = 1, +}; + +const u8 gItemEffect_XDefend[8] = { + [1] = 1 << 4, + [5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID, + [6] = 1, + [7] = 1, +}; + +const u8 gItemEffect_XSpeed[8] = { + [1] = 1, + [5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID, + [6] = 1, + [7] = 1, +}; + +const u8 gItemEffect_XAccuracy[8] = { + [2] = 1 << 4, + [5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID, + [6] = 1, + [7] = 1, +}; + +const u8 gItemEffect_XSpecial[8] = { + [2] = 1, + [5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID, + [6] = 1, + [7] = 1, +}; + +const u8 gItemEffect_SunStone[6] = { + [4] = ITEM4_EVO_STONE, +}; + +const u8 gItemEffect_MoonStone[6] = { + [4] = ITEM4_EVO_STONE, +}; + +const u8 gItemEffect_FireStone[6] = { + [4] = ITEM4_EVO_STONE, +}; + +const u8 gItemEffect_ThunderStone[6] = { + [4] = ITEM4_EVO_STONE, +}; + +const u8 gItemEffect_WaterStone[6] = { + [4] = ITEM4_EVO_STONE, +}; + +const u8 gItemEffect_LeafStone[6] = { + [4] = ITEM4_EVO_STONE, +}; + +const u8 gItemEffect_CheriBerry[6] = { + [3] = ITEM3_PARALYSIS, +}; + +const u8 gItemEffect_ChestoBerry[6] = { + [3] = ITEM3_SLEEP, +}; + +const u8 gItemEffect_PechaBerry[6] = { + [3] = ITEM3_POISON, +}; + +const u8 gItemEffect_RawstBerry[6] = { + [3] = ITEM3_BURN, +}; + +const u8 gItemEffect_AspearBerry[6] = { + [3] = ITEM3_FREEZE, +}; + +const u8 gItemEffect_LeppaBerry[7] = { + [4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL, + [6] = 10, +}; + +const u8 gItemEffect_OranBerry[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 10, +}; + +const u8 gItemEffect_PersimBerry[6] = { + [3] = ITEM3_CONFUSION, +}; + +const u8 gItemEffect_LumBerry[6] = { + [3] = ITEM3_STATUS_ALL, +}; + +const u8 gItemEffect_SitrusBerry[7] = { + [4] = ITEM4_HEAL_HP, + [6] = 30, +}; + +// emerald berry effects +/* +const u8 gItemEffect_PomegBerry[10] = { + [4] = ITEM4_EV_HP, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = -10, + [7] = 10, + [8] = 5, + [9] = 2, +}; + +const u8 gItemEffect_KelpsyBerry[10] = { + [4] = ITEM4_EV_ATK, + [5] = ITEM5_FRIENDSHIP_ALL, + [6] = -10, + [7] = 10, + [8] = 5, + [9] = 2, +}; + +const u8 gItemEffect_QualotBerry[10] = { + [5] = ITEM5_EV_DEF | ITEM5_FRIENDSHIP_ALL, + [6] = -10, + [7] = 10, + [8] = 5, + [9] = 2, +}; + +const u8 gItemEffect_HondrewBerry[10] = { + [5] = ITEM5_EV_SPATK | ITEM5_FRIENDSHIP_ALL, + [6] = -10, + [7] = 10, + [8] = 5, + [9] = 2, +}; + +const u8 gItemEffect_GrepaBerry[10] = { + [5] = ITEM5_EV_SPDEF | ITEM5_FRIENDSHIP_ALL, + [6] = -10, + [7] = 10, + [8] = 5, + [9] = 2, +}; + +const u8 gItemEffect_TamatoBerry[10] = { + [5] = ITEM5_EV_SPEED | ITEM5_FRIENDSHIP_ALL, + [6] = -10, + [7] = 10, + [8] = 5, + [9] = 2, +}; +*/ + +const u8 *const gItemEffectTable[] = +{ + [ITEM_POTION - ITEM_POTION] = gItemEffect_Potion, + [ITEM_ANTIDOTE - ITEM_POTION] = gItemEffect_Antidote, + [ITEM_BURN_HEAL - ITEM_POTION] = gItemEffect_BurnHeal, + [ITEM_ICE_HEAL - ITEM_POTION] = gItemEffect_IceHeal, + [ITEM_AWAKENING - ITEM_POTION] = gItemEffect_Awakening, + [ITEM_PARALYZE_HEAL - ITEM_POTION] = gItemEffect_ParalyzeHeal, + [ITEM_FULL_RESTORE - ITEM_POTION] = gItemEffect_FullRestore, + [ITEM_MAX_POTION - ITEM_POTION] = gItemEffect_MaxPotion, + [ITEM_HYPER_POTION - ITEM_POTION] = gItemEffect_HyperPotion, + [ITEM_SUPER_POTION - ITEM_POTION] = gItemEffect_SuperPotion, + [ITEM_FULL_HEAL - ITEM_POTION] = gItemEffect_FullHeal, + [ITEM_REVIVE - ITEM_POTION] = gItemEffect_Revive, + [ITEM_MAX_REVIVE - ITEM_POTION] = gItemEffect_MaxRevive, + [ITEM_FRESH_WATER - ITEM_POTION] = gItemEffect_FreshWater, + [ITEM_SODA_POP - ITEM_POTION] = gItemEffect_SodaPop, + [ITEM_LEMONADE - ITEM_POTION] = gItemEffect_Lemonade, + [ITEM_MOOMOO_MILK - ITEM_POTION] = gItemEffect_MoomooMilk, + [ITEM_ENERGY_POWDER - ITEM_POTION] = gItemEffect_EnergyPowder, + [ITEM_ENERGY_ROOT - ITEM_POTION] = gItemEffect_EnergyRoot, + [ITEM_HEAL_POWDER - ITEM_POTION] = gItemEffect_HealPowder, + [ITEM_REVIVAL_HERB - ITEM_POTION] = gItemEffect_RevivalHerb, + [ITEM_ETHER - ITEM_POTION] = gItemEffect_Ether, + [ITEM_MAX_ETHER - ITEM_POTION] = gItemEffect_MaxEther, + [ITEM_ELIXIR - ITEM_POTION] = gItemEffect_Elixir, + [ITEM_MAX_ELIXIR - ITEM_POTION] = gItemEffect_MaxElixir, + [ITEM_LAVA_COOKIE - ITEM_POTION] = gItemEffect_LavaCookie, + [ITEM_BLUE_FLUTE - ITEM_POTION] = gItemEffect_BlueFlute, + [ITEM_YELLOW_FLUTE - ITEM_POTION] = gItemEffect_YellowFlute, + [ITEM_RED_FLUTE - ITEM_POTION] = gItemEffect_RedFlute, + [ITEM_BERRY_JUICE - ITEM_POTION] = gItemEffect_BerryJuice, + [ITEM_SACRED_ASH - ITEM_POTION] = gItemEffect_SacredAsh, + [ITEM_HP_UP - ITEM_POTION] = gItemEffect_HPUp, + [ITEM_PROTEIN - ITEM_POTION] = gItemEffect_Protein, + [ITEM_IRON - ITEM_POTION] = gItemEffect_Iron, + [ITEM_CARBOS - ITEM_POTION] = gItemEffect_Carbos, + [ITEM_CALCIUM - ITEM_POTION] = gItemEffect_Calcium, + [ITEM_RARE_CANDY - ITEM_POTION] = gItemEffect_RareCandy, + [ITEM_PP_UP - ITEM_POTION] = gItemEffect_PPUp, + [ITEM_ZINC - ITEM_POTION] = gItemEffect_Zinc, + [ITEM_PP_MAX - ITEM_POTION] = gItemEffect_PPMax, + [ITEM_GUARD_SPEC - ITEM_POTION] = gItemEffect_GuardSpec, + [ITEM_DIRE_HIT - ITEM_POTION] = gItemEffect_DireHit, + [ITEM_X_ATTACK - ITEM_POTION] = gItemEffect_XAttack, + [ITEM_X_DEFEND - ITEM_POTION] = gItemEffect_XDefend, + [ITEM_X_SPEED - ITEM_POTION] = gItemEffect_XSpeed, + [ITEM_X_ACCURACY - ITEM_POTION] = gItemEffect_XAccuracy, + [ITEM_X_SPECIAL - ITEM_POTION] = gItemEffect_XSpecial, + [ITEM_SUN_STONE - ITEM_POTION] = gItemEffect_SunStone, + [ITEM_MOON_STONE - ITEM_POTION] = gItemEffect_MoonStone, + [ITEM_FIRE_STONE - ITEM_POTION] = gItemEffect_FireStone, + [ITEM_THUNDER_STONE - ITEM_POTION] = gItemEffect_ThunderStone, + [ITEM_WATER_STONE - ITEM_POTION] = gItemEffect_WaterStone, + [ITEM_LEAF_STONE - ITEM_POTION] = gItemEffect_LeafStone, + [ITEM_CHERI_BERRY - ITEM_POTION] = gItemEffect_CheriBerry, + [ITEM_CHESTO_BERRY - ITEM_POTION] = gItemEffect_ChestoBerry, + [ITEM_PECHA_BERRY - ITEM_POTION] = gItemEffect_PechaBerry, + [ITEM_RAWST_BERRY - ITEM_POTION] = gItemEffect_RawstBerry, + [ITEM_ASPEAR_BERRY - ITEM_POTION] = gItemEffect_AspearBerry, + [ITEM_LEPPA_BERRY - ITEM_POTION] = gItemEffect_LeppaBerry, + [ITEM_ORAN_BERRY - ITEM_POTION] = gItemEffect_OranBerry, + [ITEM_PERSIM_BERRY - ITEM_POTION] = gItemEffect_PersimBerry, + [ITEM_LUM_BERRY - ITEM_POTION] = gItemEffect_LumBerry, + [ITEM_SITRUS_BERRY - ITEM_POTION] = gItemEffect_SitrusBerry, + [LAST_BERRY_INDEX - ITEM_POTION] = NULL, +}; diff --git a/src/pokemon.c b/src/pokemon.c index 3609e71e5..41860862c 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -30,6 +30,7 @@ #include "party_menu.h" #include "field_specials.h" #include "constants/items.h" +#include "constants/item_effects.h" #include "constants/species.h" #include "constants/pokemon.h" #include "constants/abilities.h" @@ -82,6 +83,48 @@ static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); static u8 GetLevelFromMonExp(struct Pokemon *mon); static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon); + + +static const struct SpindaSpot sSpindaSpotGraphics[] = +{ + {16, 7, INCBIN_U16("graphics/spinda_spots/spot_0.bin")}, + {40, 8, INCBIN_U16("graphics/spinda_spots/spot_1.bin")}, + {22, 25, INCBIN_U16("graphics/spinda_spots/spot_2.bin")}, + {34, 26, INCBIN_U16("graphics/spinda_spots/spot_3.bin")} +}; + +#include "data/pokemon/item_effects.h" + +const s8 gNatureStatTable[][5] = +{ + // Atk Def Spd Sp.Atk Sp.Def + { 0, 0, 0, 0, 0}, // Hardy + { +1, -1, 0, 0, 0}, // Lonely + { +1, 0, -1, 0, 0}, // Brave + { +1, 0, 0, -1, 0}, // Adamant + { +1, 0, 0, 0, -1}, // Naughty + { -1, +1, 0, 0, 0}, // Bold + { 0, 0, 0, 0, 0}, // Docile + { 0, +1, -1, 0, 0}, // Relaxed + { 0, +1, 0, -1, 0}, // Impish + { 0, +1, 0, 0, -1}, // Lax + { -1, 0, +1, 0, 0}, // Timid + { 0, -1, +1, 0, 0}, // Hasty + { 0, 0, 0, 0, 0}, // Serious + { 0, 0, +1, -1, 0}, // Jolly + { 0, 0, +1, 0, -1}, // Naive + { -1, 0, 0, +1, 0}, // Modest + { 0, -1, 0, +1, 0}, // Mild + { 0, 0, -1, +1, 0}, // Quiet + { 0, 0, 0, 0, 0}, // Bashful + { 0, 0, 0, +1, -1}, // Rash + { -1, 0, 0, 0, +1}, // Calm + { 0, -1, 0, 0, +1}, // Gentle + { 0, 0, -1, 0, +1}, // Sassy + { 0, 0, 0, -1, +1}, // Careful + { 0, 0, 0, 0, 0}, // Quirky +}; + #include "data/pokemon/tmhm_learnsets.h" #include "data/pokemon/trainer_class_lookups.h" #include "data/pokemon/cry_ids.h" @@ -5070,13 +5113,13 @@ static void sub_8043338(u16 species, u32 personality, u8 *dest) for (i = 0; i < 4; i++) { int j; - u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); - u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); + u8 x = sSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); + u8 y = sSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); for (j = 0; j < 16; j++) { int k; - s32 row = gSpindaSpotGraphics[i].image[j]; + s32 row = sSpindaSpotGraphics[i].image[j]; for (k = x; k < x + 16; k++) { @@ -5115,13 +5158,13 @@ void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, u8 a4) for (i = 0; i < 4; i++) { int j; - u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); - u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); + u8 x = sSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); + u8 y = sSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); for (j = 0; j < 16; j++) { int k; - s32 row = gSpindaSpotGraphics[i].image[j]; + s32 row = sSpindaSpotGraphics[i].image[j]; for (k = x; k < x + 16; k++) { |