• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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] Create an Ability that affects Status Effetcs?

3
Posts
7
Years
    • Seen Jun 5, 2021
    I'm working on my first project using Pokémon Essentials, and since I have no experience whatsoever with things like scripting or RPG Maker, it's kinda hard to make new things like abilities that work very differently from what we have in the games.

    What I want to do is something similar to a Boss Battle. By creating a new species on the PBS, giving him plenty of HP and Defenses and decent Offenses, I thought it could make for a challenging fight. However, there are some issues, and the first one of them is stuff that would be able to hit its maximum HP directly, like Poison/Toxic Poison and Burns.

    Obviously, just solving that would still leave the boss open to many "tricks" (F.E.A.R. would probably wreck it), but I suppose solving one problem at a time is fine too. So my idea was not to have him completely immune to Status effects, because that would unnecessarily punish players with Stall-er teams. Rather, I'd like to give him an Ability that would make him only take, say, 2% of his Maximum HP per turn in damage from things like Burn or Poison.

    Is this possible to implement? If so, how would I do it? I have no knowledge on RUBY (IF that is the language used on the scripts), but I thought that maybe it would need me to create a "Weak Poison" and a "Weak Burn" statuses and change Poison and Burn to these two when the boss is afflicted. Am I on the right path?

    Apologies for any mistakes on the text, English isn't my main language. Also, thanks in advance!
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    It's indeed possible. However, the HP loss would be negligible at best. A better amount would be 6.25% of the maximum HP like with the Heatproof ability and first-turn Toxic poison. What your ability would boil down to is a variant of the Magic Guard ability only it reduces attrition damage instead of grants immunity to it.

    As you would know there are a few other ways to take down this souped-up species of yours. Direct-damage attacks (Night Shade, Seismic Toss, Bide, Final Gambit, etc) doesn't care how high the defences are; Perish Song outright KOs it in three rounds (it cannot be blocked by protection moves); and OHKO moves in the right circumstances can wreck it. Some volatile status effects such as confusion and attraction (assuming it has a gender) can make life harder for it as well.
     
    3
    Posts
    7
    Years
    • Seen Jun 5, 2021
    Hey, thanks for the quick answer.

    Yeah, I do reckon that making an actual Boss Fight in Pokémon isn't exactly easy when there are so many gimmicks to play around high HP and defenses. It's not supposed to be close-to-impossible, though, just challenging enough for most players that go against it.

    If someone decides to take the easy route and tries to OHKO it, of course, it's up to them. What I can do is just make sure it isn't melt down by a Toxic user in a few turns, I guess, haha.

    But back to the topic, I guess taking a look at the Magic Bounce script will give me a hand then? I suppose I'd have to remove the "bouncing" part and then mess around with the values so that it only reduces the damage taken. But is it possible to make the Toxic Poison damage stay at its first turn value? I really have no experience with scripting, so it'd be a very big help of you could show me the ropes.

    Thanks!
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Hey

    in PokeBattle_Battle there is a part where the stages for Toxic are handled
    it looks like this:
    Code:
          # Poison/Bad poison
          if i.status==PBStatuses::POISON
            if i.statusCount>0
              i.effects[PBEffects::Toxic]+=1
              i.effects[PBEffects::Toxic]=[15,i.effects[PBEffects::Toxic]].min
            end

    You could implement a clause there to not raise the stage if the pokemon has a certain ability
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    Hey

    in PokeBattle_Battle there is a part where the stages for Toxic are handled
    it looks like this:
    Code:
          # Poison/Bad poison
          if i.status==PBStatuses::POISON
            if i.statusCount>0
              i.effects[PBEffects::Toxic]+=1
              i.effects[PBEffects::Toxic]=[15,i.effects[PBEffects::Toxic]].min
            end

    You could implement a clause there to not raise the stage if the pokemon has a certain ability
    Definitely on the right track there. To implement your new ability (let's call it Tenacious) go to PokeBattle_Battle and make the following changes:
    Code:
        # Fire Pledge + Grass Pledge combination damage
        for i in 0...2
          if sides[i].effects[PBEffects::SeaOfFire]>0 &&
             pbWeather!=PBWeather::RAINDANCE &&
             pbWeather!=PBWeather::HEAVYRAIN
            @battle.pbCommonAnimation("SeaOfFire",nil,nil) if i==0
            @battle.pbCommonAnimation("SeaOfFireOpp",nil,nil) if i==1
            for j in priority
              next if (j.index&1)!=i
              next if j.pbHasType?(:FIRE) || j.hasWorkingAbility(:MAGICGUARD)
              @scene.pbDamageAnimation(j,0)
              [COLOR="Red"]if j.hasWorkingAbility(:TENACIOUS)
                hploss=j.pbReduceHP((j.totalhp/16).floor)
              else[/COLOR]
                hploss=j.pbReduceHP((j.totalhp/8).floor)
              [COLOR="red"]end[/COLOR]
              pbDisplay(_INTL("{1} is hurt by the sea of fire!",j.pbThis)) if hploss>0
              if j.fainted?
                return if !j.pbFaint
              end
            end
          end
        end
    Code:
        # Leech Seed
        for i in priority
          next if i.fainted?
          if i.effects[PBEffects::LeechSeed]>=0 && !i.hasWorkingAbility(:MAGICGUARD)
            recipient=@battlers[i.effects[PBEffects::LeechSeed]]
            if recipient && !recipient.fainted?
              PBDebug.log("[Lingering effect triggered] #{i.pbThis}'s Leech Seed")
              pbCommonAnimation("LeechSeed",recipient,i)
              [COLOR="Red"]if i.hasWorkingAbility(:TENACIOUS)
                hploss=i.pbReduceHP((j.totalhp/16).floor)
              else[/COLOR]
                hploss=i.pbReduceHP((j.totalhp/8).floor)
              [COLOR="red"]end[/COLOR]
              if i.hasWorkingAbility(:LIQUIDOOZE)
                recipient.pbReduceHP(hploss,true)
                pbDisplay(_INTL("{1} sucked up the liquid ooze!",recipient.pbThis))
              else
                if recipient.effects[PBEffects::HealBlock]==0
                  hploss=(hploss*1.3).floor if recipient.hasWorkingItem(:BIGROOT)
                  recipient.pbRecoverHP(hploss,true)
                end
                pbDisplay(_INTL("{1}'s health was sapped by Leech Seed!",i.pbThis))
              end
              if i.fainted?
                return if !i.pbFaint
              end
              if recipient.fainted?
                return if !recipient.pbFaint
              end
            end
          end
        end
        for i in priority
          next if i.fainted?
          # Poison/Bad poison
          if i.status==PBStatuses::POISON
            if i.statusCount>0
              i.effects[PBEffects::Toxic]+=1 [COLOR="red"]unless i.hasWorkingAbility(:TENACIOUS)[/COLOR]
              i.effects[PBEffects::Toxic]=[15,i.effects[PBEffects::Toxic]].min
            end
            if i.hasWorkingAbility(:POISONHEAL)
              pbCommonAnimation("Poison",i,nil)
              if i.effects[PBEffects::HealBlock]==0 && i.hp<i.totalhp
                PBDebug.log("[Ability triggered] #{i.pbThis}'s Poison Heal")
                i.pbRecoverHP((i.totalhp/8).floor,true)
                pbDisplay(_INTL("{1} is healed by poison!",i.pbThis))
              end
            else
              if !i.hasWorkingAbility(:MAGICGUARD)
                PBDebug.log("[Status damage] #{i.pbThis} took damage from poison/toxic")
                if i.statusCount==0
                  [COLOR="Red"]if i.hasWorkingAbility(:TENACIOUS)
                    i.pbReduceHP((j.totalhp/16).floor)
                  else[/COLOR]
                    i.pbReduceHP((j.totalhp/8).floor)
                  [COLOR="red"]end[/COLOR]
                else
                  i.pbReduceHP(((i.totalhp*i.effects[PBEffects::Toxic])/16).floor)
                end
                i.pbContinueStatus
              end
            end
          end
          # Burn
          if i.status==PBStatuses::BURN
            if !i.hasWorkingAbility(:MAGICGUARD)
              PBDebug.log("[Status damage] #{i.pbThis} took damage from burn")
              if i.hasWorkingAbility(:HEATPROOF) [COLOR="red"]|| i.hasWorkingAbility(TENACIOUS)[/COLOR]
                PBDebug.log("[Ability triggered] #{i.pbThis}'s Heatproof")
                i.pbReduceHP((i.totalhp/16).floor)
              else
                i.pbReduceHP((i.totalhp/8).floor)
              end
            end
            i.pbContinueStatus
          end
          # Nightmare
          if i.effects[PBEffects::Nightmare]
            if i.status==PBStatuses::SLEEP
              if !i.hasWorkingAbility(:MAGICGUARD)
                PBDebug.log("[Lingering effect triggered] #{i.pbThis}'s nightmare")
                [COLOR="Red"]if i.hasWorkingAbility(:TENACIOUS)
                  i.pbReduceHP((j.totalhp/8).floor,true)
                else[/COLOR]
                  i.pbReduceHP((i.totalhp/4).floor,true)
                [COLOR="red"]end[/COLOR]
                pbDisplay(_INTL("{1} is locked in a nightmare!",i.pbThis))
              end
            else
              i.effects[PBEffects::Nightmare]=false
            end
          end
          if i.fainted?
            return if !i.pbFaint
            next
          end
        end
        # Curse
        for i in priority
          next if i.fainted?
          if i.effects[PBEffects::Curse] && !i.hasWorkingAbility(:MAGICGUARD)
            PBDebug.log("[Lingering effect triggered] #{i.pbThis}'s curse")
            [COLOR="Red"]if i.hasWorkingAbility(:TENACIOUS)
              i.pbReduceHP((j.totalhp/8).floor,true)
            else[/COLOR]
              i.pbReduceHP((i.totalhp/4).floor,true)
            [COLOR="red"]end[/COLOR]
            pbDisplay(_INTL("{1} is afflicted by the curse!",i.pbThis))
          end
          if i.fainted?
            return if !i.pbFaint
            next
          end
        end
    Code:
          # Bad Dreams
          if i.status==PBStatuses::SLEEP && !i.hasWorkingAbility(:MAGICGUARD)
            if i.pbOpposing1.hasWorkingAbility(:BADDREAMS) ||
               i.pbOpposing2.hasWorkingAbility(:BADDREAMS)
              PBDebug.log("[Ability triggered] #{i.pbThis}'s opponent's Bad Dreams")
              [COLOR="Red"]if i.hasWorkingAbility(:TENACIOUS)
                hploss=i.pbReduceHP((i.totalhp/16).floor,true)
              else[/COLOR]
                hploss=i.pbReduceHP((i.totalhp/8).floor,true)
              [COLOR="red"]end[/COLOR]
              pbDisplay(_INTL("{1} is having a bad dream!",i.pbThis)) if hploss>0
            end
          end
          if i.fainted?
            return if !i.pbFaint
            next
          end
    All of these changes halve the attrition damage a Pokémon with your ability would get from the Fire Pledge/Grass Pledge combo, Leech Seed, Poison (Toxic is indistinguishable from normal Poison), Burn, Nightmare, Curse and the Bad Dreams ability.
     
    3
    Posts
    7
    Years
    • Seen Jun 5, 2021
    Wow, once again, thanks a lot guys.

    That's a lot of info for me to take a look at, but since I do have a very basic understanding of programming, I get the "if, else" part where you used Ego13's suggestion. This helps so much that I can't thank you enough, specially when you already made the changes for other moves that would be annoying to deal with, like Leech Seed for example.

    I believe this solves my problem, at least in regards to what I asked for in this topic. Yet again, thanks to both of you for helping me out, it made things so much easier for me!
     
    Back
    Top