Ability-ignoring moves

Just Moongeist Meme and Sunsteel Strike for now. Added a special flag and modified "GetBattlerAbility" to check the current move for it.
This commit is contained in:
Papa Cancer 2019-04-07 13:03:40 +01:00
parent 28347912d9
commit fc8e59403a
3 changed files with 12 additions and 10 deletions

View File

@ -104,6 +104,7 @@
#define FLAG_BALLISTIC 0x20000
#define FLAG_PROTECTION_MOVE 0x40000
#define FLAG_POWDER 0x80000
#define FLAG_TARGET_ABILITY_IGNORED 0x100000
// Split defines.
#define SPLIT_PHYSICAL 0x0

View File

@ -3577,14 +3577,15 @@ u32 GetBattlerAbility(u8 battlerId)
{
if (gStatuses3[battlerId] & STATUS3_GASTRO_ACID)
return ABILITY_NONE;
else if ((gBattleMons[gBattlerAttacker].ability == ABILITY_MOLD_BREAKER
else if ((((gBattleMons[gBattlerAttacker].ability == ABILITY_MOLD_BREAKER
|| gBattleMons[gBattlerAttacker].ability == ABILITY_TERAVOLT
|| gBattleMons[gBattlerAttacker].ability == ABILITY_TURBOBLAZE)
&& sAbilitiesAffectedByMoldBreaker[gBattleMons[battlerId].ability]
&& gBattlerByTurnOrder[gCurrentTurnActionNumber] == gBattlerAttacker
&& gActionsByTurnOrder[gBattlerByTurnOrder[gBattlerAttacker]] == B_ACTION_USE_MOVE
&& gCurrentTurnActionNumber < gBattlersCount
&& !(gStatuses3[gBattlerAttacker] & STATUS3_GASTRO_ACID))
&& !(gStatuses3[gBattlerAttacker] & STATUS3_GASTRO_ACID))
|| gBattleMoves[gCurrentMove].flags & FLAG_TARGET_ABILITY_IGNORED)
&& sAbilitiesAffectedByMoldBreaker[gBattleMons[battlerId].ability]
&& gBattlerByTurnOrder[gCurrentTurnActionNumber] == gBattlerAttacker
&& gActionsByTurnOrder[gBattlerByTurnOrder[gBattlerAttacker]] == B_ACTION_USE_MOVE
&& gCurrentTurnActionNumber < gBattlersCount)
return ABILITY_NONE;
else
return gBattleMons[battlerId].ability;

View File

@ -9362,7 +9362,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_SUNSTEEL_STRIKE] =
{
.effect = EFFECT_PLACEHOLDER,
.effect = EFFECT_HIT,
.power = 100,
.type = TYPE_STEEL,
.accuracy = 100,
@ -9370,13 +9370,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED,
.split = SPLIT_PHYSICAL,
},
[MOVE_MOONGEIST_BEAM] =
{
.effect = EFFECT_PLACEHOLDER,
.effect = EFFECT_HIT,
.power = 100,
.type = TYPE_GHOST,
.accuracy = 100,
@ -9384,7 +9384,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED,
.split = SPLIT_SPECIAL,
},