- 15
- Posts
- 4
- Years
- Seen Nov 11, 2020
I'm using the ability competitive to utilize a variable that goes up when the Pokemon gets hit. However, when the Pokemon would get above +6 in a stat then the game freezes. I'm using CFRU and editing in the file ability_battle_effects with bideDmg as the variable.
Code:
case ABILITY_COMPETITIVE:
if (MOVE_HAD_EFFECT
&& TOOK_DAMAGE(bank)
&& BATTLER_ALIVE(bank)
&& gBattleMons[bank].statStages[STAT_SPATK - 1] < 12)
{
gBattleScripting.bideDmg += 1;
}
if (gBattleScripting.bideDmg > 1)
{ gBattleScripting.statChanger = STAT_SPATK | INCREASE_1;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaise;
effect++;
}
break;