Merge pull request #2202 from AsparagusEduardo/BE_SkyDrop

Sky Drop fixes
This commit is contained in:
ghoulslash 2022-07-21 16:06:42 -04:00 committed by GitHub
commit 2ce32afeaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

@ -2493,15 +2493,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
//break;
//case EFFECT_BEAK_BLAST:
//break;
/*case EFFECT_SKY_DROP:
case EFFECT_SKY_DROP:
if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING))
score -= 10;
if (WillFaintFromWeather(battlerAtk)
|| MoveBlockedBySubstitute(move, battlerAtk, battlerDef)
|| GetSpeciesWeight(gBattleMons[battlerDef].species, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef], battlerDef, TRUE) >= 2000) //200.0 kg
if (BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk])
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|| GetBattlerWeight(battlerDef) >= 2000) //200.0 kg
score -= 10;
break;
*/
/*case EFFECT_NO_RETREAT:
if (TrappedByNoRetreat(battlerAtk))
score -= 10;

View File

@ -617,7 +617,7 @@ bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch)
{
if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)
|| IsAbilityPreventingEscape(battler)
|| gStatuses3[battler] & (STATUS3_ROOTED) // TODO: sky drop target in air
|| gStatuses3[battler] & (STATUS3_ROOTED | STATUS3_SKY_DROPPED)
|| (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK))
return TRUE;
}

View File

@ -9192,7 +9192,7 @@ static void Cmd_various(void)
break;
case VARIOUS_JUMP_IF_UNDER_200:
// If the Pokemon is less than 200 kg, or weighing less than 441 lbs, then Sky Drop will work. Otherwise, it will fail.
if (GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1) < 441)
if (GetBattlerWeight(gBattlerTarget) < 2000)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
else
gBattlescriptCurrInstr += 7;