• 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 Trading Card Game 2 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.

Trick Room, Magic Room, etc. -inducing Ability?

  • 53
    Posts
    9
    Years
    Is there a way to make an ability kind of like Drizzle, Drought, etc. but instead of weather, it brings in Trick Room, Magic Room, Gravity or Wonder Room?
     
    Yes, there is.

    In the PokeBattle_Battler script in def pbAbilitiesOnSwitchIn(onactive), add this code to induce the Trick Room effect for 5 turns (for this example, we can call the ability Reverse Order):
    if self.hasWorkingAbility(:REVERSEORDER) && onactive && @battle.effects[PBEffects::TrickRoom]==0
    @battle.effects[PBEffects::TrickRoom]=5
    # Ability and/or effect animations
    # In-battle effect text
    end
    This code can be adapted for Magic Room, Gravity and Wonder Room by changing the code.
     
    I was wondering about this also. On which line specifically in the section that you referenced does the new script go? Here is what my section in the editor looks like:

    ################################################################################
    # Ability effects
    ################################################################################
    def pbAbilitiesOnSwitchIn(onactive)
    return if self.isFainted?
    if onactive
    @battle.pbPrimalReversion(self.index)
    end
    # Weather
    if onactive
    if self.hasWorkingAbility(:PRIMORDIALSEA) && @battle.weather!=PBWeather::HEAVYRAIN
    @battle.weather=PBWeather::HEAVYRAIN
    @battle.weatherduration=-1
    @battle.pbCommonAnimation("HeavyRain",nil,nil)
    @battle.pbDisplay(_INTL("{1}'s {2} made a heavy rain begin to fall!",pbThis,PBAbilities.getName(self.ability)))
    PBDebug.log("[Ability triggered] #{pbThis}'s Primordial Sea made it rain heavily")
     
    Back
    Top