• 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.
  • 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!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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