mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 15:13:42 +01:00
Applied review suggestions and expanded usage of activateAfterFaint in Cmd_setmoveeffect
This commit is contained in:
parent
fe735f9700
commit
aefd318945
@ -433,31 +433,10 @@ BattleScript_EffectDireClaw::
|
|||||||
goto BattleScript_EffectHit
|
goto BattleScript_EffectHit
|
||||||
|
|
||||||
BattleScript_EffectHitSetEntryHazard::
|
BattleScript_EffectHitSetEntryHazard::
|
||||||
attackcanceler
|
|
||||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
|
||||||
attackstring
|
|
||||||
ppreduce
|
|
||||||
critcalc
|
|
||||||
damagecalc
|
|
||||||
adjustdamage
|
|
||||||
attackanimation
|
|
||||||
waitanimation
|
|
||||||
effectivenesssound
|
|
||||||
hitanimation BS_TARGET
|
|
||||||
waitstate
|
|
||||||
healthbarupdate BS_TARGET
|
|
||||||
datahpupdate BS_TARGET
|
|
||||||
critmessage
|
|
||||||
waitmessage B_WAIT_TIME_LONG
|
|
||||||
resultmessage
|
|
||||||
waitmessage B_WAIT_TIME_LONG
|
|
||||||
tryfaintmon BS_TARGET
|
|
||||||
argumenttomoveeffect
|
argumenttomoveeffect
|
||||||
seteffectprimary
|
goto BattleScript_EffectHit
|
||||||
moveendall
|
|
||||||
end
|
|
||||||
|
|
||||||
BattleScript_SpikesActivate::
|
BattleScript_SpikesActivates::
|
||||||
trysetspikes BattleScript_MoveEnd
|
trysetspikes BattleScript_MoveEnd
|
||||||
printfromtable gDmgHazardsStringIds
|
printfromtable gDmgHazardsStringIds
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
|
@ -457,7 +457,7 @@ extern const u8 BattleScript_LunarDanceActivates[];
|
|||||||
extern const u8 BattleScript_ShellTrapSetUp[];
|
extern const u8 BattleScript_ShellTrapSetUp[];
|
||||||
extern const u8 BattleScript_CouldntFullyProtect[];
|
extern const u8 BattleScript_CouldntFullyProtect[];
|
||||||
extern const u8 BattleScript_StealthRockActivates[];
|
extern const u8 BattleScript_StealthRockActivates[];
|
||||||
extern const u8 BattleScript_SpikesActivate[];
|
extern const u8 BattleScript_SpikesActivates[];
|
||||||
|
|
||||||
// zmoves
|
// zmoves
|
||||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||||
|
@ -2896,6 +2896,9 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
return;
|
return;
|
||||||
case MOVE_EFFECT_STEALTH_ROCK:
|
case MOVE_EFFECT_STEALTH_ROCK:
|
||||||
case MOVE_EFFECT_SPIKES:
|
case MOVE_EFFECT_SPIKES:
|
||||||
|
case MOVE_EFFECT_PAYDAY:
|
||||||
|
case MOVE_EFFECT_STEAL_ITEM:
|
||||||
|
case MOVE_EFFECT_BUG_BITE:
|
||||||
activateAfterFaint = TRUE;
|
activateAfterFaint = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2938,11 +2941,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
if (TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER)
|
if (TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER)
|
||||||
INCREMENT_RESET_RETURN
|
INCREMENT_RESET_RETURN
|
||||||
|
|
||||||
if (gBattleMons[gEffectBattler].hp == 0
|
if (gBattleMons[gEffectBattler].hp == 0 && !activateAfterFaint)
|
||||||
&& !activateAfterFaint
|
|
||||||
&& gBattleScripting.moveEffect != MOVE_EFFECT_PAYDAY
|
|
||||||
&& gBattleScripting.moveEffect != MOVE_EFFECT_STEAL_ITEM
|
|
||||||
&& gBattleScripting.moveEffect != MOVE_EFFECT_BUG_BITE)
|
|
||||||
INCREMENT_RESET_RETURN
|
INCREMENT_RESET_RETURN
|
||||||
|
|
||||||
if (DoesSubstituteBlockMove(gBattlerAttacker, gEffectBattler, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER)
|
if (DoesSubstituteBlockMove(gBattlerAttacker, gEffectBattler, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER)
|
||||||
@ -3761,7 +3760,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
if (!gBattleMons[gEffectBattler].status1)
|
if (!gBattleMons[gEffectBattler].status1)
|
||||||
{
|
{
|
||||||
static const u8 sDireClawEffects[] = { MOVE_EFFECT_POISON, MOVE_EFFECT_PARALYSIS, MOVE_EFFECT_SLEEP };
|
static const u8 sDireClawEffects[] = { MOVE_EFFECT_POISON, MOVE_EFFECT_PARALYSIS, MOVE_EFFECT_SLEEP };
|
||||||
gBattleScripting.moveEffect = sDireClawEffects[Random() % 3];
|
gBattleScripting.moveEffect = sDireClawEffects[Random() % ARRAY_COUNT(sDireClawEffects)];
|
||||||
SetMoveEffect(TRUE, 0);
|
SetMoveEffect(TRUE, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3778,7 +3777,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SPIKESSCATTERED;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SPIKESSCATTERED;
|
||||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||||
gBattlescriptCurrInstr = BattleScript_SpikesActivate;
|
gBattlescriptCurrInstr = BattleScript_SpikesActivates;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -13328,7 +13328,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
|||||||
.type = TYPE_ROCK,
|
.type = TYPE_ROCK,
|
||||||
.accuracy = 90,
|
.accuracy = 90,
|
||||||
.pp = 15,
|
.pp = 15,
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 100,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE,
|
||||||
@ -13605,7 +13605,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
|||||||
.type = TYPE_DARK,
|
.type = TYPE_DARK,
|
||||||
.accuracy = 90,
|
.accuracy = 90,
|
||||||
.pp = 15,
|
.pp = 15,
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 100,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user