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

[Scripting Question] Berries that reduce Physical / Special Damage

  • 71
    Posts
    5
    Years
    Hi,

    I'm trying to make a couple of scripts for two new type of berries. One reduces incoming physical damage, while the other reduces special damage.

    Code:
    def pbMoveWeakeningBerryF(move,mults)
        return if !move.physicalMove?
      mults[:final_damage_multiplier] /= 2
        @damageState.berryWeakened = true
        ripening = false
        if hasActiveAbility?(:RIPEN)
          @battle.pbShowAbilitySplash(self)
          mults[:final_damage_multiplier] /= 2
          ripening = true
        end
        @battle.pbCommonAnimation("EatBerry", self)
        @battle.pbHideAbilitySplash(self) if ripening
      end
      
      def pbMoveWeakeningBerryS(move,mults)
        return if !move.specialMove?
        mults[:final_damage_multiplier] /= 2
        @damageState.berryWeakened = true
        ripening = false
        if hasActiveAbility?(:RIPEN)
          @battle.pbShowAbilitySplash(self)
          mults[:final_damage_multiplier] /= 2
          ripening = true
        end
        @battle.pbCommonAnimation("EatBerry", self)
        @battle.pbHideAbilitySplash(self) if ripening
      end

    But it doesn't seem to work:/ what should I start looking to fix?
     
    The methods are placed just below the code for the TypeWeakeningBerries (Occa Berry, Shuca berry etc) they all get called from the same method.

    I just changed a couple of lines and yet it doesn't work at all:/
     
    Back
    Top