• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Edit to Parental Bond?

  • 148
    Posts
    12
    Years
    I was looking through some older threads and found one where Nickalooose wrote out code for Parental Bond. It works great, but I wanted to try and edit it so instead of always hitting twice it would have a thirty percent chance to do so.

    Here's a link to the thread with her code.


    I thought just changing this part
    Code:
      # Parental Bond
          if isConst?(user.ability,PBAbilities,:PARENTALBOND) && thismove.basedamage>0 && realnumhits==2
            @battle.pbDisplay(_INTL("{1}'s {2} hit twice with Parental Bond!",user.pbThis,thismove.name))
          end

    to something like this
    Code:
              # Parental Bond
          if isConst?(user.ability,PBAbilities,:PARENTALBOND) && self.pbRandom(10)<3 && thismove.basedamage>0 && realnumhits==2
            @battle.pbDisplay(_INTL("{1}'s {2} hit twice with Parental Bond!",user.pbThis,thismove.name))
          end

    would work, but it didn't. This is a bit over my head. Could anyone point me in the direction to get this done?
     
    First of all, thanks for recognizing somebody else's code when you see it.
    But you could always use:
    Code:
      # Parental Bond
          [COLOR="Red"]chips=rand(3)[/COLOR]
          if isConst?(user.ability,PBAbilities,:PARENTALBOND) && thismove.basedamage>0 && realnumhits==2 [COLOR="red"]&& chips==1[/COLOR]
            @battle.pbDisplay(_INTL("{1}'s {2} hit twice with Parental Bond!",user.pbThis,thismove.name))
          end
    I'm pretty sure that will work... Basically, if chips doesn't equal 1, it will not double attack.
     
    First of all, thanks for recognizing somebody else's code when you see it.
    But you could always use:
    Code:
      # Parental Bond
          [COLOR="Red"]chips=rand(3)[/COLOR]
          if isConst?(user.ability,PBAbilities,:PARENTALBOND) && thismove.basedamage>0 && realnumhits==2 [COLOR="red"]&& chips==1[/COLOR]
            @battle.pbDisplay(_INTL("{1}'s {2} hit twice with Parental Bond!",user.pbThis,thismove.name))
          end
    I'm pretty sure that will work... Basically, if chips doesn't equal 1, it will not double attack.

    That didn't work. I also just realized that the message that should come up anytime a second attack hits doesn't. Which is honestly something I don't mind at all. Would probably get irritating after a while. Maybe it's just something I placed wrong with your code. I'll redo it and make sure I didn't skip anything. Thanks for the help though.

    Edit: Fixed the message problem, but it still hits twice all the time. Half the time the message doesn't show up though.

    Instead of hitting 30% of the time, is there a way to just decrease the power of the second hit?
     
    Last edited:
    This is because you're not editing the right part for attacking once or twice.
    When an attack hits, in Pokémon, it hits a single time, right?
    So moves like, Tackle, Double Edge, Flamethrower etc. Will always hit an opponent once.
    However, attacks like Double Kick, Fury Swipes, Double Slap etc. Will hit an opponent more than once, or another way to put this, multiple times.
    And with a simple CTRL+Shift+F, I can search Parental Bond in my scripts section and find this:
    Code:
            if thismove.pbIsMultiHit || isConst?(self.ability,PBAbilities,:PARENTALBOND) # Parental Bond
              pbProcessMultiHitMove(thismove,user,target,numhits,alltargets,showanimation)
            else
              pbProcessNonMultiHitMove(thismove,user,target,false,alltargets,showanimation)
            end
    This is the part where it makes a move become a double hit... Because there is a part a little higher than this script that sets any move to a double strike...
    Code:
            # Parental Bond
            if isConst?(user.ability,PBAbilities,:PARENTALBOND)
              numhits=2
            else
              numhits=thismove.pbNumHits # keep this
            end
    So by changing this here:
    Code:
            # Parental Bond
            [COLOR="red"]hello=rand(3)[/COLOR]
            if isConst?(user.ability,PBAbilities,:PARENTALBOND)[COLOR="red"] && hello==1[/COLOR]
              numhits=2
            else
              numhits=thismove.pbNumHits # keep this
            end
    And changing this:
    Code:
            if thismove.pbIsMultiHit || [COLOR="red"](isConst?(self.ability,PBAbilities,:PARENTALBOND) && numhits>1)[/COLOR] # Parental Bond
              pbProcessMultiHitMove(thismove,user,target,numhits,alltargets,showanimation)
            else
              pbProcessNonMultiHitMove(thismove,user,target,false,alltargets,showanimation)
            end
    The moves will only attack twice some of the time... For the second attacks power being halved, I never looked into it and I never will, so you'll have to find out yourself unfortunately.

    You'll have to edit the message thing accordingly btw.
     
    Back
    Top