mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-22 07:02:17 +13:00
Add subdirectories to engine/ similar to pokecrystal
This commit is contained in:
parent
5559d51c86
commit
f275790aec
124 changed files with 342 additions and 346 deletions
82
engine/events/give_pokemon.asm
Executable file
82
engine/events/give_pokemon.asm
Executable file
|
|
@ -0,0 +1,82 @@
|
|||
_GivePokemon::
|
||||
; returns success in carry
|
||||
; and whether the mon was added to the party in [wAddedToParty]
|
||||
call EnableAutoTextBoxDrawing
|
||||
xor a
|
||||
ld [wAddedToParty], a
|
||||
ld a, [wPartyCount]
|
||||
cp PARTY_LENGTH
|
||||
jr c, .addToParty
|
||||
ld a, [wNumInBox]
|
||||
cp MONS_PER_BOX
|
||||
jr nc, .boxFull
|
||||
; add to box
|
||||
xor a
|
||||
ld [wEnemyBattleStatus3], a
|
||||
ld a, [wcf91]
|
||||
ld [wEnemyMonSpecies2], a
|
||||
callab LoadEnemyMonData
|
||||
call SetPokedexOwnedFlag
|
||||
callab SendNewMonToBox
|
||||
ld hl, wcf4b
|
||||
ld a, [wCurrentBoxNum]
|
||||
and $7f
|
||||
cp 9
|
||||
jr c, .singleDigitBoxNum
|
||||
sub 9
|
||||
ld [hl], "1"
|
||||
inc hl
|
||||
add "0"
|
||||
jr .next
|
||||
.singleDigitBoxNum
|
||||
add "1"
|
||||
.next
|
||||
ld [hli], a
|
||||
ld [hl], "@"
|
||||
ld hl, SentToBoxText
|
||||
call PrintText
|
||||
scf
|
||||
ret
|
||||
.boxFull
|
||||
ld hl, BoxIsFullText
|
||||
call PrintText
|
||||
and a
|
||||
ret
|
||||
.addToParty
|
||||
call SetPokedexOwnedFlag
|
||||
call AddPartyMon
|
||||
ld a, 1
|
||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||
ld [wAddedToParty], a
|
||||
scf
|
||||
ret
|
||||
|
||||
SetPokedexOwnedFlag:
|
||||
ld a, [wcf91]
|
||||
push af
|
||||
ld [wd11e], a
|
||||
predef IndexToPokedex
|
||||
ld a, [wd11e]
|
||||
dec a
|
||||
ld c, a
|
||||
ld hl, wPokedexOwned
|
||||
ld b, FLAG_SET
|
||||
predef FlagActionPredef
|
||||
pop af
|
||||
ld [wd11e], a
|
||||
call GetMonName
|
||||
ld hl, GotMonText
|
||||
jp PrintText
|
||||
|
||||
GotMonText:
|
||||
TX_FAR _GotMonText
|
||||
TX_SFX_ITEM_1
|
||||
db "@"
|
||||
|
||||
SentToBoxText:
|
||||
TX_FAR _SentToBoxText
|
||||
db "@"
|
||||
|
||||
BoxIsFullText:
|
||||
TX_FAR _BoxIsFullText
|
||||
db "@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue