• 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!
  • 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] Ability Like The Move Freeze-Dry

  • 10
    Posts
    5
    Years
    • Seen Jul 25, 2020
    I want to make a unique ability that makes any of the user's 4 moves super-effective against Grass-Type Pokemon despite the original Types of the user's moves.

    This is similar to how the move Freeze-Dry works, but I have no idea how to implement that into an Ability and where to edit all the code to make it happen.



    I have little to no coding knowledge, so if anyone can help me out and show me how and where to place code for this, I'd greatly appreciate it!

    (I only want the user with the ability to be applied the effect. Other ally's on the field should not be super-effective against Grass, only the user of the ability.)
     
    Well did you try just copy Freeze-Dry's code and edit for your ability?
    Code:
        if @function==0x135 && !attacker.effects[PBEffects::Electrify] # Freeze-Dry
          mod1=4 if isConst?(otype1,PBTypes,:WATER)
          if isConst?(otype2,PBTypes,:WATER)
            mod2=(otype1==otype2) ? 2 : 4
          end
          if isConst?(otype3,PBTypes,:WATER)
            mod3=(otype1==otype3 || otype2==otype3) ? 2 : 4
          end
        end
        if attacker.hasWorkingAbility(:MAMMAMIA) && opponent.pbHasType?(:GRASS)
          mod1=4; mod2=4; mod3=4
        end

    Maybe 2 instead 4. Anyway, test and give us the feedback.
     
    Well did you try just copy Freeze-Dry's code and edit for your ability?
    Code:
        if @function==0x135 && !attacker.effects[PBEffects::Electrify] # Freeze-Dry
          mod1=4 if isConst?(otype1,PBTypes,:WATER)
          if isConst?(otype2,PBTypes,:WATER)
            mod2=(otype1==otype2) ? 2 : 4
          end
          if isConst?(otype3,PBTypes,:WATER)
            mod3=(otype1==otype3 || otype2==otype3) ? 2 : 4
          end
        end
        if attacker.hasWorkingAbility(:MAMMAMIA) && opponent.pbHasType?(:GRASS)
          mod1=4; mod2=4; mod3=4
        end

    Maybe 2 instead 4. Anyway, test and give us the feedback.

    So I placed the code under def pbEffectsOnDealingDamage(move,user,target,damage) in PokeBattle_Battler and I placed it exactly like the example you gave besides changing attacker to user and opponent to target
    Unfortunately, it yielded no results at all. I tested it in a battle, but nothing happened differently at all.

    Any more suggestions?

    EDIT: I also tried implementing the code separately under #Ability effects and it gave me Name errors for the parts like "attacker" and "otype." I don't believe copying and pasting the code will suffice.

    UPDATE: I plugged in the code under Freeze Dry's code on PokeBattle_Move and the code worked for the most part. It did make any move super effective against Grass types, however after the hit a message displays saying the damage the opponent received was reduced. I have no idea why it's doing this.
     
    Last edited:
    I would also like to know because I'd like to make an ability that makes Grass, Electric, and Dragon types weak to Electric. So far I have this.

    Code:
    Battle::AbilityEffects::DamageCalcFromUser.add(:ABILITY,
      proc { |ability, user, target, move, mults, power, type|
        return Effectiveness::SUPER_EFFECTIVE_MULTIPLIER if defType == :GRASS
        return Effectiveness::SUPER_EFFECTIVE_MULTIPLIER if defType == :ELECTRIC
        return Effectiveness::SUPER_EFFECTIVE_MULTIPLIER if defType == :DRAGON
        return super
      }
    )

    This did not work. What would you recommend?
     
    Hi, I'm not as awesome as Wolf, but I'm here, so I'll have to do!
    Let's start with the guy from February 2020. Talk about the eye before the storm! Sorry you had to wait so long!
    Ability that hits SE vs Grass types
    Spoiler:


    Ability that makes X moves SE vs A, B, C...
    Spoiler:
    [/spoiler]
     
    Hi, I'm not as awesome as Wolf, but I'm here, so I'll have to do!
    Let's start with the guy from February 2020. Talk about the eye before the storm! Sorry you had to wait so long!
    Ability that hits SE vs Grass types
    Spoiler:


    Ability that makes X moves SE vs A, B, C...
    Spoiler:
    [/spoiler]
    This worked for me! I used the code for an ability called evaporation that makes fire type moves super effective against water types, and have been struggling to figure out how to do it for a while so thank you!
     
    Back
    Top