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

Need help making a custom move (OHKO Last Resort)

Arkadious

Developer of Fragmentum
  • 50
    Posts
    9
    Years
    Hello, I'm rather new to the Pokemon coding scene and a little stuck with making a custom move for a friend. I was wondering if anyone would be able to help me out?

    I understand that in the Moves.txt that the custom move needs to be set to 133 or greater like so:
    639,ANNIHILATINGFIRE,Annihilating Fire,163,1,QMARKS,Special,0,1,0,08,2,,This move can be used only after the user has used all the other moves it knows in the battle.

    That was the move are trying to make. It's a one-hit KO that can only be used after all other moves have been used at least once and damages all Pokemon around it (including allies) using 1pp with infinite accuracy. We planned on having it in a really hard spot, being taught by a move tutor who'd teach to one Pokemon and one Pokemon only before disppearing.

    The problem is that its able to be used currently without using all other moves and only does 1 damage.

    This is the code atm:
    class PokemonBattle_Move_163 < PokeBattle_Move
    def pbMoveFailed(attacker,opponent)
    counter=0; nummoves=0
    for move in attacker.moves
    next if move.id<=0
    counter+=1 if move.id!=@id && !attacker.movesUsed.include?(move.id)
    nummoves+=1
    end
    return counter!=0 || nummoves==1
    end

    def pbAccuracyCheck(attacker,opponent)
    return true
    if opponent.hasWorkingAbility(:STURDY) && !attacker.hasBypassingAbility
    @battle.pbDisplayEffect(opponent)
    @battle.pbDisplay(_INTL("{1} was protected by {2}!",opponent.pbThis,PBAbilities.getName(opponent.ability)))
    return false
    end
    if opponent.level>attacker.level
    @battle.pbDisplay(_INTL("{1} is unaffected!",opponent.pbThis))
    return false
    end
    acc=@accuracy+attacker.level-opponent.level
    return @battle.pbRandom(100)<acc
    end

    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    damage=pbEffectFixedDamage(opponent.totalhp,attacker,opponent,hitnum,alltargets,showanimation)
    if opponent.isFainted?
    @battle.pbDisplay(_INTL("It's a one-hit KO!"))
    end
    return damage
    end
    end

    Thanks.
     
    Last edited:
    After some research I have found that your code should be written as such:
    [S-HIGHLIGHT]639,ANNIHILATINGFIRE,Annihilating Fire,070 or 125,1,FIRE,Special,0,1,0,08,2,,"[InsertNewDescription]"[/S-HIGHLIGHT]
    Unfortunately, One-hit KO moves and Last Resort type moves are in separate function codes, meaning that you cannot combine the two effects. So you have to choose between 070 (One-hit KO) or 125 (Last Resort).
    -Pooka
     
    I am kinda new to this all, so thanks for the responces. :)

    I tried playing around with the script and it turned into a Protect move somehow (which I don't really understand). Any suggestions as to what I should change?
     
    Back
    Top