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

[Pokered] [Solved] Need help implementing Triple Kick

  • 12
    Posts
    253
    Days
    • Seen Apr 23, 2025
    Hi! I'm working on my ROM hack of Pokemon Red/Blue based on Pret's disassembly project.

    I am implementing new moves, bringing the total of existing moves to 255.
    Of the moves I am implementing, I am running into issues while adding Triple Kick, the signature move of Hitmontop.

    When adding the move to the game, I am not able to get the effect to work properly. Normally, the move should hit three times, guaranteed, when the move makes contact, but whenever I implement it, the move only occasionally hits 3 times, the rest of the time, the move hits only once, and I am not sure why this is.

    I added the new move by creating a new move effect, TRIPLE_KICK_EFFECT, which uses the TwoToFiveAttacksEffect pointer, and modifying the effect in engine/battle/effects.asm

    In TwoToFiveAttacksEffect:
    ...
    ld a, [hl]
    cp TWINEEDLE_EFFECT
    jr z, .twineedle
    cp ATTACK_TWICE_EFFECT
    ld a, $2 ; number of hits is always 2 for ATTACK_TWICE_EFFECT
    jr z, .saveNumberOfHits
    cp TRIPLE_KICK_EFFECT
    ld a, $3
    jr z, .saveNumberOfHits
    ...

    This on its own doesn't work, due to the way that wPlayerNumAttacksLeft is handled in engine/battle/core.asm

    Does any one with a better understanding of these functions know how I could implement the move?
     
    While I'm new to this as well, here's what I would try based on what I've found looking at Twineedle and Double Kick:

    In include\constants\battle_move_effects.h add #define EFFECT_TRIPLE_HIT 214. Then, in data\battle_scripts_1.s, find gBattleScriptsForMoveEffects:: and add
    .4byte BattleScript_EffectTripleHit @ EFFECT_TRIPLE_HIT. Finally, based on the double hit code, add this:
    C-like:
    BattleScript_EffectTripleHit::
        attackcanceler
        accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
        attackstring
        ppreduce
        setmultihitcounter 3
        initmultihitstring
        setbyte sMULTIHIT_EFFECT, 0
        goto BattleScript_MultiHitLoop
    I could be way off with this, so sorry if it doesn't help.
     
    While I'm new to this as well, here's what I would try based on what I've found looking at Twineedle and Double Kick:

    In include\constants\battle_move_effects.h add #define EFFECT_TRIPLE_HIT 214. Then, in data\battle_scripts_1.s, find gBattleScriptsForMoveEffects:: and add
    .4byte BattleScript_EffectTripleHit @ EFFECT_TRIPLE_HIT. Finally, based on the double hit code, add this:
    C-like:
    BattleScript_EffectTripleHit::
        attackcanceler
        accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
        attackstring
        ppreduce
        setmultihitcounter 3
        initmultihitstring
        setbyte sMULTIHIT_EFFECT, 0
        goto BattleScript_MultiHitLoop
    I could be way off with this, so sorry if it doesn't help.
    Your code is clearly meant to be used in Pokeruby, Pokefirered and Pokeemerald projects. CecilleTheMoon is using Pokered.
     
    Hi! I'm working on my ROM hack of Pokemon Red/Blue based on Pret's disassembly project.

    I am implementing new moves, bringing the total of existing moves to 255.
    Of the moves I am implementing, I am running into issues while adding Triple Kick, the signature move of Hitmontop.

    When adding the move to the game, I am not able to get the effect to work properly. Normally, the move should hit three times, guaranteed, when the move makes contact, but whenever I implement it, the move only occasionally hits 3 times, the rest of the time, the move hits only once, and I am not sure why this is.

    I added the new move by creating a new move effect, TRIPLE_KICK_EFFECT, which uses the TwoToFiveAttacksEffect pointer, and modifying the effect in engine/battle/effects.asm

    In TwoToFiveAttacksEffect:
    ...
    ld a, [hl]
    cp TWINEEDLE_EFFECT
    jr z, .twineedle
    cp ATTACK_TWICE_EFFECT
    ld a, $2 ; number of hits is always 2 for ATTACK_TWICE_EFFECT
    jr z, .saveNumberOfHits
    cp TRIPLE_KICK_EFFECT
    ld a, $3
    jr z, .saveNumberOfHits
    ...

    This on its own doesn't work, due to the way that wPlayerNumAttacksLeft is handled in engine/battle/core.asm

    Does any one with a better understanding of these functions know how I could implement the move?
    Your code is currently comparing TRIPLE_KICK_EFFECT to 2, which is probably not what you want.
    Try changing it to:
    Diff:
    ld a, [hl]
    cp TWINEEDLE_EFFECT
    jr z, .twineedle
    cp ATTACK_TWICE_EFFECT
    ld a, $2 ; number of hits is always 2 for ATTACK_TWICE_EFFECT
    jr z, .saveNumberOfHits
    +ld a, [hl]
    cp TRIPLE_KICK_EFFECT
    ld a, $3
    jr z, .saveNumberOfHits
     
    Your code is currently comparing TRIPLE_KICK_EFFECT to 2, which is probably not what you want.
    Try changing it to:
    Diff:
    ld a, [hl]
    cp TWINEEDLE_EFFECT
    jr z, .twineedle
    cp ATTACK_TWICE_EFFECT
    ld a, $2 ; number of hits is always 2 for ATTACK_TWICE_EFFECT
    jr z, .saveNumberOfHits
    +ld a, [hl]
    cp TRIPLE_KICK_EFFECT
    ld a, $3
    jr z, .saveNumberOfHits
    OMG! I can't believe I missed that! Yes, that was absolutely it! How silly! Thank you so much, that took care of it.
     
    Back
    Top