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

[Scripting Question] Custom abilities

jdprager

OH MY GOD I FREAKING LOVE HYDREIGON
  • 19
    Posts
    8
    Years
    Hey, I have multiple abilities I would like to implement into my game, but am worthless at coding. If you would be willing to help a brother out, PM me or reply below, because I don't want to fill up this post.
    -However, the most important one is an ability that ignores all type IMMUNITIES (Not resistances). This is part of a larger, op ability I'm making, but this is the last piece I need.

    Also I have two other requests:
    -Making a battle impossible to win, no matter the grinding or Pokemon a player has. As part of this, losing a specific battle does not teleport you to a Pokemon center, but instead continues with the story.
    -Making a Pokemon join your party for a single battle (And be the only Pokemon in your party) and then leave immediately a win, giving the player back their old party.
    Thanks in advance for any help
     
    Last edited by a moderator:
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    For your first request, I'm not sure how you can make a battle impossible to win regardless of the player's pokemon. You could make like a level 100 pokemon...
    But for the second half of that, continuing instead of heading to a pokecenter, that's easy.
    Code:
    pbWildBattle([I]PBSpecies::species[/I],[I]level[/I],[I]result[/I],[I]escape[/I],[I]canlose[/I])
    Just set canlose to true. It will automatically heal the player's party. You might want to set escape to false so the player can't run.

    As for the second half, that will require a bit of scripting, but not much. To minimize headaches, I'll do the whole thing in one section.
    Go to Script Section PokeBattle_Trainer (clean v16.2).
    Under attr_accessor(:language), add attr_accessor(:party2)
    Put this anywhere in the section:
    Code:
      def takeParty
          @party2 = @party
          @party = []
      end
      
      def giveParty
          @party = @party2
          @party2 = []
      end
    Finally, in def initialize, under @party=[], add @party2=[]
    Call it with $Trainer.takeParty, and $Trainer.giveParty
    I attached a video of it in action. I forgot to show receiving a pokemon while in this state but it works. (You might have to start a new game though...)
    View attachment take and give.avi
     
  • 188
    Posts
    9
    Years
    • Seen May 16, 2024
    For the type immunity-ignoring ability simply put this line just before the last return line in def pbTypeModifier:
    Code:
        return 4 if attacker.hasWorkingAbility(:NAMEOFABILITY) && !opponent.hasBypassingAbility
    Of course, your ability will not work if the opponent has Mold Breaker or if the attacker is under the effect of Gastro Acid. If you're using Forest's Curse or Trick-or-Treat in your game, change the 4 to 8.
     
  • 824
    Posts
    9
    Years
    For the type immunity-ignoring ability simply put this line just before the last return line in def pbTypeModifier:
    Code:
        return 4 if attacker.hasWorkingAbility(:NAMEOFABILITY) && !opponent.hasBypassingAbility
    Of course, your ability will not work if the opponent has Mold Breaker or if the attacker is under the effect of Gastro Acid. If you're using Forest's Curse or Trick-or-Treat in your game, change the 4 to 8.
    This is actually the wrong way to go about this.
    1.) Does Mold Breaker work defensively? As far as I know, it only affects your attacks, not attacks that hit you.
    2.) This makes it so the Pokemon with the new ability ignores type effectiveness entirely. What he wants is something more akin to how Scrappy works, where it only ignores immunities.
    Code:
        # New ability
        if attacker.hasWorkingAbility(:NAMEOFABILITY)
          mod1=2 if PBTypes.isIneffective?(atype,otype1)
          mod2=2 if PBTypes.isIneffective?(atype,otype2)
          mod3=2 if PBTypes.isIneffective?(atype,otype3)
        end
    Scrappy, by the way, is found on line 386 of PokeBattle_Move. You want to put this move somewhere around there.
     

    jdprager

    OH MY GOD I FREAKING LOVE HYDREIGON
  • 19
    Posts
    8
    Years
    Thanks so much to to all of you! I did manage to figure out two possible ways to do the type ignoring ability, one using ring target and scrappy. Ro8ter, you just confirmed which one it is, thank you. Also, Mold Breaker is an offensive only ability, so your moves ignore the opponents ability but not vice versa
     
    Back
    Top