- 853
- Posts
- 4
- Years
- Seen Nov 9, 2023
I made a script to play the move animation for a stat move, even when a stat can't be changed.
But it isn't working, and I can't tell why from what I can tell I put it in the correct place in the function.
Its called StatDownCantGoLower
If there is nothing wrong with my script then i thought maybe it has to do with the
attackanimation command.
But it isn't working, and I can't tell why from what I can tell I put it in the correct place in the function.
Its called StatDownCantGoLower
Spoiler:
Code:
BattleScript_StatDownFromAttackString:
attackstring
ppreduce
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatDownEnd
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatDownDoAnim
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x3, BattleScript_StatDownEnd
pause 0x20
@goto BattleScript_StatDownPrintString
goto BattleScript_StatDownCantGoLower
BattleScript_StatDownDoAnim::
attackanimation
waitanimation
setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
BattleScript_StatDownPrintString::
printfromtable gStatDownStringIds
waitmessage 0x40
BattleScript_StatDownEnd::
goto BattleScript_MoveEnd
BattleScript_StatDownCantGoLower::
attackanimation
waitanimation
printfromtable gStatDownStringIds
waitmessage 0x40
goto BattleScript_MoveEnd
If there is nothing wrong with my script then i thought maybe it has to do with the
attackanimation command.
Spoiler:
Code:
static void Cmd_attackanimation(void)
{
if (gBattleControllerExecFlags)
return;
if ((gHitMarker & HITMARKER_NO_ANIMATIONS)
&& gCurrentMove != MOVE_TRANSFORM
&& gCurrentMove != MOVE_SUBSTITUTE
// In a wild double battle gotta use the teleport animation if two wild pokemon are alive.
&& !(gCurrentMove == MOVE_TELEPORT && WILD_DOUBLE_BATTLE && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker))))
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_Pausex20;
gBattleScripting.animTurn++;
gBattleScripting.animTargetsHit++;
}
else
{
if ((gBattleMoves[gCurrentMove].target & MOVE_TARGET_BOTH
|| gBattleMoves[gCurrentMove].target & MOVE_TARGET_FOES_AND_ALLY
|| gBattleMoves[gCurrentMove].target & MOVE_TARGET_DEPENDS)
&& gBattleScripting.animTargetsHit)
{
gBattlescriptCurrInstr++;
return;
}
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{
u8 multihit;
gActiveBattler = gBattlerAttacker;
if (gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)
multihit = gMultiHitCounter;
else if (gMultiHitCounter != 0 && gMultiHitCounter != 1)
{
if (gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage)
multihit = 1;
else
multihit = gMultiHitCounter;
}
else
multihit = gMultiHitCounter;
BtlController_EmitMoveAnimation(0, gCurrentMove, gBattleScripting.animTurn, gBattleMovePower, gBattleMoveDamage, gBattleMons[gBattlerAttacker].friendship, &gDisableStructs[gBattlerAttacker], multihit);
gBattleScripting.animTurn += 1;
gBattleScripting.animTargetsHit += 1;
MarkBattlerForControllerExec(gBattlerAttacker);
gBattlescriptCurrInstr++;
}
else
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_Pausex20;
}
}
}
Last edited: