Merge pull request #6 from Pawkkie/drowsy-testing-suite

Adapt Sleep Clause testing suite for Drowsy
This commit is contained in:
kittenchilly 2025-01-03 14:01:26 -06:00 committed by GitHub
commit cd1f82cc67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 965 additions and 252 deletions

View file

@ -989,6 +989,8 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
case EFFECT_DROWSY: case EFFECT_DROWSY:
if (!AI_CanGiveDrowsy(battlerAtk, battlerDef, aiData->abilities[battlerDef], move, aiData->partnerMove)) if (!AI_CanGiveDrowsy(battlerAtk, battlerDef, aiData->abilities[battlerDef], move, aiData->partnerMove))
ADJUST_SCORE(-10); ADJUST_SCORE(-10);
if (PartnerMoveActivatesSleepClause(aiData->partnerMove))
ADJUST_SCORE(-20);
break; break;
case EFFECT_EXPLOSION: case EFFECT_EXPLOSION:
if (!(AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_WILL_SUICIDE)) if (!(AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_WILL_SUICIDE))

View file

@ -2412,6 +2412,7 @@ static inline bool32 IsMoveSleepClauseTrigger(u32 move)
case EFFECT_SLEEP: case EFFECT_SLEEP:
case EFFECT_YAWN: case EFFECT_YAWN:
case EFFECT_DARK_VOID: case EFFECT_DARK_VOID:
case EFFECT_DROWSY:
return TRUE; return TRUE;
} }
@ -2424,6 +2425,7 @@ static inline bool32 IsMoveSleepClauseTrigger(u32 move)
{ {
case MAX_EFFECT_EFFECT_SPORE_FOES: case MAX_EFFECT_EFFECT_SPORE_FOES:
case MAX_EFFECT_YAWN_FOE: case MAX_EFFECT_YAWN_FOE:
case MOVE_EFFECT_SLEEP_OR_DROWSY:
return TRUE; return TRUE;
} }
} }

View file

@ -72,8 +72,8 @@ SINGLE_BATTLE_TEST("Dire Claw cannot poison/paralyze/cause to fall asleep pokemo
PARAMETRIZE { statusAnim = B_ANIM_STATUS_PRZ; rng = MOVE_EFFECT_PARALYSIS; species = SPECIES_JOLTEON; ability = ABILITY_VOLT_ABSORB; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_PRZ; rng = MOVE_EFFECT_PARALYSIS; species = SPECIES_JOLTEON; ability = ABILITY_VOLT_ABSORB; }
PARAMETRIZE { statusAnim = B_ANIM_STATUS_PRZ; rng = MOVE_EFFECT_PARALYSIS; species = SPECIES_ELECTIVIRE; ability = ABILITY_MOTOR_DRIVE; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_PRZ; rng = MOVE_EFFECT_PARALYSIS; species = SPECIES_ELECTIVIRE; ability = ABILITY_MOTOR_DRIVE; }
PARAMETRIZE { statusAnim = B_ANIM_STATUS_PSN; rng = MOVE_EFFECT_POISON; species = SPECIES_ZANGOOSE; ability = ABILITY_IMMUNITY; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_PSN; rng = MOVE_EFFECT_POISON; species = SPECIES_ZANGOOSE; ability = ABILITY_IMMUNITY; }
PARAMETRIZE { statusAnim = B_ANIM_STATUS_SLP; rng = MOVE_EFFECT_SLEEP; species = SPECIES_VIGOROTH; ability = ABILITY_VITAL_SPIRIT; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_SLP; rng = MOVE_EFFECT_SLEEP_OR_DROWSY ; species = SPECIES_VIGOROTH; ability = ABILITY_VITAL_SPIRIT; }
PARAMETRIZE { statusAnim = B_ANIM_STATUS_SLP; rng = MOVE_EFFECT_SLEEP; species = SPECIES_HYPNO; ability = ABILITY_INSOMNIA; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_SLP; rng = MOVE_EFFECT_SLEEP_OR_DROWSY ; species = SPECIES_HYPNO; ability = ABILITY_INSOMNIA; }
GIVEN { GIVEN {
PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET);
@ -103,7 +103,7 @@ SINGLE_BATTLE_TEST("Dire Claw cannot poison/paralyze/cause to fall asleep a mon
u32 rng; u32 rng;
PARAMETRIZE { statusAnim = B_ANIM_STATUS_PSN; rng = MOVE_EFFECT_POISON; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_PSN; rng = MOVE_EFFECT_POISON; }
PARAMETRIZE { statusAnim = B_ANIM_STATUS_PRZ; rng = MOVE_EFFECT_PARALYSIS; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_PRZ; rng = MOVE_EFFECT_PARALYSIS; }
PARAMETRIZE { statusAnim = B_ANIM_STATUS_SLP; rng = MOVE_EFFECT_SLEEP; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_SLP; rng = MOVE_EFFECT_SLEEP_OR_DROWSY ; }
GIVEN { GIVEN {
PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_BURN); } OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_BURN); }

File diff suppressed because it is too large Load diff

View file

@ -31,3 +31,22 @@ SINGLE_BATTLE_TEST("Drowsy has a 25% chance of skipping the turn")
MESSAGE("Wobbuffet is too drowsy to move!"); MESSAGE("Wobbuffet is too drowsy to move!");
} }
} }
SINGLE_BATTLE_TEST("Using Spark, Volt Tackle, or Wild Charge will cure the user of drowsiness")
{
u32 move;
PARAMETRIZE { move = MOVE_SPARK; }
PARAMETRIZE { move = MOVE_VOLT_TACKLE; }
PARAMETRIZE { move = MOVE_WILD_CHARGE; }
PASSES_RANDOMLY(75, 100, RNG_DROWSY);
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_DROWSY); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, player);
MESSAGE("Wobbuffet fought off its drowsiness!");
STATUS_ICON(player, drowsy: FALSE);
}
}