mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +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
|
||||
|
||||
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
|
||||
seteffectprimary
|
||||
moveendall
|
||||
end
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
BattleScript_SpikesActivate::
|
||||
BattleScript_SpikesActivates::
|
||||
trysetspikes BattleScript_MoveEnd
|
||||
printfromtable gDmgHazardsStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
|
@ -457,7 +457,7 @@ extern const u8 BattleScript_LunarDanceActivates[];
|
||||
extern const u8 BattleScript_ShellTrapSetUp[];
|
||||
extern const u8 BattleScript_CouldntFullyProtect[];
|
||||
extern const u8 BattleScript_StealthRockActivates[];
|
||||
extern const u8 BattleScript_SpikesActivate[];
|
||||
extern const u8 BattleScript_SpikesActivates[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
@ -2896,6 +2896,9 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
return;
|
||||
case MOVE_EFFECT_STEALTH_ROCK:
|
||||
case MOVE_EFFECT_SPIKES:
|
||||
case MOVE_EFFECT_PAYDAY:
|
||||
case MOVE_EFFECT_STEAL_ITEM:
|
||||
case MOVE_EFFECT_BUG_BITE:
|
||||
activateAfterFaint = TRUE;
|
||||
break;
|
||||
}
|
||||
@ -2938,11 +2941,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
if (TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER)
|
||||
INCREMENT_RESET_RETURN
|
||||
|
||||
if (gBattleMons[gEffectBattler].hp == 0
|
||||
&& !activateAfterFaint
|
||||
&& gBattleScripting.moveEffect != MOVE_EFFECT_PAYDAY
|
||||
&& gBattleScripting.moveEffect != MOVE_EFFECT_STEAL_ITEM
|
||||
&& gBattleScripting.moveEffect != MOVE_EFFECT_BUG_BITE)
|
||||
if (gBattleMons[gEffectBattler].hp == 0 && !activateAfterFaint)
|
||||
INCREMENT_RESET_RETURN
|
||||
|
||||
if (DoesSubstituteBlockMove(gBattlerAttacker, gEffectBattler, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER)
|
||||
@ -3761,7 +3760,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
if (!gBattleMons[gEffectBattler].status1)
|
||||
{
|
||||
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);
|
||||
}
|
||||
break;
|
||||
@ -3778,7 +3777,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SPIKESSCATTERED;
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_SpikesActivate;
|
||||
gBattlescriptCurrInstr = BattleScript_SpikesActivates;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -13328,7 +13328,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
.type = TYPE_ROCK,
|
||||
.accuracy = 90,
|
||||
.pp = 15,
|
||||
.secondaryEffectChance = 0,
|
||||
.secondaryEffectChance = 100,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.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,
|
||||
.accuracy = 90,
|
||||
.pp = 15,
|
||||
.secondaryEffectChance = 0,
|
||||
.secondaryEffectChance = 100,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE,
|
||||
|
Loading…
Reference in New Issue
Block a user