• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
8
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?
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    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.
     
    58
    Posts
    8
    Years
    • Seen Oct 6, 2019
    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