Advertiser Content

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 8 Hours Ago
621 posts
329 Days
Try with that code. Just search for Marvelscale (use CTRL+SHIFT+ F) and paste below:

    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

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 3 Days Ago
Posted 3 Days Ago
76 posts
1.2 Years
Try with that code. Just search for Marvelscale (use CTRL+SHIFT+ F) and paste below:

    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

Discord: Wolf#1235

Male
Brazil
Online now
Posted 8 Hours Ago
621 posts
329 Days
Mybusiness made one, but i think we can make it better (i think):
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':
    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

mgriffin

Online now
Posted 2 Hours Ago
522 posts
5.2 Years
I think that you might need to put the check about :FIRE and :LONGREACH above the other one.

Like this:
    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×?)

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 3 Days Ago
Posted 3 Days Ago
76 posts
1.2 Years
Try with that code. Just search for Marvelscale (use CTRL+SHIFT+ F) and paste below:

    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:
[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

Discord: Wolf#1235

Male
Brazil
Online now
Posted 8 Hours Ago
621 posts
329 Days
Wolf bro
Can you please tell me how to fix this?
Thanks in Advance
Now, try with my old code:
      if opponent.hasWorkingAbility(:GRASSPELT) && 
       @battle.field.effects[PBEffects::GrassyTerrain]>0 && 
       pbIsPhysical?(type) 
        defmult=(defmult*1.5).round
      end

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 3 Days Ago
Posted 3 Days Ago
76 posts
1.2 Years
Now, try with my old 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.

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 3 Days Ago
Posted 3 Days Ago
76 posts
1.2 Years
Inside 'PokeBattle_Move' script, above this:
    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!! 😄

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 8 Hours Ago
621 posts
329 Days
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.

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 3 Days Ago
Posted 3 Days Ago
76 posts
1.2 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
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

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 8 Hours Ago
621 posts
329 Days
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
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:
    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
Advertiser Content