aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mtmoonpokecenter2.asm
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2016-05-30 18:20:41 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2016-05-30 18:20:41 -0400
commit3330662296eabb6b3b7f0eed1c79003c8873c712 (patch)
treedae9a2f40425a236a3ef6ecce453cf16b4359c26 /scripts/mtmoonpokecenter2.asm
parentBank7 misc functions (diff)
parentDigletts Cave Route 11 Entrance (diff)
downloadpokeyellow-3330662296eabb6b3b7f0eed1c79003c8873c712.tar.gz
pokeyellow-3330662296eabb6b3b7f0eed1c79003c8873c712.tar.xz
pokeyellow-3330662296eabb6b3b7f0eed1c79003c8873c712.zip
Merge pull request #9 from PikalaxALT/master
Disassemble banks 3A, 3F, and all outdoor maps
Diffstat (limited to 'scripts/mtmoonpokecenter2.asm')
-rwxr-xr-xscripts/mtmoonpokecenter2.asm66
1 files changed, 66 insertions, 0 deletions
diff --git a/scripts/mtmoonpokecenter2.asm b/scripts/mtmoonpokecenter2.asm
new file mode 100755
index 00000000..fa42f440
--- /dev/null
+++ b/scripts/mtmoonpokecenter2.asm
@@ -0,0 +1,66 @@
+Func_f218c:
+ CheckEvent EVENT_BOUGHT_MAGIKARP, 1
+ jp c, .alreadyBoughtMagikarp
+ ld hl, MtMoonPokecenterText_4935c
+ call PrintText
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jp nz, .choseNo
+ ; $000500
+ xor a
+ ld [hMoney], a
+ ld [hMoney + 2], a
+ ld a, $5
+ ld [hMoney + 1], a
+ call HasEnoughMoney
+ jr nc, .enoughMoney
+ ld hl, MtMoonPokecenterText_49366
+ jr .printText
+.enoughMoney
+ lb bc, MAGIKARP, 5
+ call GivePokemon
+ jr nc, .done
+ ; $000500
+ xor a
+ ld [wPriceTemp], a
+ ld [wPriceTemp + 2], a
+ ld a, $5
+ ld [wPriceTemp + 1], a
+ ld hl, wPriceTemp + 2
+ ld de, wPlayerMoney + 2
+ ld c, $3
+ predef SubBCDPredef
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ SetEvent EVENT_BOUGHT_MAGIKARP
+ jr .done
+.choseNo
+ ld hl, MtMoonPokecenterText_49361
+ jr .printText
+.alreadyBoughtMagikarp
+ ld hl, MtMoonPokecenterText_4936b
+.printText
+ call PrintText
+.done
+ ret
+
+MtMoonPokecenterText_4935c: ; 4935c (12:535c)
+ TX_FAR _MtMoonPokecenterText_4935c
+ db "@"
+
+MtMoonPokecenterText_49361: ; 49361 (12:5361)
+ TX_FAR _MtMoonPokecenterText_49361
+ db "@"
+
+MtMoonPokecenterText_49366: ; 49366 (12:5366)
+ TX_FAR _MtMoonPokecenterText_49366
+ db "@"
+
+MtMoonPokecenterText_4936b: ; 4936b (12:536b)
+ TX_FAR _MtMoonPokecenterText_4936b
+ db "@"