mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-02-22 07:22:15 +13:00
First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
This commit is contained in:
commit
2f8a41f833
4618 changed files with 480386 additions and 0 deletions
57
engine/battle/consume_held_item.asm
Normal file
57
engine/battle/consume_held_item.asm
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
ConsumeHeldItem:
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld hl, wOTPartyMon1Item
|
||||
ld de, wEnemyMonItem
|
||||
ld a, [wCurOTMon]
|
||||
jr z, .theirturn
|
||||
ld hl, wPartyMon1Item
|
||||
ld de, wBattleMonItem
|
||||
ld a, [wCurBattleMon]
|
||||
|
||||
.theirturn
|
||||
push hl
|
||||
push af
|
||||
ld a, [de]
|
||||
ld b, a
|
||||
farcall GetItemHeldEffect
|
||||
ld hl, ConsumableEffects
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr z, .ok
|
||||
inc a
|
||||
jr nz, .loop
|
||||
pop af
|
||||
pop hl
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
.ok
|
||||
xor a
|
||||
ld [de], a
|
||||
pop af
|
||||
pop hl
|
||||
call GetPartyLocation
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr nz, .ourturn
|
||||
ld a, [wBattleMode]
|
||||
dec a
|
||||
jr z, .done
|
||||
|
||||
.ourturn
|
||||
ld [hl], NO_ITEM
|
||||
|
||||
.done
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
INCLUDE "data/battle/held_consumables.asm"
|
||||
Loading…
Add table
Add a link
Reference in a new issue