pokered/scripts/MtMoonPokecenter.asm

95 lines
1.6 KiB
NASM
Raw Normal View History

MtMoonPokecenter_Script:
2015-02-07 10:43:08 +00:00
call Serial_TryEstablishingExternallyClockedConnection
2014-05-18 18:19:10 +00:00
jp EnableAutoTextBoxDrawing
MtMoonPokecenter_TextPointers:
dw MtMoonHealNurseText
2014-05-18 18:19:10 +00:00
dw MtMoonPokecenterText2
dw MtMoonPokecenterText3
dw MagikarpSalesmanText
2014-05-18 18:19:10 +00:00
dw MtMoonPokecenterText5
dw MtMoonTradeNurseText
2014-05-18 18:19:10 +00:00
MtMoonHealNurseText:
script_pokecenter_nurse
2014-05-18 18:19:10 +00:00
MtMoonPokecenterText2:
text_far _MtMoonPokecenterText1
text_end
2014-05-18 18:19:10 +00:00
MtMoonPokecenterText3:
text_far _MtMoonPokecenterText3
text_end
2014-05-18 18:19:10 +00:00
MagikarpSalesmanText:
text_asm
2015-07-21 01:32:02 +00:00
CheckEvent EVENT_BOUGHT_MAGIKARP, 1
2015-07-19 03:49:52 +00:00
jp c, .alreadyBoughtMagikarp
ld hl, .Text1
2014-05-18 18:19:10 +00:00
call PrintText
2015-07-19 03:49:52 +00:00
ld a, MONEY_BOX
2015-02-07 10:43:08 +00:00
ld [wTextBoxID], a
2014-05-18 18:19:10 +00:00
call DisplayTextBoxID
call YesNoChoice
ld a, [wCurrentMenuItem]
2014-05-18 18:19:10 +00:00
and a
2015-07-19 03:49:52 +00:00
jp nz, .choseNo
ldh [hMoney], a
ldh [hMoney + 2], a
2014-05-18 18:19:10 +00:00
ld a, $5
ldh [hMoney + 1], a
2014-05-18 18:19:10 +00:00
call HasEnoughMoney
2015-07-19 03:49:52 +00:00
jr nc, .enoughMoney
ld hl, .NoMoneyText
2015-07-19 03:49:52 +00:00
jr .printText
.enoughMoney
2015-08-05 21:20:29 +00:00
lb bc, MAGIKARP, 5
2014-05-18 18:19:10 +00:00
call GivePokemon
2015-07-19 03:49:52 +00:00
jr nc, .done
2014-05-18 18:19:10 +00:00
xor a
2015-07-19 03:49:52 +00:00
ld [wPriceTemp], a
ld [wPriceTemp + 2], a
2014-05-18 18:19:10 +00:00
ld a, $5
2015-07-19 03:49:52 +00:00
ld [wPriceTemp + 1], a
ld hl, wPriceTemp + 2
ld de, wPlayerMoney + 2
2014-05-18 18:19:10 +00:00
ld c, $3
predef SubBCDPredef
2015-07-19 03:49:52 +00:00
ld a, MONEY_BOX
2015-02-07 10:43:08 +00:00
ld [wTextBoxID], a
2014-05-18 18:19:10 +00:00
call DisplayTextBoxID
2015-07-21 01:32:02 +00:00
SetEvent EVENT_BOUGHT_MAGIKARP
2015-07-19 03:49:52 +00:00
jr .done
.choseNo
ld hl, .RefuseText
2015-07-19 03:49:52 +00:00
jr .printText
.alreadyBoughtMagikarp
ld hl, .Text2
2015-07-19 03:49:52 +00:00
.printText
2014-05-18 18:19:10 +00:00
call PrintText
2015-07-19 03:49:52 +00:00
.done
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
.Text1
text_far _MagikarpSalesmanText1
text_end
2014-05-18 18:19:10 +00:00
.RefuseText
text_far _MagikarpSalesmanNoText
text_end
2014-05-18 18:19:10 +00:00
.NoMoneyText
text_far _MagikarpSalesmanNoMoneyText
text_end
2014-05-18 18:19:10 +00:00
.Text2
text_far _MagikarpSalesmanText2
text_end
2014-05-18 18:19:10 +00:00
MtMoonPokecenterText5:
text_far _MtMoonPokecenterText5
text_end
2014-05-18 18:19:10 +00:00
MtMoonTradeNurseText:
script_cable_club_receptionist