Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
kittenchilly committed Jan 1, 2025
1 parent 3668a96 commit eb2d3c8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3957,8 +3957,8 @@ void IncreaseDrowsyScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
&& !(HasMoveEffect(battlerDef, EFFECT_SNORE) || HasMoveEffect(battlerDef, EFFECT_SLEEP_TALK)))
ADJUST_SCORE_PTR(WEAK_EFFECT);

if (HasMoveEffectANDArg(battlerAtk, EFFECT_DOUBLE_POWER_ON_ARG_STATUS, STATUS1_DROWSY)
|| HasMoveEffectANDArg(BATTLE_PARTNER(battlerAtk), EFFECT_DOUBLE_POWER_ON_ARG_STATUS, STATUS1_DROWSY))
if (IsPowerBasedOnStatus(battlerAtk, EFFECT_DOUBLE_POWER_ON_ARG_STATUS, STATUS1_DROWSY)
|| IsPowerBasedOnStatus(BATTLE_PARTNER(battlerAtk), EFFECT_DOUBLE_POWER_ON_ARG_STATUS, STATUS1_DROWSY))
ADJUST_SCORE_PTR(WEAK_EFFECT);
}

Expand Down
28 changes: 28 additions & 0 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3485,6 +3485,33 @@ static void CancellerParalysed(u32 *effect)
}
}

static void CancellerDrowsy(u32 *effect)
{
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_DROWSY)
{
if (UproarWakeUpCheck(gBattlerAttacker))
{
TryDeactivateSleepClause(GetBattlerSide(gBattlerAttacker), gBattlerPartyIndexes[gBattlerAttacker]);
gBattleMons[gBattlerAttacker].status1 &= ~STATUS1_DROWSY;
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE;
BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
*effect = 2;
}
else if (gChosenMove != MOVE_SNORE && gChosenMove != MOVE_SLEEP_TALK
&& !gBattleStruct->isAtkCancelerForCalledMove
&& (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD && B_MAGIC_GUARD >= GEN_4)
&& !RandomPercentage(RNG_DROWSY, 75))
{
gProtectStructs[gBattlerAttacker].drsImmobility = TRUE;
gBattlescriptCurrInstr = BattleScript_MoveUsedIsDrowsy;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
*effect = 1;
}
}
}

static void CancellerBide(u32 *effect)
{
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_BIDE)
Expand Down Expand Up @@ -3838,6 +3865,7 @@ static const MoveSuccessOrderCancellers sMoveSuccessOrderCancellers[] =
[CANCELLER_IMPRISONED] = CancellerImprisoned,
[CANCELLER_CONFUSED] = CancellerConfused,
[CANCELLER_PARALYSED] = CancellerParalysed,
[CANCELLER_DROWSY] = CancellerDrowsy,
[CANCELLER_BIDE] = CancellerBide,
[CANCELLER_THAW] = CancellerThaw,
[CANCELLER_STANCE_CHANGE_2] = CancellerStanceChangeTwo,
Expand Down

0 comments on commit eb2d3c8

Please sign in to comment.