diff options
author | Diegoisawesome <Diegoisawesome@users.noreply.github.com> | 2018-08-02 08:11:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 08:11:44 -0700 |
commit | 722b07707cfad28290e492ba13230cd2b0579e85 (patch) | |
tree | f7431ee72f6c9b60c2810c88edd5552212d528ee /src/battle_script_commands.c | |
parent | df4c20f1f875b41616ee55fe19162c01ffee2326 (diff) | |
parent | 9febcd3a0ad794f4531b56bb7d312b766261fc45 (diff) |
Merge pull request #282 from DizzyEggg/stats_bits
Add some more stat defines for battle scripts
Diffstat (limited to 'src/battle_script_commands.c')
-rw-r--r-- | src/battle_script_commands.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3af03a5e0..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++; } @@ -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 |