2015-11-19 15:07:20 -08:00
|
|
|
; These functions seem to be related to backwards compatibility
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
ValidateOTTrademon:
|
2020-10-29 11:45:40 -07:00
|
|
|
ld a, [wCurOTTradePartyMon]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMon1Species
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
push hl
|
2020-10-29 11:45:40 -07:00
|
|
|
ld a, [wCurOTTradePartyMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyCount
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
pop hl
|
|
|
|
cp EGG
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .matching_or_egg
|
2015-11-19 15:07:20 -08:00
|
|
|
cp [hl]
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .abnormal
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.matching_or_egg
|
2015-11-19 15:07:20 -08:00
|
|
|
ld b, h
|
|
|
|
ld c, l
|
|
|
|
ld hl, MON_LEVEL
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-21 11:10:16 -08:00
|
|
|
cp MAX_LEVEL + 1
|
|
|
|
jr nc, .abnormal
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [wLinkMode]
|
|
|
|
cp LINK_TIMECAPSULE
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .normal
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartySpecies
|
2020-10-29 11:45:40 -07:00
|
|
|
ld a, [wCurOTTradePartyMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
|
|
|
|
; Magnemite and Magneton's types changed
|
|
|
|
; from Electric to Electric/Steel.
|
|
|
|
cp MAGNEMITE
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .normal
|
2015-11-19 15:07:20 -08:00
|
|
|
cp MAGNETON
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .normal
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurSpecies], a
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetBaseData
|
2015-12-21 11:10:16 -08:00
|
|
|
ld hl, wLinkOTPartyMonTypes
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, bc
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, bc
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBaseType1]
|
2015-11-19 15:07:20 -08:00
|
|
|
cp [hl]
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .abnormal
|
2015-11-19 15:07:20 -08:00
|
|
|
inc hl
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBaseType2]
|
2015-11-19 15:07:20 -08:00
|
|
|
cp [hl]
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .abnormal
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.normal
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.abnormal
|
2015-11-19 15:07:20 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2020-10-04 16:43:28 -07:00
|
|
|
CheckAnyOtherAliveMonsForTrade:
|
2020-10-29 11:45:40 -07:00
|
|
|
ld a, [wCurTradePartyMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
ld d, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-11-19 15:07:20 -08:00
|
|
|
ld b, a
|
2020-10-29 11:45:40 -07:00
|
|
|
ld c, 0
|
2015-12-21 11:10:16 -08:00
|
|
|
.loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, c
|
|
|
|
cp d
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .next
|
2015-11-19 15:07:20 -08:00
|
|
|
push bc
|
|
|
|
ld a, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1HP
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
pop bc
|
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.next
|
2015-11-19 15:07:20 -08:00
|
|
|
inc c
|
|
|
|
dec b
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .loop
|
2020-10-29 11:45:40 -07:00
|
|
|
ld a, [wCurOTTradePartyMon]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMon1HP
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .done
|
2015-11-19 15:07:20 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.done
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PlaceTradePartnerNamesAndParty:
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 4, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wPlayerName
|
2015-11-19 15:07:20 -08:00
|
|
|
call PlaceString
|
|
|
|
ld a, $14
|
|
|
|
ld [bc], a
|
|
|
|
hlcoord 4, 8
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTPlayerName
|
2015-11-19 15:07:20 -08:00
|
|
|
call PlaceString
|
|
|
|
ld a, $14
|
|
|
|
ld [bc], a
|
|
|
|
hlcoord 7, 1
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wPartySpecies
|
2015-12-21 11:10:16 -08:00
|
|
|
call .PlaceSpeciesNames
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 7, 9
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTPartySpecies
|
2018-06-24 07:09:41 -07:00
|
|
|
.PlaceSpeciesNames:
|
2020-06-17 07:39:17 -07:00
|
|
|
ld c, 0
|
2015-12-21 11:10:16 -08:00
|
|
|
.loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
2015-12-21 11:10:16 -08:00
|
|
|
cp -1
|
2015-11-19 15:07:20 -08:00
|
|
|
ret z
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wNamedObjectIndex], a
|
2015-11-19 15:07:20 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
ld a, c
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hProduct], a
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetPokemonName
|
|
|
|
pop hl
|
|
|
|
call PlaceString
|
|
|
|
pop de
|
|
|
|
inc de
|
|
|
|
pop hl
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
inc c
|
2015-12-21 11:10:16 -08:00
|
|
|
jr .loop
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2018-01-22 14:33:52 -08:00
|
|
|
INCLUDE "data/pokemon/gen1_base_special.asm"
|