ItemIsMail and comment thief move effect

This commit is contained in:
yenatch 2013-09-08 23:18:30 -04:00
parent bd7563e0b6
commit 9f7adeafcf
2 changed files with 72 additions and 30 deletions

View File

@ -9328,72 +9328,102 @@ BattleCommand50: ; 37492
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr nz, .asm_374ce ; 37495 $37 jr nz, .enemy
call .asm_37501
; The player needs to be able to steal an item.
call .playeritem
ld a, [hl] ld a, [hl]
and a and a
ret nz ret nz
call .asm_3750c
; The enemy needs to have an item to steal.
call .enemyitem
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
; Can't steal mail.
ld [$d265], a ld [$d265], a
ld d, a ld d, a
ld a, $2e callba ItemIsMail
ld hl, $5e76
rst FarCall
ret c ret c
ld a, [EffectFailed] ld a, [EffectFailed]
and a and a
ret nz ret nz
ld a, [InLinkBattle] ld a, [InLinkBattle]
and a and a
jr z, .asm_374be ; 374b7 $5 jr z, .stealenemyitem
ld a, [IsInBattle] ld a, [IsInBattle]
dec a dec a
ret z ret z
.asm_374be
call .asm_3750c .stealenemyitem
call .enemyitem
xor a xor a
ld [hl], a ld [hl], a
ld [de], a ld [de], a
call .asm_37501
call .playeritem
ld a, [$d265] ld a, [$d265]
ld [hl], a ld [hl], a
ld [de], a ld [de], a
jr .asm_374f8 ; 374cc $2a jr .stole
.asm_374ce
call .asm_3750c
.enemy
; The enemy can't already have an item.
call .enemyitem
ld a, [hl] ld a, [hl]
and a and a
ret nz ret nz
call .asm_37501
; The player must have an item to steal.
call .playeritem
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
; Can't steal mail!
ld [$d265], a ld [$d265], a
ld d, a ld d, a
ld a, $2e callba ItemIsMail
ld hl, $5e76
rst FarCall
ret c ret c
ld a, [EffectFailed] ld a, [EffectFailed]
and a and a
ret nz ret nz
call .asm_37501
; If the enemy steals your item,
; it's gone for good if you don't get it back.
call .playeritem
xor a xor a
ld [hl], a ld [hl], a
ld [de], a ld [de], a
call .asm_3750c
call .enemyitem
ld a, [$d265] ld a, [$d265]
ld [hl], a ld [hl], a
ld [de], a ld [de], a
.asm_374f8
.stole
call GetItemName call GetItemName
ld hl, StoleText ld hl, StoleText
jp StdBattleTextBox jp StdBattleTextBox
.asm_37501
.playeritem
ld a, 1 ld a, 1
call BattlePartyAttr call BattlePartyAttr
ld d, h ld d, h
@ -9401,9 +9431,9 @@ BattleCommand50: ; 37492
ld hl, BattleMonItem ld hl, BattleMonItem
ret ret
.asm_3750c .enemyitem
ld a, 1 ld a, 1
call $396d ; GetOTStat_Battle call OTPartyAttr
ld d, h ld d, h
ld e, l ld e, l
ld hl, EnemyMonItem ld hl, EnemyMonItem

View File

@ -29816,7 +29816,7 @@ Function16798: ; 16798
ld a, [CurPartyMon] ld a, [CurPartyMon]
call AddNTimes call AddNTimes
ld d, [hl] ld d, [hl]
callba Functionb9e76 callba ItemIsMail
jr c, .asm_167ed jr c, .asm_167ed
ld hl, PartyMon1Nickname ld hl, PartyMon1Nickname
ld a, [CurPartyMon] ld a, [CurPartyMon]
@ -32931,7 +32931,7 @@ Function24dd4: ; 24dd4
ld a, $1 ld a, $1
call GetPartyParamLocation call GetPartyParamLocation
ld d, [hl] ld d, [hl]
callba Functionb9e76 callba ItemIsMail
pop hl pop hl
ld a, $14 ld a, $14
jr c, .asm_24e2c jr c, .asm_24e2c
@ -36226,7 +36226,7 @@ Function29bfb: ; 29bfb
push hl push hl
push bc push bc
ld d, [hl] ld d, [hl]
callba Functionb9e76 callba ItemIsMail
pop bc pop bc
pop hl pop hl
jr c, .asm_29c5e jr c, .asm_29c5e
@ -70346,14 +70346,26 @@ Functionb92b8: ; b92b8
INCBIN "baserom.gbc", $b92f7, $b9e76 - $b92f7 INCBIN "baserom.gbc", $b92f7, $b9e76 - $b92f7
Functionb9e76: ; b9e76 ItemIsMail: ; b9e76
ld a, d ld a, d
ld hl, $5e80 ld hl, .items
ld de, $0001 ld de, 1
jp IsInArray jp IsInArray
; b9e80 ; b9e80
INCBIN "baserom.gbc", $b9e80, $b9e8b - $b9e80 .items
db FLOWER_MAIL
db SURF_MAIL
db LITEBLUEMAIL
db PORTRAITMAIL
db LOVELY_MAIL
db EON_MAIL
db MORPH_MAIL
db BLUESKY_MAIL
db MUSIC_MAIL
db MIRAGE_MAIL
db $ff
; b9e8b
SECTION "bank2F",ROMX,BANK[$2F] SECTION "bank2F",ROMX,BANK[$2F]