• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] Trying to have ability work off of a point system

  • 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;
     
    Back
    Top