• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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] Grass Pelt and Fluffy Ability Scripts

Lazy Catalyst

What you do, the way you think, makes you differen
  • 91
    Posts
    7
    Years
    Hi Guys
    I found Grass Pelt and Fluffy ability on the community but they don't seen to work for me.
    So if anyone have scripted them for Essentials 17.2 please share it with me
    Thanks in Advance 😀
     
    Last edited:
    Try with that code. Just search for Marvelscale (use CTRL+SHIFT+ F) and paste below:

    Code:
        if !attacker.hasMoldBreaker
          if opponent.hasWorkingAbility(:MARVELSCALE) &&
             opponent.status>0 && pbIsPhysical?(type)
            defmult=(defmult*1.5).round
          end
          if opponent.hasWorkingAbility(:GRASSPELT) && 
           @effects[PBEffects::GrassyTerrain]>0 && 
           pbIsPhysical?(type) 
            defmult=(defmult*1.5).round
          end
     
    Try with that code. Just search for Marvelscale (use CTRL+SHIFT+ F) and paste below:

    Code:
        if !attacker.hasMoldBreaker
          if opponent.hasWorkingAbility(:MARVELSCALE) &&
             opponent.status>0 && pbIsPhysical?(type)
            defmult=(defmult*1.5).round
          end
          if opponent.hasWorkingAbility(:GRASSPELT) && 
           @effects[PBEffects::GrassyTerrain]>0 && 
           pbIsPhysical?(type) 
            defmult=(defmult*1.5).round
          end

    Thanks Wolf bro
    Can you please give a code for Fluffy also?
     
    Mybusiness made one, but i think we can make it better (i think):
    Code:
    Bulbapedia:
    A Pokémon with Fluffy takes half damage from moves that make contact. It also takes double damage from Fire-type moves. Fire-type moves that make contact will deal regular damage. Moves affected by Long Reach which make contact will deal regular damage.
    Inside 'PokeBattle_Move':
    Code:
        if opponent.hasWorkingAbility(:FLUFFY) && isContactMove?(attacker)
          finaldamagemult=(finaldamagemult*0.5).round
        elsif opponent.hasWorkingAbility(:FLUFFY) && isConst?(type,PBTypes,:FIRE)
          if isContactMove?(attacker)
            finaldamagemult=(finaldamagemult*1.0).round
          else
            finaldamagemult=(finaldamagemult*2.0).round
          end
        elsif opponent.hasWorkingAbility(:FLUFFY) && attacker.hasWorkingAbility(:LONGREACH) && 
          isContactMove?(attacker)
            finaldamagemult=(finaldamagemult*1.0).round
        end
     
    Last edited:
    I think that you might need to put the check about :FIRE and :LONGREACH above the other one.

    Like this:
    Code:
        if opponent.hasWorkingAbility(:FLUFFY) && isConst?(type,PBTypes,:FIRE)
          if isContactMove?(attacker)
            finaldamagemult=(finaldamagemult*1.0).round
          else
            finaldamagemult=(finaldamagemult*2.0).round
          end
        elsif opponent.hasWorkingAbility(:FLUFFY) && attacker.hasWorkingAbility(:LONGREACH) && 
          isContactMove?(attacker)
            finaldamagemult=(finaldamagemult*1.0).round
        elsif opponent.hasWorkingAbility(:FLUFFY) && isContactMove?(attacker)
          finaldamagemult=(finaldamagemult*0.5).round
        end

    Otherwise I think that contact moves will go into the first if and not get to check for fire. But double-check with something like Flame Wheel to know for sure. (And same for LR)

    (Also anything with Long Reach that uses a Fire-type contact move should probably do 2×?)
     
    Last edited:
    Try with that code. Just search for Marvelscale (use CTRL+SHIFT+ F) and paste below:

    Code:
        if !attacker.hasMoldBreaker
          if opponent.hasWorkingAbility(:MARVELSCALE) &&
             opponent.status>0 && pbIsPhysical?(type)
            defmult=(defmult*1.5).round
          end
          if opponent.hasWorkingAbility(:GRASSPELT) && 
           @effects[PBEffects::GrassyTerrain]>0 && 
           pbIsPhysical?(type) 
            defmult=(defmult*1.5).round
          end

    Wolf bro
    I tested this code for GRASSPELT but when the opponent's Rattata used Bite it gave me an error.
    The error:
    Code:
    [Pokémon Essentials version 17.2]
    Exception: NoMethodError
    Message: undefined method `[]' for nil:NilClass
    PokeBattle_Move:1022:in `pbCalcDamage'
    PokeBattle_Move:1360:in `pbEffect'
    PokeBattle_Battler:2950:in `pbProcessMoveAgainstTarget'
    PokeBattle_Battler:2905:in `each'
    PokeBattle_Battler:2905:in `pbProcessMoveAgainstTarget'
    PokeBattle_Battler:3491:in `pbUseMove'
    PokeBattle_Battler:3471:in `loop'
    PokeBattle_Battler:3494:in `pbUseMove'
    PokeBattle_Battler:3694:in `pbProcessTurn'
    PokeBattle_Battler:3693:in `logonerr'
    Can you please tell me how to fix this?
    Thanks in Advance
     
    Now, try with my old code:
    Code:
          if opponent.hasWorkingAbility(:GRASSPELT) && 
           @battle.field.effects[PBEffects::GrassyTerrain]>0 && 
           pbIsPhysical?(type) 
            defmult=(defmult*1.5).round
          end

    Thanks Wolf bro this one worked, I also tested the defence boosting when in Grassy Terrain and everything is working fine.
     
    Wolf bro, a small question
    In Pokebattle_Move do I have to place the Fluffy code below Marvel Scale or somewhere else?
     
    Inside 'PokeBattle_Move' script, above this:
    Code:
        if attacker.hasWorkingItem(:METRONOME)
          met=1+0.2*[attacker.effects[PBEffects::Metronome],5].min
          finaldamagemult=(finaldamagemult*met).round
        end

    Wolf bro
    I used your Fluffy script but when tested out it gives me an error something about wrong number of arguments.
    So I again tested the script by removing the "(attacker)" which was after "IsContactMove?", now the error is not appearing but the script isn't working.
    Any ideas why it's happening
    Thanks in Advance :)

    EDIT: Fixed it!
    I just removed the "(attacker)" and tested it on duplicated pokemon and it worked fine!! 😄
     
    Last edited:
    Wolf bro
    I used your Fluffy script but when tested out it gives me an error something about wrong number of arguments.
    So I again tested the script by removing the "(attacker)" which was after "IsContactMove?", now the error is not appearing but the script isn't working.
    Any ideas why it's happening
    Thanks in Advance :)

    EDIT: Fixed it!
    I just removed the "(attacker)" and tested it on duplicated pokemon and it worked fine!! 😄

    Always post the new code for the others devs just copy the correctly code, like you do.
     
    Last edited:
    Always post the new code for the others devs just copy the correctly code, like you do.

    Sure, I was going to post it . I was testing it in a few more possible conditions since the code must be perfect since we are posting it for others.
    Here's the Code:

    Put it Above "METRONOME" in PokeBattle_Move
    Code:
    if opponent.hasWorkingAbility(:FLUFFY) && isContactMove?
          finaldamagemult=(finaldamagemult*0.5).round
        elsif opponent.hasWorkingAbility(:FLUFFY) && isConst?(type,PBTypes,:FIRE)
          if isContactMove?
            finaldamagemult=(finaldamagemult*1.0).round
          else
            finaldamagemult=(finaldamagemult*2.0).round
          end
        elsif opponent.hasWorkingAbility(:FLUFFY) && attacker.hasWorkingAbility(:LONGREACH) && 
          isContactMove?
            finaldamagemult=(finaldamagemult*1.0).round
        end
     
    Last edited:
    Sure, I was going to post it . I was testing it in a few more possible conditions since the code must be perfect since we are posting it for others.
    Here's the Code:

    Put it Above "METRONOME" in PokeBattle_Move
    Code:
    if opponent.hasWorkingAbility(:FLUFFY) && isContactMove?
          finaldamagemult=(finaldamagemult*0.5).round
        elsif opponent.hasWorkingAbility(:FLUFFY) && isConst?(type,PBTypes,:FIRE)
          if isContactMove?
            finaldamagemult=(finaldamagemult*1.0).round
          else
            finaldamagemult=(finaldamagemult*2.0).round
          end
        elsif opponent.hasWorkingAbility(:FLUFFY) && attacker.hasWorkingAbility(:LONGREACH) && 
          isContactMove?
            finaldamagemult=(finaldamagemult*1.0).round
        end

    Check how mgriffin did about the order:
    Code:
        if opponent.hasWorkingAbility(:FLUFFY) && isConst?(type,PBTypes,:FIRE)
          if isContactMove?
            finaldamagemult=(finaldamagemult*1.0).round
          else
            finaldamagemult=(finaldamagemult*2.0).round
          end
        elsif opponent.hasWorkingAbility(:FLUFFY) && attacker.hasWorkingAbility(:LONGREACH) && 
          isContactMove?
            finaldamagemult=(finaldamagemult*1.0).round
        elsif opponent.hasWorkingAbility(:FLUFFY) && isContactMove?
          finaldamagemult=(finaldamagemult*0.5).round
        end
     
    Back
    Top