• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Selene, Mint, Solana - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Buffs given by a certain battle background

Telemetius

Tele*
  • 256
    Posts
    10
    Years
    Hi, I recently implemented a couple new battle backgrounds and one of them is a lava filled cave floor; so I had an idea, why not give to my pokemons a couple buffs depending on the environment, eg.
    +1 atk to fire pkms if the battle background is lava -1 atk to water types
    +1 def to water pkms if we're underwater +1 atk if we're surfing

    So I had a look at the section move effects, secret power where i found this:

    when PBEnvironment::Volcano
    id=getConst(PBMoves,:INCINERATE)

    What I did then was to copy it, replace the second line with:

    @battlers[index].pbIncreaseStat(PBStats::DEFENSE,1,@battlers[index],true)

    And add it in Pokebattle_battle just after the message: Go! {1}!

    What I was trying to do isn't working though.
    I tried replacing "when" with "if" and still no luck.
     
    Remember that any "if" comes with an "end".

    I'm a little concerned that you're trying to do any coding stuff and you don't know these basics. The above isn't the only mistake you made here; I for one won't help you, because Essentials isn't "My First Coding Device", and if you want to change the coding in Essentials, it is assumed you already know how to use Ruby. There are plenty of guides on the Interweb.
     
    Yes for the moment all my ruby knowledge comes by trials and errors and this one in particulat was just an intrusive thought such as "Hey, why not?". I'm guessing this is too much and too early until I'll get better at it.
     
    Back
    Top