LostBattle and HalveMoney

This commit is contained in:
yenatch 2013-06-17 18:19:45 -04:00
parent a4235e11bf
commit 869de91bd5
4 changed files with 142 additions and 4 deletions

View File

@ -40,6 +40,7 @@ TRAINER_BATTLE EQU 2
; battle types
BATTLETYPE_NORMAL EQU $00
BATTLETYPE_CANLOSE EQU $01
BATTLETYPE_TUTORIAL EQU $03
BATTLETYPE_FISH EQU $04
BATTLETYPE_ROAMING EQU $05

136
main.asm
View File

@ -6983,7 +6983,34 @@ BoxNameInputUpper:
db "- ? ! ♂ ♀ / . , &"
db "lower DEL END "
INCBIN "baserom.gbc", $11e5d, $125cd - $11e5d
INCBIN "baserom.gbc", $11e5d, $12513 - $11e5d
HalveMoney: ; 12513
; Empty function...
ld a, $41
ld hl, $60c7
rst FarCall
; Halve the player's money.
ld hl, Money
ld a, [hl]
srl a
ld [hli], a
ld a, [hl]
rra
ld [hli], a
ld a, [hl]
rra
ld [hl], a
ret
; 12527
INCBIN "baserom.gbc", $12527, $125cd - $12527
OpenMenu: ; 0x125cd
call $1fbf
@ -9383,7 +9410,112 @@ KantoGymLeaders:
db BLUE
db $ff
INCBIN "baserom.gbc", $3d14e, $3ddc2 - $3d14e
INCBIN "baserom.gbc", $3d14e, $3d38e - $3d14e
LostBattle: ; 3d38e
ld a, 1
ld [BattleEnded], a
ld a, [$cfc0]
bit 0, a
jr nz, .asm_3d3bd
ld a, [BattleType]
cp BATTLETYPE_CANLOSE
jr nz, .asm_3d3e3
; Remove the enemy from the screen.
hlcoord 0, 0
ld bc, $0815
call ClearBox
call $6bd8
ld c, 40
call DelayFrames
ld a, [$c2cc]
bit 0, a
jr nz, .asm_3d3bc
call $3718
.asm_3d3bc
ret
.asm_3d3bd
; Remove the enemy from the screen.
hlcoord 0, 0
ld bc, $0815
call ClearBox
call $6bd8
ld c, 40
call DelayFrames
call $6dd1
ld c, 2
ld a, $47
ld hl, $4000
rst FarCall
call $0a80
call ClearTileMap
call WhiteBGMap
ret
.asm_3d3e3
ld a, [InLinkBattle]
and a
jr nz, .LostLinkBattle
; Greyscale
ld b, 0
call GetSGBLayout
call $32f9
jr .end
.LostLinkBattle
call UpdateEnemyMonInParty
call $4f35
jr nz, .asm_3d40a
ld hl, TiedAgainstText
ld a, [$d0ee]
and $c0
add 2
ld [$d0ee], a
jr .asm_3d412
.asm_3d40a
ld hl, LostAgainstText
call $52f1
jr z, .asm_3d417
.asm_3d412
call FarBattleTextBox
.end
scf
ret
.asm_3d417
; Remove the enemy from the screen.
hlcoord 0, 0
ld bc, $0815
call ClearBox
call $6bd8
ld c, 40
call DelayFrames
ld c, $3
ld a, $13
ld hl, $6a0a
rst FarCall
scf
ret
; 3d432
INCBIN "baserom.gbc", $3d432, $3ddc2 - $3d432
ld hl, RecoveredUsingText
jp $3ad5

View File

@ -176,7 +176,7 @@ BattleText_0x809da: ; 0x809da
db "was defeated!", $58
; 0x809eb
BattleText_0x809eb: ; 0x809eb
TiedAgainstText: ; 0x809eb
db $0, "Tied against", $4f
db $3f, "!", $58
; 0x809fc
@ -219,7 +219,7 @@ BattleText_0x80a93: ; 0x80a93
db "good #MON!", $58
; 0x80ab9
BattleText_0x80ab9: ; 0x80ab9
LostAgainstText: ; 0x80ab9
db $0, "Lost against", $4f
db $3f, "!", $58
; 0x80aca

View File

@ -778,6 +778,11 @@ LastEnemyMove: ; c71c
ds 1
SECTION "battle",BSS[$c734]
BattleEnded: ; c734
ds 1
SECTION "overworldmap",BSS[$c800]
OverworldMap: ; c800
ds 1300