Document atk48

This commit is contained in:
DizzyEggg 2018-07-29 15:33:16 +02:00
parent df4c20f1f8
commit 68145cd002
4 changed files with 54 additions and 45 deletions

View file

@ -2240,34 +2240,34 @@ BattleScript_EffectMemento::
setatkhptozero setatkhptozero
attackanimation attackanimation
waitanimation waitanimation
jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_82DA148 jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_EffectMementoPrintNoEffect
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_TARGET, 0x12, 0x7 playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO | ATK48_ONLY_MULTIPLE
playstatchangeanimation BS_TARGET, 0x2, 0x3 playstatchangeanimation BS_TARGET, BIT_ATK, ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO
setstatchanger STAT_ATK, 2, TRUE setstatchanger STAT_ATK, 2, TRUE
statbuffchange 0x1, BattleScript_82DA119 statbuffchange 0x1, BattleScript_EffectMementoTrySpAtk
jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_82DA119 jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTrySpAtk
printfromtable gStatDownStringIds printfromtable gStatDownStringIds
waitmessage 0x40 waitmessage 0x40
BattleScript_82DA119:: BattleScript_EffectMementoTrySpAtk:
playstatchangeanimation BS_TARGET, 0x10, 0x3 playstatchangeanimation BS_TARGET, BIT_SPATK, ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO
setstatchanger STAT_SPATK, 2, TRUE setstatchanger STAT_SPATK, 2, TRUE
statbuffchange 0x1, BattleScript_82DA13C statbuffchange 0x1, BattleScript_EffectMementoTryFaint
jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_82DA13C jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTryFaint
printfromtable gStatDownStringIds printfromtable gStatDownStringIds
waitmessage 0x40 waitmessage 0x40
BattleScript_82DA13C:: BattleScript_EffectMementoTryFaint:
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_82DA148:: BattleScript_EffectMementoPrintNoEffect:
printstring STRINGID_BUTNOEFFECT printstring STRINGID_BUTNOEFFECT
waitmessage 0x40 waitmessage 0x40
goto BattleScript_82DA13C goto BattleScript_EffectMementoTryFaint
BattleScript_82DA153:: BattleScript_82DA153:
attackstring attackstring
ppreduce ppreduce
jumpifattackandspecialattackcannotfall BattleScript_82DA15A jumpifattackandspecialattackcannotfall BattleScript_82DA15A
BattleScript_82DA15A:: BattleScript_82DA15A:
setatkhptozero setatkhptozero
pause 0x40 pause 0x40
effectivenesssound effectivenesssound
@ -2688,16 +2688,16 @@ BattleScript_TickleDoMoveAnim::
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
attackanimation attackanimation
waitanimation waitanimation
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_TARGET, 0x6, 0x5 playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, ATK48_STAT_NEGATIVE | ATK48_ONLY_MULTIPLE
playstatchangeanimation BS_TARGET, 0x2, 0x1 playstatchangeanimation BS_TARGET, BIT_ATK, ATK48_STAT_NEGATIVE
setstatchanger STAT_ATK, 1, TRUE setstatchanger STAT_ATK, 1, TRUE
statbuffchange 0x1, BattleScript_TickleTryLowerDef statbuffchange 0x1, BattleScript_TickleTryLowerDef
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleTryLowerDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleTryLowerDef
printfromtable gStatDownStringIds printfromtable gStatDownStringIds
waitmessage 0x40 waitmessage 0x40
BattleScript_TickleTryLowerDef:: BattleScript_TickleTryLowerDef::
playstatchangeanimation BS_TARGET, 0x4, 0x1 playstatchangeanimation BS_TARGET, BIT_DEF, ATK48_STAT_NEGATIVE
setstatchanger STAT_DEF, 1, TRUE setstatchanger STAT_DEF, 1, TRUE
statbuffchange 0x1, BattleScript_TickleEnd statbuffchange 0x1, BattleScript_TickleEnd
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleEnd
@ -2722,8 +2722,8 @@ BattleScript_EffectCosmicPower::
BattleScript_CosmicPowerDoMoveAnim:: BattleScript_CosmicPowerDoMoveAnim::
attackanimation attackanimation
waitanimation waitanimation
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, 0x24, 0x0 playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0x0
setstatchanger STAT_DEF, 1, FALSE setstatchanger STAT_DEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_CosmicPowerTrySpDef statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_CosmicPowerTrySpDef
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerTrySpDef
@ -2751,8 +2751,8 @@ BattleScript_EffectBulkUp::
BattleScript_BulkUpDoMoveAnim:: BattleScript_BulkUpDoMoveAnim::
attackanimation attackanimation
waitanimation waitanimation
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, 0x6, 0x0 playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0x0
setstatchanger STAT_ATK, 1, FALSE setstatchanger STAT_ATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_BulkUpTryDef statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_BulkUpTryDef
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpTryDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpTryDef
@ -2776,8 +2776,8 @@ BattleScript_EffectCalmMind::
BattleScript_CalmMindDoMoveAnim:: BattleScript_CalmMindDoMoveAnim::
attackanimation attackanimation
waitanimation waitanimation
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, 0x30, 0x0 playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0x0
setstatchanger STAT_SPATK, 1, FALSE setstatchanger STAT_SPATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_CalmMindTrySpDef statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_CalmMindTrySpDef
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindTrySpDef
@ -2808,8 +2808,8 @@ BattleScript_EffectDragonDance::
BattleScript_DragonDanceDoMoveAnim:: BattleScript_DragonDanceDoMoveAnim::
attackanimation attackanimation
waitanimation waitanimation
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, 0xA, 0x0 playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0x0
setstatchanger STAT_ATK, 1, FALSE setstatchanger STAT_ATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_DragonDanceTrySpeed statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_DragonDanceTrySpeed
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceTrySpeed jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceTrySpeed
@ -3487,8 +3487,8 @@ BattleScript_AllStatsUp::
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, 0xC, BattleScript_AllStatsUpAtk jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, 0xC, BattleScript_AllStatsUpAtk
jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPDEF, 0xC, BattleScript_AllStatsUpRet jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPDEF, 0xC, BattleScript_AllStatsUpRet
BattleScript_AllStatsUpAtk:: BattleScript_AllStatsUpAtk::
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, 0x3E, 0x0 playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0x0
setstatchanger STAT_ATK, 1, FALSE setstatchanger STAT_ATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_AllStatsUpDef statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_AllStatsUpDef
printfromtable gStatUpStringIds printfromtable gStatUpStringIds
@ -3655,16 +3655,16 @@ BattleScript_PrintMonIsRooted::
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_AtkDefDown:: BattleScript_AtkDefDown::
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, 0x6, 0xD playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_ATK, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE | ATK48_ONLY_MULTIPLE
playstatchangeanimation BS_ATTACKER, 0x2, 0x9 playstatchangeanimation BS_ATTACKER, BIT_ATK, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE
setstatchanger STAT_ATK, 1, TRUE setstatchanger STAT_ATK, 1, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | 0x1, BattleScript_82DB144 statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | 0x1, BattleScript_82DB144
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_82DB144 jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_82DB144
printfromtable gStatDownStringIds printfromtable gStatDownStringIds
waitmessage 0x40 waitmessage 0x40
BattleScript_82DB144:: BattleScript_82DB144::
playstatchangeanimation BS_ATTACKER, 0x4, 0x9 playstatchangeanimation BS_ATTACKER, BIT_DEF, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE
setstatchanger STAT_DEF, 1, TRUE setstatchanger STAT_DEF, 1, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | 0x1, BattleScript_82DB167 statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | 0x1, BattleScript_82DB167
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_82DB167 jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_82DB167
@ -3729,14 +3729,14 @@ BattleScript_OneHitKOMsg::
return return
BattleScript_SAtkDown2:: BattleScript_SAtkDown2::
setbyte sFIELD_1B, 0x0 setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, 0x10, 0xB playstatchangeanimation BS_ATTACKER, BIT_SPATK, ATK48_DONT_CHECK_LOWER | ATK48_STAT_NEGATIVE | ATK48_STAT_BY_TWO
setstatchanger STAT_SPATK, 2, TRUE setstatchanger STAT_SPATK, 2, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | 0x1, BattleScript_82DB1FE statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | 0x1, BattleScript_SAtkDown2End
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_82DB1FE jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SAtkDown2End
printfromtable gStatDownStringIds printfromtable gStatDownStringIds
waitmessage 0x40 waitmessage 0x40
BattleScript_82DB1FE:: BattleScript_SAtkDown2End::
return return
BattleScript_FocusPunchSetUp:: BattleScript_FocusPunchSetUp::

