first review batch

This commit is contained in:
AlexOn1ine 2025-03-08 21:24:22 +01:00
parent 134d1e79c7
commit 06315ff084
4 changed files with 54 additions and 9 deletions

View File

@ -210,7 +210,7 @@ static bool32 HandleEndTurnWeatherDamage(u32 battler)
break; break;
case BATTLE_WEATHER_SUN: case BATTLE_WEATHER_SUN:
case BATTLE_WEATHER_SUN_PRIMAL: case BATTLE_WEATHER_SUN_PRIMAL:
if (ability == ABILITY_DRY_SKIN) if (ability == ABILITY_DRY_SKIN || ability == ABILITY_SOLAR_POWER)
{ {
if (AbilityBattleEffects(ABILITYEFFECT_ENDTURN, battler, ability, 0, MOVE_NONE)) if (AbilityBattleEffects(ABILITYEFFECT_ENDTURN, battler, ability, 0, MOVE_NONE))
effect = TRUE; effect = TRUE;
@ -404,7 +404,7 @@ static bool32 HandleEndTurnFirstEventBlock(u32 battler)
switch (gBattleStruct->eventBlockCounter) switch (gBattleStruct->eventBlockCounter)
{ {
case FIRST_EVENT_BLOCK_GMAX_MOVE_RESIDUAL: // TODO: Needs a queue case FIRST_EVENT_BLOCK_GMAX_MOVE_RESIDUAL: // TODO: Has to be split into 3 statuses and needs a queue
side = GetBattlerSide(battler); side = GetBattlerSide(battler);
if (gSideStatuses[side] & SIDE_STATUS_DAMAGE_NON_TYPES) if (gSideStatuses[side] & SIDE_STATUS_DAMAGE_NON_TYPES)
{ {
@ -433,7 +433,7 @@ static bool32 HandleEndTurnFirstEventBlock(u32 battler)
} }
gBattleStruct->eventBlockCounter++; gBattleStruct->eventBlockCounter++;
break; break;
case FIRST_EVENT_BLOCK_THRASH: // TODO: Move to moveend case FIRST_EVENT_BLOCK_THRASH: // TODO: Move to moveend / not sure. Might be best to keep here
if (gBattleMons[battler].status2 & STATUS2_LOCK_CONFUSE && !(gStatuses3[battler] & STATUS3_SKY_DROPPED)) if (gBattleMons[battler].status2 & STATUS2_LOCK_CONFUSE && !(gStatuses3[battler] & STATUS3_SKY_DROPPED))
{ {
gBattleMons[battler].status2 -= STATUS2_LOCK_CONFUSE_TURN(1); gBattleMons[battler].status2 -= STATUS2_LOCK_CONFUSE_TURN(1);

View File

@ -26,8 +26,6 @@ DOUBLE_BATTLE_TEST("Healer cures adjacent ally's status condition 30% of the tim
DOUBLE_BATTLE_TEST("Healer cures status condition before burn or poison damage is dealt") DOUBLE_BATTLE_TEST("Healer cures status condition before burn or poison damage is dealt")
{ {
KNOWN_FAILING; // According to Bulbapedia, Healer should trigger before status damage and Wobbuffet should live
// Source: https://bulbapedia.bulbagarden.net/wiki/Healer_(Ability)#Effect
u16 status; u16 status;
PARAMETRIZE { status = STATUS1_POISON; } PARAMETRIZE { status = STATUS1_POISON; }
PARAMETRIZE { status = STATUS1_BURN; } PARAMETRIZE { status = STATUS1_BURN; }
@ -42,10 +40,8 @@ DOUBLE_BATTLE_TEST("Healer cures status condition before burn or poison damage i
} WHEN { } WHEN {
TURN {} TURN {}
} SCENE { } SCENE {
NOT { NOT MESSAGE("The opposing Wobbuffet fainted!");
MESSAGE("The opposing Wobbuffet fainted!"); MESSAGE("The opposing Chansey's Healer cured the opposing Wobbuffet's problem!");
}
MESSAGE("The opposing Chansey's Healer cured Foe Wobbuffet's problem!");
} }
} }

View File

@ -0,0 +1,23 @@
#include "global.h"
#include "test/battle.h"
DOUBLE_BATTLE_TEST("End Turn Effects: First Event Block is executed correctly")
{
GIVEN {
PLAYER(SPECIES_WYNAUT) { HP(100); Speed(1); }
PLAYER(SPECIES_EKANS) { HP(100); Ability(ABILITY_SHED_SKIN); Status1(STATUS1_BURN); Speed(2); }
OPPONENT(SPECIES_WYNAUT) { HP(100); Item(ITEM_LEFTOVERS); Speed(3); }
OPPONENT(SPECIES_WOBBUFFET) { HP(100); Item(ITEM_BLACK_SLUDGE); Speed(4); }
} WHEN {
TURN { MOVE(playerLeft, MOVE_GRASSY_TERRAIN); }
} SCENE {
MESSAGE("The opposing Wobbuffet is healed by the grassy terrain!");
MESSAGE("The opposing Wobbuffet was hurt by the Black Sludge!");
MESSAGE("The opposing Wynaut is healed by the grassy terrain!");
MESSAGE("The opposing Wynaut restored a little HP using its Leftovers!");
MESSAGE("Ekans is healed by the grassy terrain!");
MESSAGE("Ekans's Shed Skin cured its burn problem!");
MESSAGE("Wynaut is healed by the grassy terrain!");
}
}

View File

@ -58,6 +58,32 @@ SINGLE_BATTLE_TEST("Leech Seed recovery is prevented by Heal Block")
} }
} }
DOUBLE_BATTLE_TEST("Leech Seed will drain HP based on speed of the drained mon")
{
GIVEN {
PLAYER(SPECIES_WYNAUT) { Speed(1); }
PLAYER(SPECIES_WOBBUFFET) { Speed(2); }
OPPONENT(SPECIES_WYNAUT) { Speed(3); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(4); }
} WHEN {
TURN {
MOVE(playerLeft, MOVE_LEECH_SEED, target: opponentLeft);
MOVE(playerRight, MOVE_LEECH_SEED, target: opponentRight);
MOVE(opponentLeft, MOVE_LEECH_SEED, target: playerLeft);
MOVE(opponentRight, MOVE_LEECH_SEED, target: playerRight);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, opponentRight);
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, opponentLeft);
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, playerRight);
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, playerLeft);
HP_BAR(opponentRight);
HP_BAR(opponentLeft);
HP_BAR(playerRight);
HP_BAR(playerLeft);
}
}
TO_DO_BATTLE_TEST("Leech Seed doesn't affect already seeded targets") TO_DO_BATTLE_TEST("Leech Seed doesn't affect already seeded targets")
TO_DO_BATTLE_TEST("Leech Seed's effect is paused until a new battler replaces the original user's position") // Faint, can't be replaced, then revived. TO_DO_BATTLE_TEST("Leech Seed's effect is paused until a new battler replaces the original user's position") // Faint, can't be replaced, then revived.
TO_DO_BATTLE_TEST("Leech Seed's effect pause still prevents it from being seeded again") TO_DO_BATTLE_TEST("Leech Seed's effect pause still prevents it from being seeded again")