Terrain Pulse effect implemented

This commit is contained in:
Eduardo Quezada D'Ottone 2021-10-04 22:45:37 -03:00
parent aa7484bba0
commit 43d42c95cf
6 changed files with 27 additions and 3 deletions

View File

@ -13979,7 +13979,7 @@ Move_RISING_VOLTAGE::
end @to do:
Move_TERRAIN_PULSE::
end @to do:
goto Move_DRAGON_PULSE @Temporary, needs to setup different animations based on terrain
Move_SKITTER_SMACK::
end @to do:

View File

@ -379,6 +379,7 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectDecorate @ EFFECT_DECORATE
.4byte BattleScript_EffectHit @ EFFECT_SNIPE_SHOT
.4byte BattleScript_EffectTripleHit @ EFFECT_TRIPLE_HIT
.4byte BattleScript_EffectHit @ EFFECT_TERRAIN_PULSE
BattleScript_EffectDecorate:
attackcanceler

View File

@ -363,7 +363,8 @@
#define EFFECT_DECORATE 357
#define EFFECT_SNIPE_SHOT 358
#define EFFECT_TRIPLE_HIT 359
#define EFFECT_TERRAIN_PULSE 360
#define NUM_BATTLE_MOVE_EFFECTS 360
#define NUM_BATTLE_MOVE_EFFECTS 361
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -5095,6 +5095,23 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
if (ItemId_GetPocket(gBattleMons[battlerAtk].item) == POCKET_BERRIES)
gBattleStruct->dynamicMoveType = gNaturalGiftTable[ITEM_TO_BERRY(gBattleMons[battlerAtk].item)].type;
}
else if (gBattleMoves[move].effect == EFFECT_TERRAIN_PULSE)
{
if ((gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
&& IsBattlerGrounded(battlerAtk))
{
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN)
gBattleStruct->dynamicMoveType = TYPE_ELECTRIC | 0x80;
else if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN)
gBattleStruct->dynamicMoveType = TYPE_GRASS | 0x80;
else if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)
gBattleStruct->dynamicMoveType = TYPE_FAIRY | 0x80;
else if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN)
gBattleStruct->dynamicMoveType = TYPE_PSYCHIC | 0x80;
else
gBattleStruct->dynamicMoveType = TYPE_NORMAL | 0x80;
}
}
attackerAbility = GetBattlerAbility(battlerAtk);
GET_MOVE_TYPE(move, moveType);

View File

@ -7572,6 +7572,11 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
basePower *= 2;
#endif
break;
case EFFECT_TERRAIN_PULSE:
if ((gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
&& IsBattlerGrounded(gBattlerAttacker))
basePower *= 2;
break;
}
// move-specific base power changes

View File

@ -11332,7 +11332,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_TERRAIN_PULSE] =
{
.effect = EFFECT_PLACEHOLDER, //TODO
.effect = EFFECT_TERRAIN_PULSE,
.power = 50,
.type = TYPE_NORMAL,
.accuracy = 100,