Add Dubious Disc Salesman

This adds the Dubious Disc Salesman to Cinnabar Pokemon Centre. I chose this area because it's late in the game and it seemed a bit iffy to constantly have to go with Pokemon Centres not in towns. Cinnabar has some connection to Silph, so it makes more sense than just balancing.

There are probably improvements that could be made (eg. a quote as you buy) but the salesman code is surprisingly brittle so I'd rather not break stuff for hours for something that already works perfectly fine.
This commit is contained in:
May Evans 2023-03-06 05:14:19 +00:00
parent bcb67db573
commit 22236d2072
4 changed files with 113 additions and 0 deletions

View file

@ -7,6 +7,7 @@ CinnabarPokecenter_TextPointers:
dw CinnabarPokecenterText2
dw CinnabarPokecenterText3
dw CinnabarTradeNurseText
dw PoryZSalesmanText
CinnabarHealNurseText:
script_pokecenter_nurse
@ -21,3 +22,72 @@ CinnabarPokecenterText3:
CinnabarTradeNurseText:
script_cable_club_receptionist
PoryZSalesmanText:
text_asm
CheckEvent EVENT_BOUGHT_DUBIOUS_DISC, 1
jp c, .alreadyBoughtPoryZ
ld hl, .Text1
call PrintText
ld a, MONEY_BOX
ld [wTextBoxID], a
call DisplayTextBoxID
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jp nz, .choseNo
ldh [hMoney], a
ldh [hMoney + 2], a
ld a, $21
ldh [hMoney + 1], a
call HasEnoughMoney
jr nc, .enoughMoney
ld hl, .NoMoneyText
jr .printText
.enoughMoney
lb bc, DUBIOUS_DISC, 1
call GiveItem
jr nc, .done
xor a
ld [wPriceTemp], a
ld [wPriceTemp + 2], a
ld a, $21
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_DUBIOUS_DISC
jr .done
.choseNo
ld hl, .RefuseText
jr .printText
.alreadyBoughtPoryZ
ld hl, .Text2
.printText
call PrintText
.done
jp TextScriptEnd
.Text1
text_far _PoryZSalesmanText1
text_end
.RefuseText
text_far _PoryZSalesmanNoText
text_end
.NoMoneyText
text_far _PoryZSalesmanNoMoneyText
text_end
.Text2
text_far _PoryZSalesmanText2
text_end
PoryZBagFull:
text_far _PoryZBagFull
text_end