Rename the concept of Coins to Chips (#7)

This commit is contained in:
xCrystal
2023-09-02 18:23:25 +02:00
parent ea31d254fb
commit 98fa7a9538
29 changed files with 225 additions and 225 deletions

View File

@@ -162,15 +162,15 @@ AddFunds:
pop hl
ret
GiveCoins::
GiveChips::
ld a, 2
ld de, wCoins
ld de, wChips
call AddFunds
ld a, 2
ld bc, .maxcoins
ld bc, .maxchips
call CompareFunds
jr c, .not_maxed
ld hl, .maxcoins
ld hl, .maxchips
ld a, [hli]
ld [de], a
inc de
@@ -183,15 +183,15 @@ GiveCoins::
and a
ret
.maxcoins
bigdw MAX_COINS
.maxchips
bigdw MAX_CHIPS
TakeCoins::
TakeChips::
ld a, 2
ld de, wCoins
ld de, wChips
call SubtractFunds
jr nc, .okay
; leave with 0 coins
; leave with 0 chips
xor a
ld [de], a
inc de
@@ -203,7 +203,7 @@ TakeCoins::
and a
ret
CheckCoins::
CheckChips::
ld a, 2
ld de, wCoins
ld de, wChips
jp CompareFunds

View File

@@ -143,7 +143,7 @@ UnownPuzzle:
ret
SlotMachine:
call CheckCoinsAndCoinCase
call CheckChipsAndChipCase
ret c
ld a, BANK(_SlotMachine)
ld hl, _SlotMachine
@@ -151,7 +151,7 @@ SlotMachine:
ret
CardFlip:
call CheckCoinsAndCoinCase
call CheckChipsAndChipCase
ret c
ld a, BANK(_CardFlip)
ld hl, _CardFlip
@@ -159,7 +159,7 @@ CardFlip:
ret
UnusedMemoryGame:
call CheckCoinsAndCoinCase
call CheckChipsAndChipCase
ret c
ld a, BANK(_MemoryGame)
ld hl, _MemoryGame
@@ -180,37 +180,37 @@ StartGameCornerGame:
call ExitAllMenus
ret
CheckCoinsAndCoinCase:
ld hl, wCoins
CheckChipsAndChipCase:
ld hl, wChips
ld a, [hli]
or [hl]
jr z, .no_coins
ld a, COIN_CASE
jr z, .no_chips
ld a, CHIP_CASE
ld [wCurItem], a
ld hl, wNumItems
call CheckItem
jr nc, .no_coin_case
jr nc, .no_chip_case
and a
ret
.no_coins
ld hl, .NoCoinsText
.no_chips
ld hl, .NoChipsText
jr .print
.no_coin_case
ld hl, .NoCoinCaseText
.no_chip_case
ld hl, .NoChipCaseText
.print
call PrintText2bpp
scf
ret
.NoCoinsText:
text_far _NoCoinsText
.NoChipsText:
text_far _NoChipsText
text_end
.NoCoinCaseText:
text_far _NoCoinCaseText
.NoChipCaseText:
text_far _NoChipCaseText
text_end
ClearBGPalettesBufferScreen:

View File

@@ -54,7 +54,7 @@ StdScripts::
add_stdscript ReceiveItemScript
add_stdscript ReceiveTogepiEggScript
add_stdscript PCScript
add_stdscript GameCornerCoinVendorScript
add_stdscript GameCornerChipVendorScript
add_stdscript HappinessCheckScript
PokecenterNurseScript:
@@ -763,23 +763,23 @@ ReceiveTogepiEggScript:
waitsfx
end
GameCornerCoinVendorScript:
GameCornerChipVendorScript:
faceplayer
opentext
farwritetext CoinVendor_WelcomeText
farwritetext ChipVendor_WelcomeText
promptbutton
checkitem COIN_CASE
iftrue CoinVendor_IntroScript
farwritetext CoinVendor_NoCoinCaseText
checkitem CHIP_CASE
iftrue ChipVendor_IntroScript
farwritetext ChipVendor_NoChipCaseText
waitbutton
closetext
end
CoinVendor_IntroScript:
farwritetext CoinVendor_IntroText
ChipVendor_IntroScript:
farwritetext ChipVendor_IntroText
.loop
special DisplayMoneyAndCoinBalance
special DisplayMoneyAndChipBalance
loadmenu .MenuHeader
verticalmenu
closewindow
@@ -788,45 +788,45 @@ CoinVendor_IntroScript:
sjump .Cancel
.Buy50:
checkcoins MAX_COINS - 50
ifequal HAVE_MORE, .CoinCaseFull
checkchips MAX_CHIPS - 50
ifequal HAVE_MORE, .ChipCaseFull
checkmoney YOUR_MONEY, 1000
ifequal HAVE_LESS, .NotEnoughMoney
givecoins 50
givechips 50
takemoney YOUR_MONEY, 1000
waitsfx
playsound SFX_TRANSACTION
farwritetext CoinVendor_Buy50CoinsText
farwritetext ChipVendor_Buy50ChipsText
waitbutton
sjump .loop
.Buy500:
checkcoins MAX_COINS - 500
ifequal HAVE_MORE, .CoinCaseFull
checkchips MAX_CHIPS - 500
ifequal HAVE_MORE, .ChipCaseFull
checkmoney YOUR_MONEY, 10000
ifequal HAVE_LESS, .NotEnoughMoney
givecoins 500
givechips 500
takemoney YOUR_MONEY, 10000
waitsfx
playsound SFX_TRANSACTION
farwritetext CoinVendor_Buy500CoinsText
farwritetext ChipVendor_Buy500ChipsText
waitbutton
sjump .loop
.NotEnoughMoney:
farwritetext CoinVendor_NotEnoughMoneyText
farwritetext ChipVendor_NotEnoughMoneyText
waitbutton
closetext
end
.CoinCaseFull:
farwritetext CoinVendor_CoinCaseFullText
.ChipCaseFull:
farwritetext ChipVendor_ChipCaseFullText
waitbutton
closetext
end
.Cancel:
farwritetext CoinVendor_CancelText
farwritetext ChipVendor_CancelText
waitbutton
closetext
end