Merge pull request #1622 from BuffelSaft/money-boost

Fix stacking effect on HOLD_EFFECT_DOUBLE_PRIZE
This commit is contained in:
DizzyEggg 2021-09-06 11:32:53 +02:00 committed by GitHub
commit 68c33895fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -492,7 +492,9 @@ struct BattleStruct
u16 assistPossibleMoves[PARTY_SIZE * MAX_MON_MOVES]; // Each of mons can know max 4 moves.
u8 focusPunchBattlerId;
u8 battlerPreventingSwitchout;
u8 moneyMultiplier;
u8 moneyMultiplier:6;
u8 moneyMultiplierItem:1;
u8 moneyMultiplierMove:1;
u8 savedTurnActionNumber;
u8 switchInAbilitiesCounter;
u8 faintedActionsState;

View File

@ -2878,9 +2878,10 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect];
break;
case MOVE_EFFECT_HAPPY_HOUR:
if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER)
if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER && !gBattleStruct->moneyMultiplierMove)
{
gBattleStruct->moneyMultiplier *= 2;
gBattleStruct->moneyMultiplierMove = 1;
}
gBattlescriptCurrInstr++;
break;

View File

@ -5626,8 +5626,11 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
switch (battlerHoldEffect)
{
case HOLD_EFFECT_DOUBLE_PRIZE:
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER)
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER && !gBattleStruct->moneyMultiplierItem)
{
gBattleStruct->moneyMultiplier *= 2;
gBattleStruct->moneyMultiplierItem = 1;
}
break;
case HOLD_EFFECT_RESTORE_STATS:
for (i = 0; i < NUM_BATTLE_STATS; i++)