• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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!
  • 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] Adding New Ability Messages.

  • 38
    Posts
    9
    Years
    • Seen Aug 10, 2021
    Hey guys!

    I'm using the EBS, and I found where the Abilities' names is settled to appear on the battle screen, like "POKEMON'S NAME's Ability". But, when I tried to add more abilities to the list, some of the them didn't work (like Sturdy). Then I figured out that the Main "EliteBattle_0", where the Ability Message class is, uses the "PokeBattle_Battler" Main, and some of the abilities are in "PokeBattle_Move" main. How can I add those abilities, and if I have to add others classes to it, then, how? I'm really lost!!

    The part where it is add is that (I already put the abilities that I want to show on the screen when it activate):

    #===============================================================================
    # Ability Message handlers
    # used to display abilities in the style of Gen >= 5 games
    #===============================================================================
    if EFFECTMESSAGES

    class PokeBattle_Battler & PokeBattle_Move
    alias pbAbilitiesOnSwitchIn_ebs pbAbilitiesOnSwitchIn unless self.method_defined?(:pbAbilitiesOnSwitchIn_ebs)
    def pbAbilitiesOnSwitchIn(*args)
    if self.checkForAbilities(:FRISK,:FOREWARN,:BADDREAMS,:MOODY,:HARVEST,:TRACE,:INTIMIDATE,:PRESSURE,:MOLDBREAKER,:SNOWWARNING,:SANDSTREAM,:DRIZZLE,:DROUGHT,:AIRLOCK,:PRIMORDIALSEA, :DESOLATELAND,:DELTASTREAM,:ELECTRICSURGE,:MISTYSURGE,:GRASSYSURGE,:PSYCHICSURGE,:CLOUDNINE,:DOWNLOAD,:SPEEDBOOST,:ICEBODY,:HYDRATION,:SLOWSTART,:TERAVOLT,:TURBOBLAZE, :SHEDSKIN,:ANTICIPATION,:AURABREAK,:BEASTBOOST,:DANCER,:DISGUISE,:FAIRYAURA,:DARKAURA,:FLAMEBOOST,:HEALER,:FOREWARN,:IMPOSTER,:LEAFGUARD,:POISONHEAL,:RAINDISH,:SHIELDSDOWN, :SOLARPOWER,:SOULHEART,:SYNCHRONIZE,:TRUANT,:ZENMODE,:UNNERVE,:SYMBIOSIS,:SCHOOLING,:RECEIVER)
    @battle.abilityTrick = self
    else
    @battle.abilityMessage = self
    end
    ret = pbAbilitiesOnSwitchIn_ebs(*args)
    @battle.abilityTrick = nil
    @battle.abilityMessage = nil
    return ret
    end

    alias pbUseMove_ebs pbUseMove unless self.method_defined?(:pbUseMove_ebs)
    def pbUseMove(*args)
    if self.checkForAbilities(:STANCECHANGE)
    @battle.abilityChange = self
    end
    @battle.abilityTrick = nil
    @battle.abilityIntimidate = nil
    if self.checkForAbilities(:PROTEAN)
    @battle.abilityMessage = self
    end
    ret = pbUseMove_ebs(*args)
    @battle.abilityMessage = self
    @battle.abilityChange = nil
    return ret
    end

    if self.method_defined?(:pbReduceAttackStatIntimidate)
    alias pbReduceAttackStatIntimidate_ebs pbReduceAttackStatIntimidate unless self.method_defined?(:pbReduceAttackStatIntimidate_ebs)
    def pbReduceAttackStatIntimidate(*args)
    if self.checkForAbilities(:CLEARBODY,:WHITESMOKE,:HYPERCUTTER,:FLOWERVEIL,:FULLMETALBODY,:KEENEYE)
    @battle.abilityIntimidate = self
    @battle.abilityTrick = nil
    end
    return pbReduceAttackStatIntimidate_ebs(*args)
    end
    else
    alias pbReduceAttackStatStageIntimidate_ebs pbReduceAttackStatStageIntimidate unless self.method_defined?(:pbReduceAttackStatStageIntimidate_ebs)
    def pbReduceAttackStatStageIntimidate(*args)
    if self.checkForAbilities(:CLEARBODY,:WHITESMOKE,:HYPERCUTTER,:FLOWERVEIL,:FULLMETALBODY,:KEENEYE)
    @battle.abilityIntimidate = self
    @battle.abilityTrick = nil
    end
    return pbReduceAttackStatStageIntimidate_ebs(*args)
    end
    end

    def checkForAbilities(*args)
    return false if !PokeBattle_Battler.method_defined?(:hasWorkingAbility)
    ret = false
    for arg in args
    ret = true if self.hasWorkingAbility(arg)
    end
    return ret
    end

    alias pbAbilityCureCheck_ebs pbAbilityCureCheck unless self.method_defined?(:pbAbilityCureCheck_ebs)
    def pbAbilityCureCheck(*args)
    @battle.abilityTrick = nil
    ret = pbAbilityCureCheck_ebs(*args)
    @battle.abilityTrick = nil
    return ret
    end

    if self.method_defined?(:pbEffectsAfterHit)
    alias pbEffectsAfterHit_ebs pbEffectsAfterHit unless self.method_defined?(:pbEffectsAfterHit_ebs)
    def pbEffectsAfterHit(*args)
    user = args[0]; target = args[1]
    @battle.abilityTrick = user if user.checkForAbilities(:MOXIE,:MAGICIAN)
    @battle.abilityTrick = target if target.checkForAbilities(:COLORCHANGE,:PICKPOCKET,:CURSEDBODY,:WATERABSORB,:VOLTABSORB,:FLASHFIRE,:NOGUARD, :STORMDRAIN,:DRYSKIN,:SAPSIPPER,:TELEPATHY,:MOTORDRIVE,:LIGHTNINGROD,:BULLETPROOF,:SOUNDPROOF,:LEVITATE,:WATERBUBBLE,:IMMUNITY,:INSOMNIA,
    :MAGICBOUNCE,:OVERCOAT,:VITALSPIRIT,:SUCTIONCUPS,:QUEENLYMAJESTY)
    ret = pbEffectsAfterHit_ebs(*args)
    @battle.abilityTrick = self
    return ret
    end
    end

    if self.method_defined?(:pbEffectsOnDealingDamage)
    alias pbEffectsOnDealingDamage_ebs pbEffectsOnDealingDamage unless self.method_defined?(:pbEffectsOnDealingDamage_ebs)
    def pbEffectsOnDealingDamage(*args)
    target = args[2]
    @battle.abilityMessage = target if target.checkForAbilities(:AFTERMATH,:CUTECHARM,:EFFECTSPORE,:FLAMEBODY,:MUMMY,:POISONPOINT,:ROUGHSKIN,:IRONBARBS, :STATIC,:GOOEY,:POISONTOUCH,:CURSEDBODY,:JUSTIFIED,:RATTLED,:WEAKARMOR,:ANGERPOINT,:EMERGENCYEXIT,:ILLUSION,:LIQUIDOOZE,:TANGLINGHAIR,:STURDY,:WATERCOMPACTION,:STEADFAST)
    ret = pbEffectsOnDealingDamage_ebs(*args)
    @battle.abilityMessage = nil
    return ret
    end
    end

    end

    class PokeBattle_Move
    if self.method_defined?(:pbTypeImmunityByAbility)
    alias pbTypeImmunityByAbility_ebs pbTypeImmunityByAbility unless self.method_defined?(:pbTypeImmunityByAbility_ebs)
    def pbTypeImmunityByAbility(*args)
    @battle.abilityMessage = args[2]
    ret = pbTypeImmunityByAbility_ebs(*args)
    @battle.abilityMessage = nil
    return ret
    end
    else
    alias pbTypeModMessages_ebs pbTypeModMessages unless self.method_defined?(:pbTypeModMessages_ebs)
    def pbTypeModMessages(*args)
    @battle.abilityMessage = args[2]
    ret = pbTypeModMessages_ebs(*args)
    @battle.abilityMessage = nil
    return ret
    end
    end
    end

    end


    #####################################################

    That's all. Thanks for now.
     
    Back
    Top