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

Need help making a custom move (OHKO Last Resort)

Arkadious

Developer of Fragmentum
50
Posts
8
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:

    Pookachurin

    Pooka The Pikachu
    18
    Posts
    8
    Years
  • 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
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    ...Or you can make a new function code which combines the two effects, as Arkadious is doing. Reading is a good thing.
     

    Arkadious

    Developer of Fragmentum
    50
    Posts
    8
    Years
  • 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