• 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] Custom Ability

6
Posts
7
Years
    • Seen May 4, 2017
    I've created some custom abilities but actually i dont know how to haddle this concept.

    I want to create an ability like sturdy or something that just makes the pokemon inmortal BUT, he can take damage up to 1hp remaining and then its ability activates (so the battle seems fair until that).

    Is it even possible?
     

    Sir_Tman

    Overworked game Dev
    201
    Posts
    8
    Years
  • So what your saying is you want to make the ability sturdy?
    I don't quite understand this is what you have conveyed to me.
     
    824
    Posts
    8
    Years
  • No, he wants to make an ability that always leaves the user with at least 1 HP, regardless of how much damage the move should have done. No restriction that the Pokemon needed to be at full health to trigger it, which means it triggers forever and the Pokemon cannot be killed. Think of it less like Sturdy and more like an infinite Endure.

    Endure is found on line 1168 of the script section PokeBattle_Move. By adding in the red lines, you have your ability as described:
    Code:
            if @function==0xE9 # False Swipe
              damage=damage-1
            [COLOR="Red"]elsif opponent.hasWorkingAbility(:GODSENDURANCE)
              damage=damage-1[/COLOR]
            elsif opponent.effects[PBEffects::Endure]
              damage=damage-1
              opponent.damagestate.endured=true
              PBDebug.log("[Lingering effect triggered] #{opponent.pbThis}'s Endure")
            elsif damage==opponent.totalhp
              if opponent.hasWorkingAbility(:STURDY) && !attacker.hasMoldBreaker
                opponent.damagestate.sturdy=true
                damage=damage-1
                PBDebug.log("[Ability triggered] #{opponent.pbThis}'s Sturdy")
              elsif opponent.hasWorkingItem(:FOCUSSASH) && opponent.hp==opponent.totalhp
                opponent.damagestate.focussash=true
                damage=damage-1
                PBDebug.log("[Item triggered] #{opponent.pbThis}'s Focus Sash")
              elsif opponent.hasWorkingItem(:FOCUSBAND) && @battle.pbRandom(10)==0
                opponent.damagestate.focusband=true
                damage=damage-1
                PBDebug.log("[Item triggered] #{opponent.pbThis}'s Focus Band")
              end
            end

    Note, however, that abilities like this still leave the Pokemon vulnerable to certain things that can kill them:
    - Poison damage, unless the Pokemon is Poison type and was not poisoned by a Pokemon with the ability Corrosion
    - Burn damage, unless the Pokemon is Fire type
    - Nightmare damage
    - hail damage, unless the Pokemon is Ice or Steel type
    - sandstorm damage, unless the Pokemon is Rock, Ground, or Steel type
    - Shadow Sky damage, unless the Pokemon is a Shadow Pokemon.
     
    Last edited:
    6
    Posts
    7
    Years
    • Seen May 4, 2017
    That was much easier than I thought. Wow.
    Thank you, I will do the rest by my own :)
     
    Back
    Top