2016-06-12 00:24:04 +00:00
|
|
|
EndOfBattle:
|
2015-04-01 09:23:27 +00:00
|
|
|
ld a, [wLinkState]
|
|
|
|
cp LINK_STATE_BATTLING
|
|
|
|
jr nz, .notLinkBattle
|
|
|
|
; link battle
|
|
|
|
ld a, [wEnemyMonPartyPos]
|
|
|
|
ld hl, wEnemyMon1Status
|
|
|
|
ld bc, wEnemyMon2 - wEnemyMon1
|
|
|
|
call AddNTimes
|
|
|
|
ld a, [wEnemyMonStatus]
|
|
|
|
ld [hl], a
|
|
|
|
call ClearScreen
|
|
|
|
callab DisplayLinkBattleVersusTextBox
|
|
|
|
ld a, [wBattleResult]
|
|
|
|
cp $1
|
|
|
|
ld de, YouWinText
|
|
|
|
jr c, .placeWinOrLoseString
|
|
|
|
ld de, YouLoseText
|
|
|
|
jr z, .placeWinOrLoseString
|
|
|
|
ld de, DrawText
|
|
|
|
.placeWinOrLoseString
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 6, 8
|
2015-04-01 09:23:27 +00:00
|
|
|
call PlaceString
|
2015-07-03 19:37:53 +00:00
|
|
|
ld c, 200
|
2015-04-01 09:23:27 +00:00
|
|
|
call DelayFrames
|
|
|
|
jr .evolution
|
|
|
|
.notLinkBattle
|
|
|
|
ld a, [wBattleResult]
|
|
|
|
and a
|
|
|
|
jr nz, .resetVariables
|
|
|
|
ld hl, wTotalPayDayMoney
|
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
|
|
|
inc hl
|
|
|
|
or [hl]
|
|
|
|
jr z, .evolution ; if pay day money is 0, jump
|
|
|
|
ld de, wPlayerMoney + 2
|
|
|
|
ld c, $3
|
|
|
|
predef AddBCDPredef
|
|
|
|
ld hl, PickUpPayDayMoneyText
|
|
|
|
call PrintText
|
|
|
|
.evolution
|
|
|
|
xor a
|
2015-07-14 08:46:23 +00:00
|
|
|
ld [wForceEvolution], a
|
2015-04-01 09:23:27 +00:00
|
|
|
predef EvolutionAfterBattle
|
|
|
|
.resetVariables
|
|
|
|
xor a
|
|
|
|
ld [wLowHealthAlarm], a ;disable low health alarm
|
2019-07-28 04:21:39 +00:00
|
|
|
ld [wChannelSoundIDs + Ch5], a
|
2015-08-31 02:38:41 +00:00
|
|
|
ld [wIsInBattle], a
|
|
|
|
ld [wBattleType], a
|
|
|
|
ld [wMoveMissed], a
|
|
|
|
ld [wCurOpponent], a
|
2015-07-25 03:27:59 +00:00
|
|
|
ld [wForcePlayerToChooseMon], a
|
2015-04-01 09:23:27 +00:00
|
|
|
ld [wNumRunAttempts], a
|
|
|
|
ld [wEscapedFromBattle], a
|
2015-07-16 03:04:58 +00:00
|
|
|
ld hl, wPartyAndBillsPCSavedMenuItem
|
2015-04-01 09:23:27 +00:00
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
ld [wListScrollOffset], a
|
|
|
|
ld hl, wPlayerStatsToDouble
|
|
|
|
ld b, $18
|
|
|
|
.loop
|
|
|
|
ld [hli], a
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
ld hl, wd72c
|
|
|
|
set 0, [hl]
|
|
|
|
call WaitForSoundToFinish
|
|
|
|
call GBPalWhiteOut
|
|
|
|
ld a, $ff
|
|
|
|
ld [wDestinationWarpID], a
|
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
YouWinText:
|
2015-04-01 09:23:27 +00:00
|
|
|
db "YOU WIN@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
YouLoseText:
|
2015-04-01 09:23:27 +00:00
|
|
|
db "YOU LOSE@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
DrawText:
|
2015-04-01 09:23:27 +00:00
|
|
|
db " DRAW@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
PickUpPayDayMoneyText:
|
2015-04-01 09:23:27 +00:00
|
|
|
TX_FAR _PickUpPayDayMoneyText
|
2015-06-02 03:15:02 +00:00
|
|
|
db "@"
|