mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-10-04 15:18:22 -04:00
e88fe24e15
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>
50 lines
587 B
NASM
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"
|