• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

Pokecrystal dissassembly, updating the move Jump Kick

  • 10
    Posts
    148
    Days
    • Seen May 7, 2025
    Hello, I recently started getting into trying to figure out the assembly code for crystal, and in crystal the following code is used:

    .got_text
    call FailText_CheckOpponentProtect
    xor a
    ld [wCriticalHit], a

    ld a, BATTLE_VARS_MOVE_EFFECT
    call GetBattleVar
    cp EFFECT_JUMP_KICK
    ret nz

    ld a, [wTypeModifier]
    and EFFECTIVENESS_MASK
    ret z

    ld hl, wCurDamage
    ld a, [hli]
    ld b, [hl]
    rept 3
    srl a
    rr b
    endr
    ld [hl], b
    dec hl
    ld [hli], a
    or b
    jr nz, .do_at_least_1_damage
    inc a
    ld [hl], a
    .do_at_least_1_damage
    ld hl, CrashedText
    call StdBattleTextbox
    ld a, $1
    ld [wBattleAnimParam], a
    call LoadMoveAnim
    ld c, TRUE
    ldh a, [hBattleTurn]
    and a
    jp nz, DoEnemyDamage
    jp DoPlayerDamage

    How can I change this so that instead of using the wCurDamage and then dividing it by 1/8th it takes the user or enemy's max hp and then subtracts from the total when missing? I have tried calling different functions like GetHalfMaxHP and such but it never really works out when testing. If anyone knows what needs to be changed it would be of great help
     
    Back
    Top