• 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!
  • Scottie, Todd, Serena, Kris - 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.

[Scripting Question] Custom move that deals more damage the more hazards on the user's side

  • 79
    Posts
    9
    Years
    • Seen Jan 12, 2024
    Hello, I'm scripting a move that increases in damage depending on how many hazards are on its side, increasing by 20 for every hazard, similarly to Stored Power. The script I'm using doesn't return an error, however it appears to be dealing the same base damage no matter what. Here's the script I'm using:

    Spoiler:

    Would anyone be able to help me with what I'm doing incorrectly? Thanks!
     
    Last edited:
    If anyone can help him with that, can someone help me with a move that grows in power the more (NEW STAT) Courage stat boosts a Pokemon has?
    Courage is meant to work like a new Stat shown in the Summary, and it is boosted by new moves in my project such as Fear Nothing and Brave Power. It is now the stat boosted by the Brave nature as well.
     
    Try this:

    Code:
      def pbBaseDamage(basedmg,attacker,opponent)
        ret = 20
        ret += 20 if attacker.pbOwnSide.effects[PBEffects::StealthRock]
        ret += 20 if attacker.pbOwnSide.effects[PBEffects::StickyWeb]
        ret += (20*attacker.pbOwnSide.effects[PBEffects::Spikes])
        ret += (20*attacker.pbOwnSide.effects[PBEffects::ToxicSpikes])
        return ret 
      end
     
    If anyone can help him with that, can someone help me with a move that grows in power the more (NEW STAT) Courage stat boosts a Pokemon has?
    Courage is meant to work like a new Stat shown in the Summary, and it is boosted by new moves in my project such as Fear Nothing and Brave Power. It is now the stat boosted by the Brave nature as well.
    Try this:
    Code:
      def pbBaseDamage(basedmg,attacker,opponent)
        ret = 20 # Choose whatever base damage you want.
        if attacker.stages[PBStats::COURAGE] > 0
          ret += 10 * attacker.stages[PBStats::COURAGE]
          # Choose whatever increment you want (here 10)
        end 
        return ret 
      end
     
    Try this:

    Code:
      def pbBaseDamage(basedmg,attacker,opponent)
        ret = 20
        ret += 20 if attacker.pbOwnSide.effects[PBEffects::StealthRock]
        ret += 20 if attacker.pbOwnSide.effects[PBEffects::StickyWeb]
        ret += (20*attacker.pbOwnSide.effects[PBEffects::Spikes])
        ret += (20*attacker.pbOwnSide.effects[PBEffects::ToxicSpikes])
        return ret 
      end

    Worked like a charm, thank you!
     
    Back
    Top