Field terrain move effect

This commit is contained in:
Eduardo Quezada D'Ottone 2021-10-04 21:32:08 -03:00
parent 5019615be1
commit 563ce8f416

View file

@ -8709,7 +8709,7 @@ static void Cmd_various(void)
else else
gBattlescriptCurrInstr += 7; // can heal gBattlescriptCurrInstr += 7; // can heal
return; return;
case VARIOUS_REMOVE_TERRAIN: case VARIOUS_REMOVE_TERRAIN:
switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
{ {
case STATUS_FIELD_MISTY_TERRAIN: case STATUS_FIELD_MISTY_TERRAIN:
@ -12075,35 +12075,60 @@ static void Cmd_getsecretpowereffect(void)
u16 GetSecretPowerMoveEffect(void) u16 GetSecretPowerMoveEffect(void)
{ {
u16 moveEffect; u16 moveEffect;
switch (gBattleTerrain) u32 fieldTerrain = gFieldStatuses & STATUS_FIELD_TERRAIN_ANY;
if (fieldTerrain)
{ {
case BATTLE_TERRAIN_GRASS: switch (fieldTerrain)
moveEffect = MOVE_EFFECT_SLEEP; {
break; case STATUS_FIELD_MISTY_TERRAIN:
case BATTLE_TERRAIN_LONG_GRASS: moveEffect = MOVE_EFFECT_SP_ATK_MINUS_1;
moveEffect = MOVE_EFFECT_SLEEP; break;
break; case STATUS_FIELD_GRASSY_TERRAIN:
case BATTLE_TERRAIN_SAND: moveEffect = MOVE_EFFECT_SLEEP;
moveEffect = MOVE_EFFECT_ACC_MINUS_1; break;
break; case STATUS_FIELD_ELECTRIC_TERRAIN:
case BATTLE_TERRAIN_UNDERWATER: moveEffect = MOVE_EFFECT_PARALYSIS;
moveEffect = MOVE_EFFECT_ATK_MINUS_1; break;
break; case STATUS_FIELD_PSYCHIC_TERRAIN:
case BATTLE_TERRAIN_WATER: moveEffect = MOVE_EFFECT_SPD_MINUS_1;
moveEffect = MOVE_EFFECT_ATK_MINUS_1; break;
break; default:
case BATTLE_TERRAIN_POND: moveEffect = MOVE_EFFECT_PARALYSIS;
moveEffect = MOVE_EFFECT_ATK_MINUS_1; break;
break; }
case BATTLE_TERRAIN_MOUNTAIN: }
moveEffect = MOVE_EFFECT_ACC_MINUS_1; else
break; {
case BATTLE_TERRAIN_CAVE: switch (gBattleTerrain)
moveEffect = MOVE_EFFECT_FLINCH; {
break; case BATTLE_TERRAIN_GRASS:
default: moveEffect = MOVE_EFFECT_SLEEP;
moveEffect = MOVE_EFFECT_PARALYSIS; break;
break; case BATTLE_TERRAIN_LONG_GRASS:
moveEffect = MOVE_EFFECT_SLEEP;
break;
case BATTLE_TERRAIN_SAND:
moveEffect = MOVE_EFFECT_ACC_MINUS_1;
break;
case BATTLE_TERRAIN_UNDERWATER:
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
break;
case BATTLE_TERRAIN_WATER:
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
break;
case BATTLE_TERRAIN_POND:
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
break;
case BATTLE_TERRAIN_MOUNTAIN:
moveEffect = MOVE_EFFECT_ACC_MINUS_1;
break;
case BATTLE_TERRAIN_CAVE:
moveEffect = MOVE_EFFECT_FLINCH;
break;
default:
moveEffect = MOVE_EFFECT_PARALYSIS;
break;
}
} }
return moveEffect; return moveEffect;
} }