Merge pull request #1898 from AsparagusEduardo/BE_postIETweaks

Adjusted elements to simplify the conflicts between BE and IE
This commit is contained in:
ghoulslash 2021-11-15 08:27:28 -05:00 committed by GitHub
commit 0e397c43fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 13 deletions

View file

@ -62,12 +62,12 @@
#define HOLD_EFFECT_FIRE_POWER 58
#define HOLD_EFFECT_DRAGON_POWER 59
#define HOLD_EFFECT_NORMAL_POWER 60
#define HOLD_EFFECT_UP_GRADE 61
#define HOLD_EFFECT_UPGRADE 61
#define HOLD_EFFECT_SHELL_BELL 62
#define HOLD_EFFECT_LUCKY_PUNCH 63
#define HOLD_EFFECT_METAL_POWDER 64
#define HOLD_EFFECT_THICK_CLUB 65
#define HOLD_EFFECT_STICK 66
#define HOLD_EFFECT_LEEK 66
// Gen4 hold effects.
#define HOLD_EFFECT_CHOICE_SCARF 67

View file

@ -2320,7 +2320,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|| IsInstructBannedMove(instructedMove)
|| MoveRequiresRecharging(instructedMove)
|| MoveCallsOtherMove(instructedMove)
#ifdef ITEM_Z_RING
#ifdef ITEM_Z_POWER_RING
//|| (IsZMove(instructedMove))
#endif
|| (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF)

View file

@ -1924,12 +1924,20 @@ static const u8 sText_HoldEffectPsychicPower[] = _("Psychic Power");
static const u8 sText_HoldEffectFirePower[] = _("Fire Power");
static const u8 sText_HoldEffectDragonPower[] = _("Dragon Power");
static const u8 sText_HoldEffectNormalPower[] = _("Normal Power");
static const u8 sText_HoldEffectUpGrade[] = _("Up Grade");
#ifdef ITEM_EXPANSION
static const u8 sText_HoldEffectUpgrade[] = _("Upgrade");
#else
static const u8 sText_HoldEffectUpgrade[] = _("Up Grade");
#endif
static const u8 sText_HoldEffectShellBell[] = _("Shell Bell");
static const u8 sText_HoldEffectLuckyPunch[] = _("Lucky Punch");
static const u8 sText_HoldEffectMetalPowder[] = _("Metal Powder");
static const u8 sText_HoldEffectThickClub[] = _("Thick Club");
static const u8 sText_HoldEffectStick[] = _("Stick");
#ifdef ITEM_EXPANSION
static const u8 sText_HoldEffectLeek[] = _("Leek");
#else
static const u8 sText_HoldEffectLeek[] = _("Stick");
#endif
static const u8 sText_HoldEffectChoiceScarf[] = _("Choice Scarf");
static const u8 sText_HoldEffectChoiceSpecs[] = _("Choice Specs");
static const u8 sText_HoldEffectDampRock[] = _("Damp Rock");
@ -2064,12 +2072,12 @@ static const u8 *const sHoldEffectNames[] =
[HOLD_EFFECT_FIRE_POWER] = sText_HoldEffectFirePower,
[HOLD_EFFECT_DRAGON_POWER] = sText_HoldEffectDragonPower,
[HOLD_EFFECT_NORMAL_POWER] = sText_HoldEffectNormalPower,
[HOLD_EFFECT_UP_GRADE] = sText_HoldEffectUpGrade,
[HOLD_EFFECT_UPGRADE] = sText_HoldEffectUpgrade,
[HOLD_EFFECT_SHELL_BELL] = sText_HoldEffectShellBell,
[HOLD_EFFECT_LUCKY_PUNCH] = sText_HoldEffectLuckyPunch,
[HOLD_EFFECT_METAL_POWDER] = sText_HoldEffectMetalPowder,
[HOLD_EFFECT_THICK_CLUB] = sText_HoldEffectThickClub,
[HOLD_EFFECT_STICK] = sText_HoldEffectStick,
[HOLD_EFFECT_LEEK] = sText_HoldEffectLeek,
[HOLD_EFFECT_CHOICE_SCARF] = sText_HoldEffectChoiceScarf,
[HOLD_EFFECT_CHOICE_SPECS] = sText_HoldEffectChoiceSpecs,
[HOLD_EFFECT_DAMP_ROCK] = sText_HoldEffectDampRock,

View file

@ -1893,7 +1893,7 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi
+ ((gBattleMoves[gCurrentMove].flags & FLAG_HIGH_CRIT) != 0)
+ (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS)
+ 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY)
+ 2 * (holdEffectAtk == HOLD_EFFECT_STICK && gBattleMons[gBattlerAttacker].species == SPECIES_FARFETCHD)
+ 2 * (holdEffectAtk == HOLD_EFFECT_LEEK && gBattleMons[gBattlerAttacker].species == SPECIES_FARFETCHD)
+ (abilityAtk == ABILITY_SUPER_LUCK);
if (critChance >= ARRAY_COUNT(sCriticalHitChance))
@ -3164,7 +3164,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
}
else if (gBattleMons[gBattlerAttacker].item != 0
#ifdef ITEM_EXPANSION
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER
#else
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
#endif
|| gBattleMons[gBattlerTarget].item == 0)
{
gBattlescriptCurrInstr++;
@ -13171,7 +13175,7 @@ static void Cmd_handleballthrow(void)
u8 catchRate;
gLastThrownBall = gLastUsedItem;
if (gLastUsedItem == ITEM_SAFARI_BALL)
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
catchRate = gBattleStruct->safariCatchFactor * 1275 / 100;
else
catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate;

View file

@ -9108,9 +9108,9 @@ bool32 CanMegaEvolve(u8 battlerId)
struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]))->mega);
#ifdef ITEM_EXPANSION
// Check if Player has a Mega Bracelet
// Check if Player has a Mega Ring
if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT))
&& !CheckBagHasItem(ITEM_MEGA_BRACELET, 1))
&& !CheckBagHasItem(ITEM_MEGA_RING, 1))
return FALSE;
#endif

View file

@ -2680,7 +2680,7 @@ const struct Item gItems[] =
.name = _("UP-GRADE"),
.itemId = ITEM_UP_GRADE,
.price = 2100,
.holdEffect = HOLD_EFFECT_UP_GRADE,
.holdEffect = HOLD_EFFECT_UPGRADE,
.description = sUpGradeDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,
@ -2767,7 +2767,7 @@ const struct Item gItems[] =
.name = _("STICK"),
.itemId = ITEM_STICK,
.price = 200,
.holdEffect = HOLD_EFFECT_STICK,
.holdEffect = HOLD_EFFECT_LEEK,
.description = sStickDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,