• 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!
  • 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.

[Scripting Question] Ability Help Aerial Boost

  • 67
    Posts
    4
    Years
    • He/Him
    • Seen Nov 16, 2023
    So I am trying to make an ability that boost your speed when you use a flying move and lets just call it aerial boost anyone know how I can make that ability?
     
    If you're using V18 this should suffice. :)
    Code:
    BattleHandlers::UserAbilityEndOfMove.add(:AERIALBOOST,
      proc { |ability,user,targets,move,battle|
        next if battle.pbAllFainted?(user.idxOpposingSide)
        next if !isConst?(move.type,PBTypes,:FLYING)
        user.pbRaiseStatStageByAbility(PBStats::SPEED,1,user)
      }
    )
     
    If you're using V18 this should suffice. :)
    Code:
    BattleHandlers::UserAbilityEndOfMove.add(:AERIALBOOST,
      proc { |ability,user,targets,move,battle|
        next if battle.pbAllFainted?(user.idxOpposingSide)
        next if !isConst?(move.type,PBTypes,:FLYING)
        user.pbRaiseStatStageByAbility(PBStats::SPEED,1,user)
      }
    )

    sorry I am working on 17.2 I keep forgetting to specify
     
    But If I port my project to v18 in the future I guess its good to know that is done already
     
    sorry I am working on 17.2 I keep forgetting to specify

    Try this code in "def pbEffectsOnDealingDamage":
    Code:
        if user.hasWorkingAbility(:AERIALBOOST) && movetype == PBTypes::FLYING
          if user.pbIncreaseStatWithCause(PBStats::SPEED,1,user,PBAbilities.getName(user.ability))
            PBDebug.log("[Ability triggered] #{target.pbThis}'s Aerial Boost")
          end
        end

    If you want it to activate only on contact moves, put it under this code:
    Code:
        if damage>0 && move.isContactMove?
          if !target.damagestate.substitute

    If you want it to activate only on damaging moves, put it under this code:
    Code:
        if damage>0
          if !target.damagestate.substitute

    If you want it to activate on all moves, put it above this code:
    Code:
        user.pbAbilityCureCheck
        target.pbAbilityCureCheck
     
    Back
    Top