• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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] Script to make Egg Groups have effects in battle! (v20.1)

  • 8
    Posts
    3
    Years
    • Seen Oct 12, 2023
    Hello! I'm relatively new to scripting and want to know how to make Egg Groups have properties when in battle! (Example: The Flying group will always be counted as Airborne, even if you don't have the Flying type)! Thank you for your help in advance
     
    If you're still looking for this, the following code is the main thing you'll need:
    Code:
    pkmn.species_data.egg_groups.include?(:<insert_group_here>)

    For the example stated, you're gonna want to find this section:

    Code:
    def airborne?
        return false if hasActiveItem?(:IRONBALL)
        return false if @effects[PBEffects::Ingrain]
        return false if @effects[PBEffects::SmackDown]
        return false if @battle.field.effects[PBEffects::Gravity] > 0
        return true if pbHasType?(:FLYING)
        return true if hasActiveAbility?(:LEVITATE) && [email protected]
        return true if hasActiveItem?(:AIRBALLOON)
        return true if @effects[PBEffects::MagnetRise] > 0
        return true if @effects[PBEffects::Telekinesis] > 0
        return false
      end

    At some point in this code, you'll want to add:
    Code:
    return true if pkmn.species_data.egg_groups.include?(:Flying)

    I'd suggest this being placed with the other "return true" lines, as the top lines take priority.
     
    Back
    Top