mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-25 15:08:22 +01:00
Merge pull request #145 from AsparagusEduardo/IE-Config
Item Expansion config file.
This commit is contained in:
commit
c2e8f51e35
33
include/constants/item_config.h
Normal file
33
include/constants/item_config.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#ifndef GUARD_CONSTANTS_ITEM_CONFIG_H
|
||||||
|
#define GUARD_CONSTANTS_ITEM_CONFIG_H
|
||||||
|
|
||||||
|
// Used by other branches to communicate with each other.
|
||||||
|
#define ITEM_EXPANSION
|
||||||
|
|
||||||
|
#ifndef GEN_3
|
||||||
|
#define GEN_3 0
|
||||||
|
#define GEN_4 1
|
||||||
|
#define GEN_5 2
|
||||||
|
#define GEN_6 3
|
||||||
|
#define GEN_7 4
|
||||||
|
#define GEN_8 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Item config
|
||||||
|
#define I_SHINY_CHARM_REROLLS 3 // Amount of re-rolls if the player has the Shiny Charm. Set to 0 to disable Shiny Charm's effects.
|
||||||
|
#define I_KEY_FOSSILS GEN_7 // In Gen4+, all Gen 3 fossils became regular items.
|
||||||
|
#define I_KEY_ESCAPE_ROPE GEN_7 // In Gen8, Escape Rope became a Key Item. Keep in mind, this will make it free to buy in marts.
|
||||||
|
|
||||||
|
// Ball config
|
||||||
|
#define I_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3.
|
||||||
|
#define I_NET_BALL_MODIFIER GEN_7 // In Gen7+, Net Ball's catch multiplier is x5 instead of x3.
|
||||||
|
#define I_REPEAT_BALL_MODIFIER GEN_7 // In Gen7+, Repeat Ball's catch multiplier is x3.5 instead of x3.
|
||||||
|
#define I_DUSK_BALL_MODIFIER GEN_7 // In Gen7+, Dusk Ball's catch multiplier is x3 instead of x3.5.
|
||||||
|
#define I_QUICK_BALL_MODIFIER GEN_7 // In Gen5+, Quick Ball's catch multiplier is x5 instead of x4.
|
||||||
|
#define I_DREAM_BALL_MODIFIER GEN_8 // In Gen8+, Dream Ball's catch multiplier is x4 when the target is asleep.
|
||||||
|
#define I_TIMER_BALL_MODIFIER GEN_7 // In Gen5+, Timer Ball's effectiveness increases by x0.3 per turn instead of x0.1
|
||||||
|
#define I_DIVE_BALL_MODIFIER GEN_7 // In Gen4+, Dive Ball's effectiveness increases by when Surfing or Fishing.
|
||||||
|
#define I_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow.
|
||||||
|
#define I_NEST_BALL_MODIFIER GEN_7 // Nest Ball's formula varies depending on the Gen. See Cmd_handleballthrow.
|
||||||
|
|
||||||
|
#endif // GUARD_CONSTANTS_ITEM_CONFIG_H
|
@ -91,7 +91,6 @@
|
|||||||
|
|
||||||
// Shiny odds
|
// Shiny odds
|
||||||
#define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536
|
#define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536
|
||||||
#define SHINY_CHARM_REROLLS 3 // Amount of re-rolls if has Shiny Charm.
|
|
||||||
|
|
||||||
// Flags for Get(Box)MonData / Set(Box)MonData
|
// Flags for Get(Box)MonData / Set(Box)MonData
|
||||||
#define MON_DATA_PERSONALITY 0
|
#define MON_DATA_PERSONALITY 0
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define GUARD_ITEM_H
|
#define GUARD_ITEM_H
|
||||||
|
|
||||||
#include "constants/item.h"
|
#include "constants/item.h"
|
||||||
|
#include "constants/item_config.h"
|
||||||
|
|
||||||
typedef void (*ItemUseFunc)(u8);
|
typedef void (*ItemUseFunc)(u8);
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ struct WildPokemonHeader
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern bool8 gIsFishingEncounter;
|
extern bool8 gIsFishingEncounter;
|
||||||
|
extern bool8 gIsSurfingEncounter;
|
||||||
|
|
||||||
extern const struct WildPokemonHeader gWildMonHeaders[];
|
extern const struct WildPokemonHeader gWildMonHeaders[];
|
||||||
|
|
||||||
|
@ -5073,6 +5073,7 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
|
|||||||
if (!gPaletteFade.active)
|
if (!gPaletteFade.active)
|
||||||
{
|
{
|
||||||
gIsFishingEncounter = FALSE;
|
gIsFishingEncounter = FALSE;
|
||||||
|
gIsSurfingEncounter = FALSE;
|
||||||
ResetSpriteData();
|
ResetSpriteData();
|
||||||
if (gLeveledUpInBattle == 0 || gBattleOutcome != B_OUTCOME_WON)
|
if (gLeveledUpInBattle == 0 || gBattleOutcome != B_OUTCOME_WON)
|
||||||
{
|
{
|
||||||
|
@ -9751,6 +9751,7 @@ static void Cmd_removelightscreenreflect(void) // brick break
|
|||||||
static void Cmd_handleballthrow(void)
|
static void Cmd_handleballthrow(void)
|
||||||
{
|
{
|
||||||
u8 ballMultiplier = 10;
|
u8 ballMultiplier = 10;
|
||||||
|
s8 ballAddition = 0;
|
||||||
|
|
||||||
if (gBattleControllerExecFlags)
|
if (gBattleControllerExecFlags)
|
||||||
return;
|
return;
|
||||||
@ -9780,32 +9781,73 @@ static void Cmd_handleballthrow(void)
|
|||||||
else
|
else
|
||||||
catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate;
|
catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef POKEMON_EXPANSION
|
||||||
|
if (IS_ULTRA_BEAST(gBattleMons[gBattlerTarget].species))
|
||||||
|
{
|
||||||
|
if (gLastUsedItem == ITEM_BEAST_BALL)
|
||||||
|
ballMultiplier = 50;
|
||||||
|
else
|
||||||
|
ballMultiplier = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
if (gLastUsedItem > ITEM_SAFARI_BALL)
|
if (gLastUsedItem > ITEM_SAFARI_BALL)
|
||||||
{
|
{
|
||||||
switch (gLastUsedItem)
|
switch (gLastUsedItem)
|
||||||
{
|
{
|
||||||
case ITEM_NET_BALL:
|
case ITEM_NET_BALL:
|
||||||
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
|
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
|
||||||
ballMultiplier = 30;
|
#if I_NET_BALL_MODIFIER >= GEN_7
|
||||||
|
ballMultiplier = 50;
|
||||||
|
#else
|
||||||
|
ballMultiplier = 30;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ITEM_DIVE_BALL:
|
case ITEM_DIVE_BALL:
|
||||||
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER)
|
#if I_DIVE_BALL_MODIFIER >= GEN_4
|
||||||
ballMultiplier = 35;
|
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER || gIsFishingEncounter || gIsSurfingEncounter)
|
||||||
|
ballMultiplier = 35;
|
||||||
|
#else
|
||||||
|
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER)
|
||||||
|
ballMultiplier = 35;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ITEM_NEST_BALL:
|
case ITEM_NEST_BALL:
|
||||||
if (gBattleMons[gBattlerTarget].level < 40)
|
#if I_NEST_BALL_MODIFIER >= GEN_6
|
||||||
{
|
//((41 - Pokémon's level) ÷ 10)× if Pokémon's level is between 1 and 29, 1× otherwise.
|
||||||
ballMultiplier = 40 - gBattleMons[gBattlerTarget].level;
|
if (gBattleMons[gBattlerTarget].level < 30)
|
||||||
if (ballMultiplier <= 9)
|
ballMultiplier = 41 - gBattleMons[gBattlerTarget].level;
|
||||||
ballMultiplier = 10;
|
#elif I_NEST_BALL_MODIFIER == GEN_5
|
||||||
}
|
//((41 - Pokémon's level) ÷ 10)×, minimum 1×
|
||||||
|
if (gBattleMons[gBattlerTarget].level < 31)
|
||||||
|
ballMultiplier = 41 - gBattleMons[gBattlerTarget].level;
|
||||||
|
#else
|
||||||
|
//((40 - Pokémon's level) ÷ 10)×, minimum 1×
|
||||||
|
if (gBattleMons[gBattlerTarget].level < 40)
|
||||||
|
{
|
||||||
|
ballMultiplier = 40 - gBattleMons[gBattlerTarget].level;
|
||||||
|
if (ballMultiplier <= 9)
|
||||||
|
ballMultiplier = 10;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ITEM_REPEAT_BALL:
|
case ITEM_REPEAT_BALL:
|
||||||
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))
|
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))
|
||||||
ballMultiplier = 30;
|
#if I_REPEAT_BALL_MODIFIER >= GEN_7
|
||||||
|
ballMultiplier = 35;
|
||||||
|
#else
|
||||||
|
ballMultiplier = 30;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ITEM_TIMER_BALL:
|
case ITEM_TIMER_BALL:
|
||||||
ballMultiplier = gBattleResults.battleTurnCounter + 10;
|
#if I_TIMER_BALL_MODIFIER >= GEN_5
|
||||||
|
ballMultiplier = (gBattleResults.battleTurnCounter * 3) + 10;
|
||||||
|
#else
|
||||||
|
ballMultiplier = gBattleResults.battleTurnCounter + 10;
|
||||||
|
#endif
|
||||||
if (ballMultiplier > 40)
|
if (ballMultiplier > 40)
|
||||||
ballMultiplier = 40;
|
ballMultiplier = 40;
|
||||||
break;
|
break;
|
||||||
@ -9829,7 +9871,11 @@ static void Cmd_handleballthrow(void)
|
|||||||
break;
|
break;
|
||||||
case ITEM_LURE_BALL:
|
case ITEM_LURE_BALL:
|
||||||
if (gIsFishingEncounter)
|
if (gIsFishingEncounter)
|
||||||
ballMultiplier = 30;
|
#if I_LURE_BALL_MODIFIER >= GEN_7
|
||||||
|
ballMultiplier = 50;
|
||||||
|
#else
|
||||||
|
ballMultiplier = 30;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ITEM_MOON_BALL:
|
case ITEM_MOON_BALL:
|
||||||
for (i = 0; i < EVOS_PER_MON; i++)
|
for (i = 0; i < EVOS_PER_MON; i++)
|
||||||
@ -9851,16 +9897,36 @@ static void Cmd_handleballthrow(void)
|
|||||||
break;
|
break;
|
||||||
case ITEM_HEAVY_BALL:
|
case ITEM_HEAVY_BALL:
|
||||||
i = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1);
|
i = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1);
|
||||||
if (i < 1024)
|
#if I_HEAVY_BALL_MODIFIER >= GEN_7
|
||||||
ballMultiplier = 5;
|
if (i < 1000)
|
||||||
else if (i < 2048)
|
ballAddition = -20;
|
||||||
ballMultiplier = 10;
|
else if (i < 2000)
|
||||||
else if (i < 3072)
|
ballAddition = 0;
|
||||||
ballMultiplier = 20;
|
else if (i < 3000)
|
||||||
else if (i < 4096)
|
ballAddition = 20;
|
||||||
ballMultiplier = 30;
|
else
|
||||||
else
|
ballAddition = 30;
|
||||||
ballMultiplier = 40;
|
#elif I_HEAVY_BALL_MODIFIER >= GEN_4
|
||||||
|
if (i < 2048)
|
||||||
|
ballAddition = -20;
|
||||||
|
else if (i < 3072)
|
||||||
|
ballAddition = 20;
|
||||||
|
else if (i < 4096)
|
||||||
|
ballAddition = 30;
|
||||||
|
else
|
||||||
|
ballAddition = 40;
|
||||||
|
#else
|
||||||
|
if (i < 1024)
|
||||||
|
ballAddition = -20;
|
||||||
|
else if (i < 2048)
|
||||||
|
ballAddition = 0;
|
||||||
|
else if (i < 3072)
|
||||||
|
ballAddition = 20;
|
||||||
|
else if (i < 4096)
|
||||||
|
ballAddition = 30;
|
||||||
|
else
|
||||||
|
ballAddition = 40;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ITEM_FAST_BALL:
|
case ITEM_FAST_BALL:
|
||||||
if (gBaseStats[gBattleMons[gBattlerTarget].species].baseSpeed >= 100)
|
if (gBaseStats[gBattleMons[gBattlerTarget].species].baseSpeed >= 100)
|
||||||
@ -9868,19 +9934,48 @@ static void Cmd_handleballthrow(void)
|
|||||||
break;
|
break;
|
||||||
case ITEM_QUICK_BALL:
|
case ITEM_QUICK_BALL:
|
||||||
if (gBattleResults.battleTurnCounter == 0)
|
if (gBattleResults.battleTurnCounter == 0)
|
||||||
ballMultiplier = 40;
|
#if I_QUICK_BALL_MODIFIER >= GEN_5
|
||||||
|
ballMultiplier = 50;
|
||||||
|
#else
|
||||||
|
ballMultiplier = 40;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ITEM_DUSK_BALL:
|
case ITEM_DUSK_BALL:
|
||||||
RtcCalcLocalTime();
|
RtcCalcLocalTime();
|
||||||
if ((gLocalTime.hours >= 20 && gLocalTime.hours <= 3) || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
|
if ((gLocalTime.hours >= 20 && gLocalTime.hours <= 3) || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
|
||||||
ballMultiplier = 30;
|
#if I_DUSK_BALL_MODIFIER >= GEN_7
|
||||||
|
ballMultiplier = 30;
|
||||||
|
#else
|
||||||
|
ballMultiplier = 35;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case ITEM_DREAM_BALL:
|
||||||
|
#if I_DREAM_BALL_MODIFIER >= GEN_8
|
||||||
|
if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP)
|
||||||
|
ballMultiplier = 40;
|
||||||
|
#else
|
||||||
|
ballMultiplier = 10;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case ITEM_BEAST_BALL:
|
||||||
|
ballMultiplier = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ballMultiplier = sBallCatchBonuses[gLastUsedItem - ITEM_ULTRA_BALL];
|
ballMultiplier = sBallCatchBonuses[gLastUsedItem - ITEM_ULTRA_BALL];
|
||||||
|
|
||||||
odds = (catchRate * ballMultiplier / 10)
|
#ifdef POKEMON_EXPANSION
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// catchRate is unsigned, which means that it may potentially overflow if sum is applied directly.
|
||||||
|
if (catchRate < 21 && ballAddition == -20)
|
||||||
|
catchRate = 1;
|
||||||
|
else
|
||||||
|
catchRate = catchRate + ballAddition;
|
||||||
|
|
||||||
|
odds = ((catchRate) * ballMultiplier / 10)
|
||||||
* (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2)
|
* (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2)
|
||||||
/ (3 * gBattleMons[gBattlerTarget].maxHP);
|
/ (3 * gBattleMons[gBattlerTarget].maxHP);
|
||||||
|
|
||||||
|
@ -1281,9 +1281,16 @@ const struct Item gItems[] =
|
|||||||
{
|
{
|
||||||
.name = _("Escape Rope"),
|
.name = _("Escape Rope"),
|
||||||
.itemId = ITEM_ESCAPE_ROPE,
|
.itemId = ITEM_ESCAPE_ROPE,
|
||||||
.price = 550,
|
|
||||||
.description = sEscapeRopeDesc,
|
.description = sEscapeRopeDesc,
|
||||||
|
#if I_KEY_ESCAPE_ROPE >= GEN_8
|
||||||
|
.price = 0,
|
||||||
|
.importance = 1,
|
||||||
|
.pocket = POCKET_KEY_ITEMS,
|
||||||
|
#else
|
||||||
|
.price = 550,
|
||||||
|
.importance = 0,
|
||||||
.pocket = POCKET_ITEMS,
|
.pocket = POCKET_ITEMS,
|
||||||
|
#endif
|
||||||
.type = 2,
|
.type = 2,
|
||||||
.fieldUseFunc = ItemUseOutOfBattle_EscapeRope,
|
.fieldUseFunc = ItemUseOutOfBattle_EscapeRope,
|
||||||
.secondaryId = 0,
|
.secondaryId = 0,
|
||||||
@ -4883,8 +4890,13 @@ const struct Item gItems[] =
|
|||||||
.itemId = ITEM_OLD_AMBER,
|
.itemId = ITEM_OLD_AMBER,
|
||||||
.price = 0,
|
.price = 0,
|
||||||
.description = sOldAmberDesc,
|
.description = sOldAmberDesc,
|
||||||
|
#if I_KEY_FOSSILS >= GEN_4
|
||||||
.importance = 1,
|
.importance = 1,
|
||||||
.pocket = POCKET_KEY_ITEMS,
|
.pocket = POCKET_KEY_ITEMS,
|
||||||
|
#else
|
||||||
|
.importance = 0,
|
||||||
|
.pocket = POCKET_ITEMS,
|
||||||
|
#endif
|
||||||
.type = 4,
|
.type = 4,
|
||||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||||
.secondaryId = 0,
|
.secondaryId = 0,
|
||||||
@ -4948,8 +4960,13 @@ const struct Item gItems[] =
|
|||||||
.itemId = ITEM_HELIX_FOSSIL,
|
.itemId = ITEM_HELIX_FOSSIL,
|
||||||
.price = 0,
|
.price = 0,
|
||||||
.description = sHelixFossilDesc,
|
.description = sHelixFossilDesc,
|
||||||
|
#if I_KEY_FOSSILS >= GEN_4
|
||||||
|
.importance = 1,
|
||||||
|
.pocket = POCKET_KEY_ITEMS,
|
||||||
|
#else
|
||||||
.importance = 0,
|
.importance = 0,
|
||||||
.pocket = POCKET_ITEMS,
|
.pocket = POCKET_ITEMS,
|
||||||
|
#endif
|
||||||
.type = 4,
|
.type = 4,
|
||||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||||
.secondaryId = 0,
|
.secondaryId = 0,
|
||||||
@ -4961,8 +4978,13 @@ const struct Item gItems[] =
|
|||||||
.itemId = ITEM_DOME_FOSSIL,
|
.itemId = ITEM_DOME_FOSSIL,
|
||||||
.price = 0,
|
.price = 0,
|
||||||
.description = sDomeFossilDesc,
|
.description = sDomeFossilDesc,
|
||||||
|
#if I_KEY_FOSSILS >= GEN_4
|
||||||
|
.importance = 1,
|
||||||
|
.pocket = POCKET_KEY_ITEMS,
|
||||||
|
#else
|
||||||
.importance = 0,
|
.importance = 0,
|
||||||
.pocket = POCKET_ITEMS,
|
.pocket = POCKET_ITEMS,
|
||||||
|
#endif
|
||||||
.type = 4,
|
.type = 4,
|
||||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||||
.secondaryId = 0,
|
.secondaryId = 0,
|
||||||
@ -4974,8 +4996,13 @@ const struct Item gItems[] =
|
|||||||
.itemId = ITEM_ROOT_FOSSIL,
|
.itemId = ITEM_ROOT_FOSSIL,
|
||||||
.price = 0,
|
.price = 0,
|
||||||
.description = sRootFossilDesc,
|
.description = sRootFossilDesc,
|
||||||
|
#if I_KEY_FOSSILS >= GEN_4
|
||||||
|
.importance = 1,
|
||||||
|
.pocket = POCKET_KEY_ITEMS,
|
||||||
|
#else
|
||||||
.importance = 0,
|
.importance = 0,
|
||||||
.pocket = POCKET_ITEMS,
|
.pocket = POCKET_ITEMS,
|
||||||
|
#endif
|
||||||
.type = 4,
|
.type = 4,
|
||||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||||
.secondaryId = 0,
|
.secondaryId = 0,
|
||||||
@ -4987,8 +5014,13 @@ const struct Item gItems[] =
|
|||||||
.itemId = ITEM_CLAW_FOSSIL,
|
.itemId = ITEM_CLAW_FOSSIL,
|
||||||
.price = 0,
|
.price = 0,
|
||||||
.description = sClawFossilDesc,
|
.description = sClawFossilDesc,
|
||||||
|
#if I_KEY_FOSSILS >= GEN_4
|
||||||
|
.importance = 1,
|
||||||
|
.pocket = POCKET_KEY_ITEMS,
|
||||||
|
#else
|
||||||
.importance = 0,
|
.importance = 0,
|
||||||
.pocket = POCKET_ITEMS,
|
.pocket = POCKET_ITEMS,
|
||||||
|
#endif
|
||||||
.type = 4,
|
.type = 4,
|
||||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||||
.secondaryId = 0,
|
.secondaryId = 0,
|
||||||
|
@ -910,7 +910,9 @@ void Task_UseDigEscapeRopeOnField(u8 taskId)
|
|||||||
static void ItemUseOnFieldCB_EscapeRope(u8 taskId)
|
static void ItemUseOnFieldCB_EscapeRope(u8 taskId)
|
||||||
{
|
{
|
||||||
Overworld_ResetStateAfterDigEscRope();
|
Overworld_ResetStateAfterDigEscRope();
|
||||||
RemoveUsedItem();
|
#if I_KEY_ESCAPE_ROPE < GEN_8
|
||||||
|
RemoveUsedItem();
|
||||||
|
#endif
|
||||||
gTasks[taskId].data[0] = 0;
|
gTasks[taskId].data[0] = 0;
|
||||||
DisplayItemMessageOnField(taskId, gStringVar4, Task_UseDigEscapeRopeOnField);
|
DisplayItemMessageOnField(taskId, gStringVar4, Task_UseDigEscapeRopeOnField);
|
||||||
}
|
}
|
||||||
|
@ -2233,7 +2233,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
|
|||||||
personality = Random32();
|
personality = Random32();
|
||||||
shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality);
|
shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality);
|
||||||
rolls++;
|
rolls++;
|
||||||
} while (shinyValue >= SHINY_ODDS && rolls < SHINY_CHARM_REROLLS);
|
} while (shinyValue >= SHINY_ODDS && rolls < I_SHINY_CHARM_REROLLS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ static bool8 IsAbilityAllowingEncounter(u8 level);
|
|||||||
// EWRAM vars
|
// EWRAM vars
|
||||||
EWRAM_DATA static u8 sWildEncountersDisabled = 0;
|
EWRAM_DATA static u8 sWildEncountersDisabled = 0;
|
||||||
EWRAM_DATA bool8 gIsFishingEncounter = 0;
|
EWRAM_DATA bool8 gIsFishingEncounter = 0;
|
||||||
|
EWRAM_DATA bool8 gIsSurfingEncounter = 0;
|
||||||
EWRAM_DATA static u32 sFeebasRngValue = 0;
|
EWRAM_DATA static u32 sFeebasRngValue = 0;
|
||||||
|
|
||||||
#include "data/wild_encounters.h"
|
#include "data/wild_encounters.h"
|
||||||
@ -615,6 +616,7 @@ bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavi
|
|||||||
{
|
{
|
||||||
if (TryGenerateWildMon(gWildMonHeaders[headerId].waterMonsInfo, WILD_AREA_WATER, WILD_CHECK_REPEL | WILD_CHECK_KEEN_EYE) == TRUE)
|
if (TryGenerateWildMon(gWildMonHeaders[headerId].waterMonsInfo, WILD_AREA_WATER, WILD_CHECK_REPEL | WILD_CHECK_KEEN_EYE) == TRUE)
|
||||||
{
|
{
|
||||||
|
gIsSurfingEncounter = TRUE;
|
||||||
BattleSetup_StartWildBattle();
|
BattleSetup_StartWildBattle();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user