• 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] [version Eighteen] How would I make a move super-effective on a certain type, i.e. Ghost or Electric?

HeroesFightingFear

"The Champion of Alon"
  • 99
    Posts
    5
    Years
    How would I make a move super-effective on a certain type, like Ghost or Electric? This is important because I want to do this for two special moves exclusive to a post-purification Shadow Alolan Marowak in my game.
     
    Never mind, this should work, right?
    Code:
    return (PBTypeEffectiveness::NORMAL_EFFECTIVE * 2) if isConst?(move,PBMoves,:SPIRITBURNER) &&
           target.pbHasType?(:GHOST)
        return (PBTypeEffectiveness::NORMAL_EFFECTIVE * 2) if isConst?(move,PBMoves,:GRAVEDIGGER) &&
           target.pbHasType?(:ELECTRIC)
     
    I assume you can just make new move effects akin to Freeze-Dry. As Freeze-dry already uses the "super effective vs a certain type."
    Code:
    #===============================================================================
    # Freezes the target. Effectiveness against Water-type is 2x. (Freeze-Dry)
    #===============================================================================
    class PokeBattle_Move_135 < PokeBattle_FreezeMove
      def pbCalcTypeModSingle(moveType,defType,user,target)
        return PBTypeEffectiveness::SUPER_EFFECTIVE_ONE if isConst?(defType,PBTypes,:WATER)
        return super
      end
    end
    You can probably just copy freeze-dry's effect and change it to the type you want the move to be super effective against and then add them as move effects for your moves. :D This is for v18.
     
    I assume you can just make new move effects akin to Freeze-Dry. As Freeze-dry already uses the "super effective vs a certain type."
    Code:
    #===============================================================================
    # Freezes the target. Effectiveness against Water-type is 2x. (Freeze-Dry)
    #===============================================================================
    class PokeBattle_Move_135 < PokeBattle_FreezeMove
      def pbCalcTypeModSingle(moveType,defType,user,target)
        return PBTypeEffectiveness::SUPER_EFFECTIVE_ONE if isConst?(defType,PBTypes,:WATER)
        return super
      end
    end
    You can probably just copy freeze-dry's effect and change it to the type you want the move to be super effective against and then add them as move effects for your moves. :D This is for v18.

    Thanks, I honestly forgot Freeze-Dry was a move until now. This is a big help and solves the issue I had with the previous attempt.
     
    Back
    Top