Files
Narishma-gb e88fe24e15 Use the same Makefile build system as Gen 1+2 repos (#163)
This uses catch-all files like main.asm to reduce the total quantity and size of
build objects (from 1.1 GB to 70 MB).

---------

Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
2026-07-05 15:36:09 -04:00

50 lines
587 B
NASM

BattleCommand_Present:
ld a, [wAttackMissed]
and a
ret nz
push bc
call BattleRandom
ld b, a
ld hl, PresentPower
ld c, 0
.next
ld a, [hli]
cp -1
jr z, .heal_effect
cp b
jr nc, .got_power
inc c
inc hl
jr .next
.got_power
xor a
ld [wBattleAnimParam], a
call LoadMoveAnim
ld d, [hl]
pop bc
ret
.heal_effect
pop bc
ld a, 1
ld [wBattleAnimParam], a
call LoadMoveAnim
ldh a, [hBattleTurn]
push af
xor 1
ldh [hBattleTurn], a
callfar GetQuarterMaxHP
pop af
ldh [hBattleTurn], a
callfar RestoreHP
jp EndMoveEffect
INCLUDE "data/moves/present_power.asm"