• 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 Conquest 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.

[Question] (Scripting) How can I add a "Happiness" requirement to Mega Evolution (V18.1)

  • 21
    Posts
    4
    Years
    • Seen Sep 19, 2022
    I'm looking to add a requirement to my game where, in order for a Pokemon to Mega Evolve, it needs the Mega Stone, Mega Ring, AND to have a happiness level of >220 (like Pokemon that evolve via happiness). I wanted to keep players from just catching a Pokemon and being able to Mega Evolve it right away.

    I'm very new to programming, so I was wondering if anyone would know how I could accomplish this?
     
    I'm looking to add a requirement to my game where, in order for a Pokemon to Mega Evolve, it needs the Mega Stone, Mega Ring, AND to have a happiness level of >220 (like Pokemon that evolve via happiness). I wanted to keep players from just catching a Pokemon and being able to Mega Evolve it right away.

    I'm very new to programming, so I was wondering if anyone would know how I could accomplish this?

    Sorry for the late response, I saw your post while randomly browsing this part of the forum.
    If you haven't found the answer to the question yet, I suggest to check out the function:
    Code:
    def pbCanMegaEvolve?(idxBattler)
    Find the line:
    Code:
    return false if !pbHasMegaRing?(idxBattler)
    and add your happiness condition just below that:
    Code:
    return false if @battlers[idxBattler].happiness < 220
    It should do.
     
    Sorry for the late response, I saw your post while randomly browsing this part of the forum.
    If you haven't found the answer to the question yet, I suggest to check out the function:
    Code:
    def pbCanMegaEvolve?(idxBattler)
    Find the line:
    Code:
    return false if !pbHasMegaRing?(idxBattler)
    and add your happiness condition just below that:
    Code:
    return false if @battlers[idxBattler].happiness < 220
    It should do.

    Holy smokes, it works like a charm!!! Thank you so much! <3
     
    Back
    Top