Applied review suggestions and expanded usage of activateAfterFaint in Cmd_setmoveeffect

This commit is contained in:
LOuroboros 2023-03-14 11:43:52 -03:00
parent fe735f9700
commit aefd318945
4 changed files with 11 additions and 33 deletions

View File

@ -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

View File

@ -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[];

View File

@ -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;
}

View File

@ -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,