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

[Question] Dark Focus & Justice Bark

  • 29
    Posts
    7
    Years
    • Seen Feb 8, 2024
    Hi everybody,

    So I've been feeling creative lately and want help with coding a move called Dark Focus that has the effect of Focus Energy but when the target is hit with a Critical Hit, the user's Attack goes up.

    Also need any advice on coding a move called Justice Bark that scans the target for Dark-type moves and does double damage if one is found.

    How do you think I should go about this?
     
    Here's what I got so far, but not sure if it's working since I'm getting no "Attack went up" prompts.

    ################################################################################
    # Increases the user's critical hit rate. Raises Attack 1 Stage when it happens (Dark Focus)
    ################################################################################
    class PokeBattle_Move_190 < PokeBattle_Move
    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
    if attacker.effects[PBEffects::FocusEnergy]>=2
    @battle.pbDisplay(_INTL("But it failed!"))
    return -1
    end
    pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
    attacker.effects[PBEffects::FocusEnergy]=2
    @battle.pbDisplay(_INTL("{1} is getting EXTRA pumped!",attacker.pbThis))
    return 0
    end

    def pbAdditionalEffect(attacker,opponent)
    if attacker.effects[PBEffects::FocusEnergy]<2
    attacker.effects[PBEffects::FocusEnergy]=2
    @battle.pbDisplay(_INTL("{1} is getting EXTRA pumped!",attacker.pbThis))
    end

    def pbAdditionalEffect(attacker,opponent)
    if opponent.damagestate.critical
    return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
    return -1 if !attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,true,self)
    pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
    ret=attacker.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self)
    return ret ? 0 : -1
    end
    end
    end
    end
     
    Back
    Top