diff options
author | dannye <33dannye@gmail.com> | 2020-05-20 19:40:33 -0500 |
---|---|---|
committer | dannye <33dannye@gmail.com> | 2020-05-20 20:02:53 -0500 |
commit | 10f9559eab8c93b94abb8ae8d1083704ad4e169a (patch) | |
tree | 7dbe7b152dde8a6e9b56664b5b8cdfc0d6be1253 /scripts/MtMoonPokecenter2.asm | |
parent | b8954732a3eaa3a784a6e3eaaa68977a9ccd9816 (diff) |
Sync with pokered
Diffstat (limited to 'scripts/MtMoonPokecenter2.asm')
-rwxr-xr-x | scripts/MtMoonPokecenter2.asm | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/scripts/MtMoonPokecenter2.asm b/scripts/MtMoonPokecenter2.asm new file mode 100755 index 00000000..6097342b --- /dev/null +++ b/scripts/MtMoonPokecenter2.asm @@ -0,0 +1,66 @@ +MagikarpSalesman: + CheckEvent EVENT_BOUGHT_MAGIKARP, 1 + jp c, .alreadyBoughtMagikarp + ld hl, .Text1 + 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, .NoMoneyText + 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, .RefuseText + jr .printText +.alreadyBoughtMagikarp + ld hl, .Text2 +.printText + call PrintText +.done + ret + +.Text1 + TX_FAR _MagikarpSalesmanText1 + db "@" + +.RefuseText + TX_FAR _MagikarpSalesmanNoText + db "@" + +.NoMoneyText + TX_FAR _MagikarpSalesmanNoMoneyText + db "@" + +.Text2 + TX_FAR _MagikarpSalesmanText2 + db "@" |