• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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] Custom ability not working

  • 26
    Posts
    281
    Days
    Hi, I am trying to make an ability that makes the user resistant to any move and hit super-effectively any foe. I tried copying and tweaking Thick Fat (for the DamageCalcFromTarget handler) and Water Bubble (for the DamageCalcFromUser handler) but it doesn't work and I can't understand why. I defined it in the PBS (I know because the game recognizes it), so I think I either wrote something wrong in the scripts (Battle_AbilityEffects section, don't know if it's wrong), or forgot to define something somewhere.

    DamageCalcFromUser handler:
    [PokeCommunity.com] Custom ability not working

    DamageCalcFromTarget handler (the list goes on enlisting every type, at the end of the list I put ".include?(type)"):
    [PokeCommunity.com] Custom ability not working

    Could someone help please?
     
    I solved it. If it can help anyone, I deleted what I wrote in Battle_AbilityEffects and split it into 2 scripts. I tweaked Tera Shell for the resistance and Mind's Eye for the super-effectiveness (I'm using the gen 9 pack) like this:

    Plugins\Generation 9 Pack Scripts\[004] Abilities\[002] DLC Abilities.rb
    #===============================================================================
    # Divinity
    #===============================================================================
    Battle::AbilityEffects::ModifyTypeEffectiveness.add(:DIVINITY,
    proc { |ability, user, target, move, battle, effectiveness|
    next if !move.damagingMove?
    next if user.hasMoldBreaker?
    next if effectiveness < Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
    next Effectiveness::NOT_VERY_EFFECTIVE_MULTIPLIER
    }
    )

    Plugins\Generation 9 Pack Scripts\[001] Battle\[001] Battle.rb (under "class Battle::Move"; credit to Swdfm for this code)
    #-----------------------------------------------------------------------------
    # Divinity
    #-----------------------------------------------------------------------------
    alias swdfm_pbCalcTypeModSingle pbCalcTypeModSingle
    def pbCalcTypeModSingle(moveType, defType, user, target)
    ret = swdfm_pbCalcTypeModSingle(moveType, defType, user, target)
    if user.hasActiveAbility?(:DIVINITY)
    ret = Effectiveness::SUPER_EFFECTIVE_MULTIPLIER
    end
    return ret
    end
     
    Back
    Top