aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/MtMoonPokecenter_2.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2023-11-20 00:33:27 -0600
committerdannye <33dannye@gmail.com>2023-11-20 20:23:27 -0600
commit298e99d3776580585c3f434e5d93137ae431bdd3 (patch)
treea808c4ffd0fd0f9bd28972bae5236e0d3345c8e5 /scripts/MtMoonPokecenter_2.asm
parentAdd sound bits documentation for wOptions (#110) (diff)
parentName 2 unnamed labels I missed in SeafoamIslandsB4F and PokemonMansion3F (#437) (diff)
downloadpokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.gz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.xz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'scripts/MtMoonPokecenter_2.asm')
-rw-r--r--scripts/MtMoonPokecenter_2.asm64
1 files changed, 64 insertions, 0 deletions
diff --git a/scripts/MtMoonPokecenter_2.asm b/scripts/MtMoonPokecenter_2.asm
new file mode 100644
index 00000000..ba5650a2
--- /dev/null
+++ b/scripts/MtMoonPokecenter_2.asm
@@ -0,0 +1,64 @@
+MagikarpSalesman::
+ CheckEvent EVENT_BOUGHT_MAGIKARP, 1
+ jp c, .alreadyBoughtMagikarp
+ ld hl, .IGotADealText
+ call PrintText
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jp nz, .choseNo
+ xor a
+ ldh [hMoney], a
+ ldh [hMoney + 2], a
+ ld a, $5
+ ldh [hMoney + 1], a
+ call HasEnoughMoney
+ jr nc, .enoughMoney
+ ld hl, .NoMoneyText
+ jr .printText
+.enoughMoney
+ lb bc, MAGIKARP, 5
+ call GivePokemon
+ jr nc, .done
+ 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, .NoText
+ jr .printText
+.alreadyBoughtMagikarp
+ ld hl, .NoRefundsText
+.printText
+ call PrintText
+.done
+ ret
+
+.IGotADealText
+ text_far _MtMoonPokecenterMagikarpSalesmanIGotADealText
+ text_end
+
+.NoText
+ text_far _MtMoonPokecenterMagikarpSalesmanNoText
+ text_end
+
+.NoMoneyText
+ text_far _MtMoonPokecenterMagikarpSalesmanNoMoneyText
+ text_end
+
+.NoRefundsText
+ text_far _MtMoonPokecenterMagikarpSalesmanNoRefundsText
+ text_end