• 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.

Could someone look these Abilities over and see if they spot any issues?

  • 1,479
    Posts
    10
    Years
    • Seen today
    I'm trying to add several new and old abilities to my game, and I'm running into issues with several of them. I'm no expert at this by any means, so I'm basically just tinkering until I find something that works. I'm not getting any errors with anything, but many of them just flat out dont seem to be working. If anyone more experienced at this would look these over and point out any glaring flaws, I'd appreciate it.

    Gen V Abilities

    Overcoat (with Gen VI changes)
    Location: PokeBattle_Move
    Goal: All "powder"-based moves should be blocked when the user has Overcoat, Safety Goggles, or is a Grass-type.
    Note: I added the unused flag "n" to all the "powder" moves in the PBS moves file.
    Issue: Nothing seems to change when this is active, the moves just hit as they normally would.
    Code:
    if (isConst?(opponent.ability,PBAbilities,:OVERCOAT) || 
           opponent.pbHasType?(:GRASS) || 
           isConst?(opponent.item,PBItems,:SAFETYGOGGLES)) &&
           (@flags&0x2000)!=0 #flag n: Powder move
          @battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
          return 0
       end

    Sheer Force
    Location: PokeBattle_Move
    Goal: This should negate secondary effects of moves, but boost their damage by 30%.
    Note: I wont bother posting the entire code, because i list the functions for every move with secondary effects. You get the gist of it here, though.
    Note: I already went through the whole script and added lines to negate the secondary effects of all the appropriate moves if Sheer Force is active. I won't list those changes because there's a lot, and that isn't the part I'm having issues with.
    Issue: When this ability is active, the negation of secondary effects works perfectly fine from what I can tell. The problem is that there doesn't seem to be any boost to damage for any of those moves.
    Code:
    if isConst?(attacker.ability,PBAbilities,:SHEERFORCE)
          if @function==0x05 ||  # Cross Poison, etc.
             @function==0x06 ||  # Poison Fang, etc.
             @function==0x07 ||  # Body Slam, etc.
             @function==0x08 ||  # Thunder
             @function==0x09 ||  # Thunder Fang
             etc,
             etc,
             etc...
           basedmg=(basedmg*1.3).floor
         end
       end

    Gen VI Abilities

    Tough Claws
    Location: PokeBattle_Move
    Goal: This should boost the damage of all contact moves by 33%.
    Issue: I don't seem to see any damage difference when this ability is active.
    Code:
    if isConst?(attacker.ability,PBAbilities,:TOUGHCLAWS) &&
          (@flags&0x01)!=0 && damage>0 # flag A: Makes contact
          basedmg=(basedmg*1.33).floor
        end

    Strong Jaw
    Location: PokeBattle_Move
    Goal: All "biting" attacks should have their damage boosted by 50%.
    Note: I added the unused flag "m" to all the biting moves in the PBS moves file.
    Issue: Same as Tough Claws - I don't see any damage difference when this is active.
    Code:
    if isConst?(attacker.ability,PBAbilities,:STRONGJAW) &&
           (@flags&0x1000)!=0 # flag m: Biting move
          basedmg=(basedmg*1.5).floor
        end

    Bulletproof
    Location: PokeBattle_Move
    Goal: Damage from certain ball & bomb attacks should be completely negated.
    Note: I added the unused flag "o" to all the ball & bomb attacks that Bulletproof is meant to block in the PBS moves file.
    Issue: Damage from ball & bomb moves aren't negated at all, and just hit as they normally would.
    Code:
    if isConst?(opponent.ability,PBAbilities,:BULLETPROOF) &&
           (@flags&0x4000)!=0 #flag o: Bomb/ball move
          basedamage==0
          abilityname=PBAbilities.getName(opponent.ability)
          @battle.pbDisplay(_INTL("{1} is protected with with {2}!",
          opponent.pbThis,PBAbilities.getName(opponent.ability), self.name))
          return 0
         end

    Custom Abilities

    Energy Drain
    Location: PokeBattle_Move
    Goal: I want this to boost the damage of all Absorb-like moves by 50%.
    Issue: Again, no damage difference is noticeable when this is active.
    Code:
    if isConst?(attacker.ability,PBAbilities,:ENERGYDRAIN) &&
           @function==0xDD #Absorb, etc.
          basedmg=(basedmg*1.5).floor
        end

    Sharp Edge
    Location:PokeBattle_Move
    Goal: I want this to boost the damage and crit chance of sword & slashing moves by 30%.
    Note: I added the unused flag "p" to all the sword & slashing attacks in the PBS moves file.
    Issue: No detectable difference in damage.
    Code:
    c+=1 if isConst?(attacker.ability,PBAbilities,:SHARPEDGE) && (@flags&0x8000)!=0
    ^This is under Super Luck under the def pbisCritical?
    Code:
    if isConst?(attacker.ability,PBAbilities,:SHARPEDGE) &&
          (@flags&0x8000)!=0 #flag p: Sword/Slash move
          basedmg=(basedmg*1.3).floor
        end

    Fang Leech
    Location: PokeBattle_Move
    Goal: I want this to make all "biting" moves have an additional HP-stealing effect, like Absorb.
    Note: This uses the same flag for biting moves as Strong Jaw does.
    Issue: Nothing happens when this is active. The moves just deal damage as they normally would, and nothing else.
    Code:
    if isConst?(attacker.ability,PBAbilities,:FANGLEECH) &&
           (@flags&0x01000)!=0 # flag m: Biting move
          if opponent.damagestate.calcdamage>0
            hpgain=((opponent.damagestate.hplost+1)/2).floor
          if isConst?(opponent.ability,PBAbilities,:LIQUIDOOZE)
            attacker.pbReduceHP(hpgain,true)
            @battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!",attacker.pbThis))
          elsif attacker.effects[PBEffects::HealBlock]==0
            hpgain=(hpgain*1.3).floor if isConst?(attacker.item,PBItems,:BIGROOT)
            attacker.pbRecoverHP(hpgain,true)
            @battle.pbDisplay(_INTL("{1}'s {2} drained some HP!",
             attacker.pbThis,PBAbilities.getName(attacker.ability))) if hpgain>0
           end
        end
      end
     
    Hmm in terms of power i like bit overpowed here a there
    i would change Fang leech to vampire fangs but thats my opion.

    Gee, that was useful and pertinent to the topic at hand! Except it isn't. This guy is having trouble getting his ability effects working and wants help in getting them to work, not an opinion on the abilities themselves.


    Anyway, I think for Overcoat, there is a better way to add the new immunity rather than creating an entirely new flag altogether.
    This is what I did for the grass type's immunity to powder moves in my game, and it works:
    Code:
    ################################################################################
    # Puts Target to sleep. Fails if the target's type is Grass (Spore/Sleep Powder)
    ################################################################################
    class PokeBattle_Move_137 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
        if opponent.pbCanSleep?(true)
          if opponent.pbHasType?(:GRASS)
            @battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true)))
            return -1
          end
          pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
          opponent.pbSleep
          @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
          return 0
        end
        return -1
      end
    end
    Basically, within PokeBattle_MoveEffects, I created my own function codes for each "powder" move, doing the same thing they typically do, but checking to see if the target matches a certain type, to which it fails if the target's type is Grass. This, at least with my complete inexperience to scripting, is much easier than trying to create a new flag for powder moves.

    For overcoat, you could probably just change the "if opponent.pbHasType?(:GRASS)" to "if isConst?(opponent.ability,PBAbilities,:OVERCOAT)" and it should work out. The only tedious thing you might need to go through is in replacing every function code for moves that are "powder-based" with your own.

    -You could probably do something similar with Strong Jaw. Using the "if isConst?" statement for abilities above, you could edit the move effects of all "biting" moves to increase their damage if a Pokemon has that ability. It seems like creating new flags is the death of you, so I'd stick to just working with editing/creating new function codes in PokeBattle_MoveEffects for stuff like that.

    I hope that helps.
     
    For most of these abilities, the main question is: "Where exactly did you put the code?" Script section alone isn't enough information, nor even is which method you put it in. If your code is in the wrong part of a method, then it could either apply to a variable that doesn't exist yet, or to a variable after it has already been used.

    Also, are you sure that you tested these abilities properly? As in, you're certain that they actually would apply during the test battles, and that there's nothing that could prevent them from working?

    Sheer Force
    Spoiler: This effect will be in Essentials v14. What I did was check the move's added effect probability, and apply the effects of Sheer Force if the probability is not 0. This involved changing some move details/effects around a bit so that only moves which can be affected by Sheer Force have non-zero added effect probabilities.
     
    Tough Claws, Strong Jaw, Energy Drain, and Sharp Edge I placed under Iron Fist since i used that as my model when figuring out how to write them out.

    Overcoat, Bulletproof, and Fang Leech I was less sure of where to put, but i put them under "pbAbilityeffect".

    I believe ive tested them all properly. Ive created an encounter with set Level/IVs/EVs/Nature to test moves against, in order to mitigate random values from affecting damage. Then i just switch between having the ability on and off, taking screenshots of how much damage is dealt. Im using Iron Fist as my model here too - i tested it to see if i can see a noticeable difference in damage, and i do. But with any of my added abilities, the difference in damage is so small that you can just chalk it up to RNG.

    Very cool to hear about Sheer Force though, sounds like a good method you've figured out. I might just wait for that. Is there any time frame as of yet for v14's release?
     
    Tough Claws mentions damage, which isn't defined until later down the method. Use @basedamage instead.

    Strong Jaw/Sharp Edge look fine to me. If they don't actually work, the only thing I can think of is that you haven't added the letters to moves.txt after all (either for the moves you're testing, or you accidentally edited a different copy of moves.txt which you weren't using, or you didn't compile it afterwards, etc.).

    Energy Drain looks fine. Just make sure it applies to function code DE as well. Fang Leech is probably fine where you put it.

    Since Overcoat/Bulletproof work like Flash Fire (minus the stat-boosting), it makes sense to put them next to it.


    As part of testing, you could make the damage multipliers something ridiculous like x50. You'd definitely notice if they applied then.

    Very cool to hear about Sheer Force though, sounds like a good method you've figured out. I might just wait for that. Is there any time frame as of yet for v14's release?
    There's never a time frame.
     
    Hmm ok, I think those tips will help. Ill tweak what I have when I get home. Thanks for all the help.
     
    So far I've been able to get Tough Claws, Strong Jaw, Bulletproof, Energy Drain, and Sharp Edge to work properly.

    Overcoat and Fang Leech still don't seem to work for some reason. I'll try fiddling with them some more and see what happens.

    EDIT: I got Overcoat now functioning perfectly, after ditching my method and adopting Ratty524's. Fang Leech still has me at a loss, though.
     
    Last edited:
    Back
    Top