mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-28 12:44:18 +01:00
Camouflage with field terrains.
This commit is contained in:
parent
e2bf660c97
commit
aa7484bba0
@ -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