From 68145cd002e43a42194ce6fe8c9a5d390402e622 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 29 Jul 2018 15:33:16 +0200 Subject: Document atk48 --- src/battle_script_commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3af03a5e0..ec81fcae2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -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; } - else if (changeableStatsCount != 0 && gBattleScripting.field_1B == 0) + else if (changeableStatsCount != 0 && !gBattleScripting.statAnimPlayed) { BtlController_EmitBattleAnimation(0, B_ANIM_STATS_CHANGE, statAnimId); MarkBattlerForControllerExec(gActiveBattler); - if (gBattlescriptCurrInstr[3] & ATK48_BIT_x4 && changeableStatsCount > 1) - gBattleScripting.field_1B = 1; + if (gBattlescriptCurrInstr[3] & ATK48_ONLY_MULTIPLE && changeableStatsCount > 1) + gBattleScripting.statAnimPlayed = TRUE; gBattlescriptCurrInstr += 4; } else -- cgit v1.2.3 From 9febcd3a0ad794f4531b56bb7d312b766261fc45 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 29 Jul 2018 15:51:08 +0200 Subject: Document a bit of atk47 --- src/battle_script_commands.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ec81fcae2..e688d0b40 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4378,22 +4378,22 @@ static void atk46_playanimation2(void) // animation Id is stored in the first po static void atk47_setgraphicalstatchangevalues(void) { u8 value = 0; - switch (gBattleScripting.statChanger & 0xF0) + switch (GET_STAT_BUFF_VALUE2(gBattleScripting.statChanger)) { - case 0x10: // +1 + case SET_STAT_BUFF_VALUE(1): // +1 value = 0xF; break; - case 0x20: // +2 + case SET_STAT_BUFF_VALUE(2): // +2 value = 0x27; break; - case 0x90: // -1 + case SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE: // -1 value = 0x16; break; - case 0xA0: // -2 + case SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE: // -2 value = 0x2E; break; } - gBattleScripting.animArg1 = (gBattleScripting.statChanger & 0xF) + value - 1; + gBattleScripting.animArg1 = GET_STAT_BUFF_ID(gBattleScripting.statChanger) + value - 1; gBattleScripting.animArg2 = 0; gBattlescriptCurrInstr++; } -- cgit v1.2.3 From d6537c811b6ad5fe237580b978e192862b46d620 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 3 Aug 2018 00:13:44 +0200 Subject: Battle code enums in case switches --- src/battle_script_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e688d0b40..5c0b78240 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1120,9 +1120,9 @@ static void atk01_accuracycheck(void) { u16 move = T2_READ_16(gBattlescriptCurrInstr + 5); - if (move == 0xFFFE || move == 0xFFFF) + if (move == NO_ACC_CALC || move == NO_ACC_CALC_CHECK_LOCK_ON) { - if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && move == 0xFFFF && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) + if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && move == NO_ACC_CALC_CHECK_LOCK_ON && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) gBattlescriptCurrInstr += 7; else if (gStatuses3[gBattlerTarget] & (STATUS3_ON_AIR | STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); -- cgit v1.2.3