mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 20:24:18 +01:00
Camouflage with field terrains.
This commit is contained in:
parent
e2bf660c97
commit
aa7484bba0
@ -11484,13 +11484,13 @@ static void Cmd_callterrainattack(void) // nature power
|
||||
u16 GetNaturePowerMove(void)
|
||||
{
|
||||
if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)
|
||||
return MOVE_MOONBLAST;
|
||||
return MOVE_MOONBLAST;
|
||||
else if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN)
|
||||
return MOVE_THUNDERBOLT;
|
||||
return MOVE_THUNDERBOLT;
|
||||
else if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN)
|
||||
return MOVE_ENERGY_BALL;
|
||||
return MOVE_ENERGY_BALL;
|
||||
else if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN)
|
||||
return MOVE_PSYCHIC;
|
||||
return MOVE_PSYCHIC;
|
||||
return sNaturePowerMoves[gBattleTerrain];
|
||||
}
|
||||
|
||||
@ -12358,10 +12358,30 @@ bool32 CanCamouflage(u8 battlerId)
|
||||
|
||||
static void Cmd_settypetoterrain(void)
|
||||
{
|
||||
if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain]))
|
||||
u8 terrainType;
|
||||
switch(gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
|
||||
{
|
||||
SET_BATTLER_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain]);
|
||||
PREPARE_TYPE_BUFFER(gBattleTextBuff1, sTerrainToType[gBattleTerrain]);
|
||||
case STATUS_FIELD_ELECTRIC_TERRAIN:
|
||||
terrainType = TYPE_ELECTRIC;
|
||||
break;
|
||||
case STATUS_FIELD_GRASSY_TERRAIN:
|
||||
terrainType = TYPE_GRASS;
|
||||
break;
|
||||
case STATUS_FIELD_MISTY_TERRAIN:
|
||||
terrainType = TYPE_FAIRY;
|
||||
break;
|
||||
case STATUS_FIELD_PSYCHIC_TERRAIN:
|
||||
terrainType = TYPE_PSYCHIC;
|
||||
break;
|
||||
default:
|
||||
terrainType = sTerrainToType[gBattleTerrain];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, terrainType))
|
||||
{
|
||||
SET_BATTLER_TYPE(gBattlerAttacker, terrainType);
|
||||
PREPARE_TYPE_BUFFER(gBattleTextBuff1, terrainType);
|
||||
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user