pokered/scripts/MtMoonPokecenter.asm

96 lines
2.2 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:
def_text_pointers
dw_const MtMoonPokecenterNurseText, TEXT_MTMOONPOKECENTER_NURSE
dw_const MtMoonPokecenterYoungsterText, TEXT_MTMOONPOKECENTER_YOUNGSTER
dw_const MtMoonPokecenterGentlemanText, TEXT_MTMOONPOKECENTER_GENTLEMAN
dw_const MtMoonPokecenterMagikarpSalesmanText, TEXT_MTMOONPOKECENTER_MAGIKARP_SALESMAN
dw_const MtMoonPokecenterClipboardText, TEXT_MTMOONPOKECENTER_CLIPBOARD
dw_const MtMoonPokecenterLinkReceptionistText, TEXT_MTMOONPOKECENTER_LINK_RECEPTIONIST
2014-05-18 18:19:10 +00:00
MtMoonPokecenterNurseText:
script_pokecenter_nurse
2014-05-18 18:19:10 +00:00
MtMoonPokecenterYoungsterText:
text_far _MtMoonPokecenterYoungsterText
text_end
2014-05-18 18:19:10 +00:00
MtMoonPokecenterGentlemanText:
text_far _MtMoonPokecenterGentlemanText
text_end
2014-05-18 18:19:10 +00:00
MtMoonPokecenterMagikarpSalesmanText:
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, .IGotADealText
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, .NoText
2015-07-19 03:49:52 +00:00
jr .printText
.alreadyBoughtMagikarp
ld hl, .NoRefundsText
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
.IGotADealText
text_far _MtMoonPokecenterMagikarpSalesmanIGotADealText
text_end
2014-05-18 18:19:10 +00:00
.NoText
text_far _MtMoonPokecenterMagikarpSalesmanNoText
text_end
2014-05-18 18:19:10 +00:00
.NoMoneyText
text_far _MtMoonPokecenterMagikarpSalesmanNoMoneyText
text_end
2014-05-18 18:19:10 +00:00
.NoRefundsText
text_far _MtMoonPokecenterMagikarpSalesmanNoRefundsText
text_end
2014-05-18 18:19:10 +00:00
MtMoonPokecenterClipboardText:
text_far _MtMoonPokecenterClipboardText
text_end
2014-05-18 18:19:10 +00:00
MtMoonPokecenterLinkReceptionistText:
script_cable_club_receptionist