• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our 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