• 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] Question about "if" command

  • 90
    Posts
    7
    Years
    • Seen Nov 24, 2023
    I changed the properties of the ability Mega Launcher so that it boosts a move if it's either a bomb move or a pulse move. This is how the code for it looks like now:
    Code:
    if attacker.hasWorkingAbility(:MEGALAUNCHER) && (isPulseMove? || isBombMove?)
          damagemult=(damagemult*1.5).round
    end
    Something I'm not sure about is this: Will Mega Launcher boost a move twice if said move is both a bomb and a pulse move? Or will it only check for one of those 2 attributes and only buff it once?
     
    Last edited:
    Unless the code is being ran through a loop, each line is only read once. So as of now this code just says:
    "If the attacker has Mega Launcher, AND the move is a Pulse OR Bomb move, THEN damage is increased by 1.5"

    So you will only ever get 1.5 as your damage boost.
    Even if you did loop it, a second reading would just replace the first reading, resulting in 1.5 damage again. The only way this effect would cumulate is if you specifically CODED it to cumulate its damage with each possible scenario, and then return the cumulated damage boosts. Which would take a lot more work than this, so you're safe.
     
    Unless the code is being ran through a loop, each line is only read once. So as of now this code just says:
    "If the attacker has Mega Launcher, AND the move is a Pulse OR Bomb move, THEN damage is increased by 1.5"

    So you will only ever get 1.5 as your damage boost.
    Even if you did loop it, a second reading would just replace the first reading, resulting in 1.5 damage again. The only way this effect would cumulate is if you specifically CODED it to cumulate its damage with each possible scenario, and then return the cumulated damage boosts. Which would take a lot more work than this, so you're safe.

    Got it. Thanks!
     
    Back
    Top