View file

@ -592,7 +592,7 @@ struct BattleScripting
u8 animTurn; u8 animTurn;
u8 animTargetsHit; u8 animTargetsHit;
u8 statChanger; u8 statChanger;
u8 field_1B; bool8 statAnimPlayed;
u8 atk23_state; u8 atk23_state;
u8 battleStyle; u8 battleStyle;
u8 atk6C_state; u8 atk6C_state;

View file

@ -17,7 +17,7 @@
#define sB_ANIM_TURN gBattleScripting + 0x18 #define sB_ANIM_TURN gBattleScripting + 0x18
#define sB_ANIM_TARGETS_HIT gBattleScripting + 0x19 #define sB_ANIM_TARGETS_HIT gBattleScripting + 0x19
#define sSTATCHANGER gBattleScripting + 0x1A #define sSTATCHANGER gBattleScripting + 0x1A
#define sFIELD_1B gBattleScripting + 0x1B #define sSTAT_ANIM_PLAYED gBattleScripting + 0x1B
#define sGIVEEXP_STATE gBattleScripting + 0x1C #define sGIVEEXP_STATE gBattleScripting + 0x1C
#define sBATTLE_STYLE gBattleScripting + 0x1D #define sBATTLE_STYLE gBattleScripting + 0x1D
#define sLVLBOX_STATE gBattleScripting + 0x1E #define sLVLBOX_STATE gBattleScripting + 0x1E
@ -91,7 +91,16 @@
// atk48 // atk48
#define ATK48_STAT_NEGATIVE 0x1 #define ATK48_STAT_NEGATIVE 0x1
#define ATK48_STAT_BY_TWO 0x2 #define ATK48_STAT_BY_TWO 0x2
#define ATK48_BIT_x4 0x4 #define ATK48_ONLY_MULTIPLE 0x4
#define ATK48_DONT_CHECK_LOWER 0x8 #define ATK48_DONT_CHECK_LOWER 0x8
#define BIT_HP 0x1
#define BIT_ATK 0x2
#define BIT_DEF 0x4
#define BIT_SPEED 0x8
#define BIT_SPATK 0x10
#define BIT_SPDEF 0x20
#define BIT_ACC 0x40
#define BIT_EVASION 0x80
#endif // GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H #endif // GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H

View file

@ -4479,16 +4479,16 @@ static void atk48_playstatchangeanimation(void)
} }
} }
if (gBattlescriptCurrInstr[3] & ATK48_BIT_x4 && changeableStatsCount < 2) if (gBattlescriptCurrInstr[3] & ATK48_ONLY_MULTIPLE && changeableStatsCount < 2)
{ {
gBattlescriptCurrInstr += 4; gBattlescriptCurrInstr += 4;
} }
else if (changeableStatsCount != 0 && gBattleScripting.field_1B == 0) else if (changeableStatsCount != 0 && !gBattleScripting.statAnimPlayed)
{ {
BtlController_EmitBattleAnimation(0, B_ANIM_STATS_CHANGE, statAnimId); BtlController_EmitBattleAnimation(0, B_ANIM_STATS_CHANGE, statAnimId);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (gBattlescriptCurrInstr[3] & ATK48_BIT_x4 && changeableStatsCount > 1) if (gBattlescriptCurrInstr[3] & ATK48_ONLY_MULTIPLE && changeableStatsCount > 1)
gBattleScripting.field_1B = 1; gBattleScripting.statAnimPlayed = TRUE;
gBattlescriptCurrInstr += 4; gBattlescriptCurrInstr += 4;
} }
else else