• 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] Grass Pelt and Fluffy Ability Scripts

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
5
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:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
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
 

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
5
Years
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?
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
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:
1,403
Posts
10
Years
  • Seen Apr 18, 2024
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:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
I never saw a Pokémon with Long Reach inflicting fire damage (Skill Swap before) into a opponent with Fluffy abilities to check that. :/

About the order, make sense. Thanks!
 

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
5
Years
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
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
Wolf bro
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
 
Last edited:

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
5
Years
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.
 

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
5
Years
Wolf bro, a small question
In Pokebattle_Move do I have to place the Fluffy code below Marvel Scale or somewhere else?
 

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
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
 

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
5
Years
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:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
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:

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
5
Years
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:

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
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