• 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!
  • 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] Adaptation Ability Help 17.2

  • 67
    Posts
    4
    Years
    • He/Him
    • Seen Nov 16, 2023
    ok so it works without giving me errors but my problem is the actual calculations don't work like it still does the same damage each time no matter how many times I get hit I have this under "def pbEffectsAfterHit"

    # Boost Adaptation
    if user.hasWorkingAbility(:ADAPTATION) && target.lastMoveUsed==thismove.id && !target.hasWorkingAbility(:MOLDBREAKER)
    user.effects[PBEffects::Adaptation]+=1
    else
    user.effects[PBEffects::Adaptation]=0
    end

    and this in "Pokebattle_Move"


    if opponent.hasWorkingAbility(:ADAPTATION)
    adn=1-0.2[attacker.effects[PBEffects::Adaptation],5].min
    finaldamagemult=(finaldamagemultadn).round
    end

    Anyone know what I'm doing wrong cause I feel I am so close
     
    ok so it works without giving me errors but my problem is the actual calculations don't work like it still does the same damage each time no matter how many times I get hit I have this under "def pbEffectsAfterHit"

    # Boost Adaptation
    if user.hasWorkingAbility(:ADAPTATION) && target.lastMoveUsed==thismove.id && !target.hasWorkingAbility(:MOLDBREAKER)
    user.effects[PBEffects::Adaptation]+=1
    else
    user.effects[PBEffects::Adaptation]=0
    end

    and this in "Pokebattle_Move"


    if opponent.hasWorkingAbility(:ADAPTATION)
    adn=1-0.2[attacker.effects[PBEffects::Adaptation],5].min
    finaldamagemult=(finaldamagemultadn).round
    end

    Anyone know what I'm doing wrong cause I feel I am so close

    It looks like at the very least you're not using multiplication symbols which seems to be the desired effect. Also, I'm not even sure what the intended effect for the ability is, though from this code it seems like it works as follows (you may need to change the code if this isn't your intended effect for the ability):
    "If the Pokemon with Adaptation uses the same move that the target last used, and the target also has the Adaptation, the damage from the user's next move is decreased by 0.2x the number of consecutive times the user has used the target's last move used before the current turn."
     
    It looks like at the very least you're not using multiplication symbols which seems to be the desired effect. Also, I'm not even sure what the intended effect for the ability is, though from this code it seems like it works as follows (you may need to change the code if this isn't your intended effect for the ability):
    "If the Pokemon with Adaptation uses the same move that the target last used, and the target also has the Adaptation, the damage from the user's next move is decreased by 0.2x the number of consecutive times the user has used the target's last move used before the current turn."

    Oh I see I was trying to make this ability like a reverse metronome each time you get hit by the same attack user adapts to the attack I mainly wanted to use this as defense against skill link pokemon.
     
    I got it to work using this

    # Charge up Adaptation Ability
    if user.lastMoveUsed==thismove.id
    user.effects[PBEffects::Adaptation]+=1
    else
    user.effects[PBEffects::Adaptation]=0
    end

    instead of this

    # Boost Adaptation
    if user.hasWorkingAbility(:ADAPTATION) && target.lastMoveUsed==thismove.id && !target.hasWorkingAbility(:MOLDBREAKER)
    user.effects[PBEffects::Adaptation]+=1
    else
    user.effects[PBEffects::Adaptation]=0
    end

    but it only seems to work after the third hit like I know its not gonna work the first hit right because the first hit it as at +0 conditioning but the second hit does nothing and then the third hit acts as the 2nd hit and so on It's something really small but now that I got the ability sorta working could someone help me figure it out this tiny problem.
     
    Back
    Top