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

@@ -20,5 +20,5 @@ BattleCommand_PayDay:
jr nz, .done
inc [hl]
.done
ld hl, CoinsScatteredText
ld hl, ChipsScatteredText
jp StdBattleTextbox

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

View File

@@ -80,7 +80,7 @@ _CardFlip:
.Jumptable:
dw .AskPlayWithThree
dw .DeductCoins
dw .DeductChips
dw .ChooseACard
dw .PlaceYourBet
dw .CheckTheCard
@@ -94,8 +94,8 @@ _CardFlip:
ret
.AskPlayWithThree:
ld hl, .CardFlipPlayWithThreeCoinsText
call CardFlip_UpdateCoinBalanceDisplay
ld hl, .CardFlipPlayWithThreeChipsText
call CardFlip_UpdateChipBalanceDisplay
call YesNoBox
jr c, .SaidNo
call CardFlip_ShuffleDeck
@@ -107,23 +107,23 @@ _CardFlip:
ld [wJumptableIndex], a
ret
.CardFlipPlayWithThreeCoinsText:
text_far _CardFlipPlayWithThreeCoinsText
.CardFlipPlayWithThreeChipsText:
text_far _CardFlipPlayWithThreeChipsText
text_end
.DeductCoins:
ld a, [wCoins]
.DeductChips:
ld a, [wChips]
ld h, a
ld a, [wCoins + 1]
ld a, [wChips + 1]
ld l, a
ld a, h
and a
jr nz, .deduct ; You have at least 256 coins.
jr nz, .deduct ; You have at least 256 chips.
ld a, l
cp 3
jr nc, .deduct ; You have at least 3 coins.
ld hl, .CardFlipNotEnoughCoinsText
call CardFlip_UpdateCoinBalanceDisplay
jr nc, .deduct ; You have at least 3 chips.
ld hl, .CardFlipNotEnoughChipsText
call CardFlip_UpdateChipBalanceDisplay
ld a, 7
ld [wJumptableIndex], a
ret
@@ -132,22 +132,22 @@ _CardFlip:
ld de, -3
add hl, de
ld a, h
ld [wCoins], a
ld [wChips], a
ld a, l
ld [wCoins + 1], a
ld [wChips + 1], a
ld de, SFX_TRANSACTION
call PlaySFX
xor a
ldh [hBGMapMode], a
call CardFlip_PrintCoinBalance
call CardFlip_PrintChipBalance
ld a, $1
ldh [hBGMapMode], a
call WaitSFX
call .Increment
ret
.CardFlipNotEnoughCoinsText:
text_far _CardFlipNotEnoughCoinsText
.CardFlipNotEnoughChipsText:
text_far _CardFlipNotEnoughChipsText
text_end
.ChooseACard:
@@ -175,7 +175,7 @@ _CardFlip:
call PlaceCardFaceDown
call WaitBGMap
ld hl, .CardFlipChooseACardText
call CardFlip_UpdateCoinBalanceDisplay
call CardFlip_UpdateChipBalanceDisplay
xor a
ld [wCardFlipWhichCard], a
.loop
@@ -228,7 +228,7 @@ _CardFlip:
.PlaceYourBet:
ld hl, .CardFlipPlaceYourBetText
call CardFlip_UpdateCoinBalanceDisplay
call CardFlip_UpdateChipBalanceDisplay
.betloop
call JoyTextDelay
ldh a, [hJoyLast]
@@ -285,7 +285,7 @@ _CardFlip:
.PlayAgain:
call ClearSprites
ld hl, .CardFlipPlayAgainText
call CardFlip_UpdateCoinBalanceDisplay
call CardFlip_UpdateChipBalanceDisplay
call YesNoBox
jr nc, .Continue
call .Increment
@@ -470,7 +470,7 @@ CardFlip_DisplayCardFaceUp:
db "5", $4e, "5", $57, "5", $69, "5", $60
db "6", $4e, "6", $57, "6", $69, "6", $60
CardFlip_UpdateCoinBalanceDisplay:
CardFlip_UpdateChipBalanceDisplay:
push hl
hlcoord 0, 12
ld b, 4
@@ -478,25 +478,25 @@ CardFlip_UpdateCoinBalanceDisplay:
call Textbox1bpp
pop hl
call PrintTextboxText
call CardFlip_PrintCoinBalance
call CardFlip_PrintChipBalance
ret
CardFlip_PrintCoinBalance:
CardFlip_PrintChipBalance:
hlcoord 9, 15
ld b, 1
ld c, 9
call Textbox1bpp
hlcoord 10, 16
ld de, .CoinStr
ld de, .ChipStr
call PlaceString
hlcoord 15, 16
ld de, wCoins
ld de, wChips
lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum
ret
.CoinStr:
db "COIN@"
.ChipStr:
db "CHIP@"
CardFlip_InitTilemap:
xor a
@@ -1067,7 +1067,7 @@ CardFlip_CheckWinCondition:
ld de, SFX_WRONG
call PlaySFX
ld hl, .CardFlipDarnText
call CardFlip_UpdateCoinBalanceDisplay
call CardFlip_UpdateChipBalanceDisplay
call WaitSFX
ret
@@ -1075,19 +1075,19 @@ CardFlip_CheckWinCondition:
push bc
push de
ld hl, .CardFlipYeahText
call CardFlip_UpdateCoinBalanceDisplay
call CardFlip_UpdateChipBalanceDisplay
pop de
call PlaySFX
call WaitSFX
pop bc
.loop
push bc
call .IsCoinCaseFull
call .IsChipCaseFull
jr c, .full
call .AddCoinPlaySFX
call .AddChipPlaySFX
.full
call CardFlip_PrintCoinBalance
call CardFlip_PrintChipBalance
ld c, 2
call DelayFrames
pop bc
@@ -1103,30 +1103,30 @@ CardFlip_CheckWinCondition:
text_far _CardFlipDarnText
text_end
.AddCoinPlaySFX:
ld a, [wCoins]
.AddChipPlaySFX:
ld a, [wChips]
ld h, a
ld a, [wCoins + 1]
ld a, [wChips + 1]
ld l, a
inc hl
ld a, h
ld [wCoins], a
ld [wChips], a
ld a, l
ld [wCoins + 1], a
ld [wChips + 1], a
ld de, SFX_PAY_DAY
call PlaySFX
ret
.IsCoinCaseFull:
ld a, [wCoins]
cp HIGH(MAX_COINS)
.IsChipCaseFull:
ld a, [wChips]
cp HIGH(MAX_CHIPS)
jr c, .less
jr z, .check_low
jr .more
.check_low
ld a, [wCoins + 1]
cp LOW(MAX_COINS)
ld a, [wChips + 1]
cp LOW(MAX_CHIPS)
jr c, .less
.more

View File

@@ -45,7 +45,7 @@ DEF REEL_STOP_DELAY rb ; 15
const SLOTS_NEXT_0B
const SLOTS_FLASH_IF_WIN
const SLOTS_FLASH_SCREEN
const SLOTS_GIVE_EARNED_COINS
const SLOTS_GIVE_EARNED_CHIPS
const SLOTS_PAYOUT_TEXT_AND_ANIM
const SLOTS_PAYOUT_ANIM
const SLOTS_RESTART_OF_QUIT
@@ -184,7 +184,7 @@ SlotsLoop:
xor a
ld [wCurSpriteOAMAddr], a
callfar DoNextFrameForFirst16Sprites
call .PrintCoinsAndPayout
call .PrintChipsAndPayout
call .Stubbed_AlternateMatchingSevensPalette
call DelayFrame
and a
@@ -219,9 +219,9 @@ SlotsLoop:
call DmgToCgbBGPals
ret
.PrintCoinsAndPayout:
.PrintChipsAndPayout:
hlcoord 5, 1
ld de, wCoins
ld de, wChips
lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum
hlcoord 11, 1
@@ -285,7 +285,7 @@ SlotsJumptable:
dw SlotsAction_Next ; 0b
dw SlotsAction_FlashIfWin ; 0c
dw SlotsAction_FlashScreen ; 0d
dw SlotsAction_GiveEarnedCoins ; 0e
dw SlotsAction_GiveEarnedChips ; 0e
dw SlotsAction_PayoutTextAndAnim ; 0f
dw SlotsAction_PayoutAnim ; 10
dw SlotsAction_RestartOrQuit ; 11
@@ -440,7 +440,7 @@ SlotsAction_FlashScreen:
call SlotsAction_Next
ret
SlotsAction_GiveEarnedCoins:
SlotsAction_GiveEarnedChips:
xor a
ld [wFirstTwoReelsMatching], a
ld [wFirstTwoReelsMatchingSevens], a
@@ -471,11 +471,11 @@ SlotsAction_PayoutAnim:
ld [hl], e
dec hl
ld [hl], d
ld hl, wCoins
ld hl, wChips
ld d, [hl]
inc hl
ld e, [hl]
call Slots_CheckCoinCaseFull
call Slots_CheckChipCaseFull
jr c, .okay
inc de
.okay
@@ -486,7 +486,7 @@ SlotsAction_PayoutAnim:
ld a, [wSlotsDelay]
and $7
ret z
ld de, SFX_GET_COIN_FROM_SLOTS
ld de, SFX_GET_CHIP_FROM_SLOTS
call PlaySFX
ret
@@ -527,12 +527,12 @@ Slots_LoadReelState:
ld [de], a
ret
Slots_CheckCoinCaseFull:
Slots_CheckChipCaseFull:
ld a, d
cp HIGH(MAX_COINS)
cp HIGH(MAX_CHIPS)
jr c, .not_full
ld a, e
cp LOW(MAX_COINS)
cp LOW(MAX_CHIPS)
jr c, .not_full
scf
ret
@@ -569,7 +569,7 @@ Slots_StopReel1:
Slots_StopReel2:
; As long as, the following three meet, there's a 31.25% chance
; to set action REEL_ACTION_SET_UP_REEL2_SKIP_TO_7:
; - Bet is >= 2 coins
; - Bet is >= 2 chips
; - There's a 7 symbol visible in reel #1
; - Current spin isn't biased or is biased towards SEVEN
; In any other case, REEL_ACTION_STOP_REEL2 is set.
@@ -1716,7 +1716,7 @@ Slots_TurnLightsOnOrOff:
Slots_AskBet:
.loop
ld hl, .SlotsBetHowManyCoinsText
ld hl, .SlotsBetHowManyChipsText
call PrintText1bpp
ld hl, .MenuHeader
call LoadMenuHeader
@@ -1728,7 +1728,7 @@ Slots_AskBet:
ld a, 4
sub b
ld [wSlotBet], a
ld hl, wCoins
ld hl, wChips
ld c, a
ld a, [hli]
and a
@@ -1736,12 +1736,12 @@ Slots_AskBet:
ld a, [hl]
cp c
jr nc, .Start
ld hl, .SlotsNotEnoughCoinsText
ld hl, .SlotsNotEnoughChipsText
call PrintText1bpp
jr .loop
.Start:
ld hl, wCoins + 1
ld hl, wChips + 1
ld a, [hl]
sub c
ld [hld], a
@@ -1756,16 +1756,16 @@ Slots_AskBet:
and a
ret
.SlotsBetHowManyCoinsText:
text_far _SlotsBetHowManyCoinsText
.SlotsBetHowManyChipsText:
text_far _SlotsBetHowManyChipsText
text_end
.SlotsStartText:
text_far _SlotsStartText
text_end
.SlotsNotEnoughCoinsText:
text_far _SlotsNotEnoughCoinsText
.SlotsNotEnoughChipsText:
text_far _SlotsNotEnoughChipsText
text_end
.MenuHeader:
@@ -1782,17 +1782,17 @@ Slots_AskBet:
db " 1@"
Slots_AskPlayAgain:
ld hl, wCoins
ld hl, wChips
ld a, [hli]
or [hl]
jr nz, .you_have_coins
ld hl, .SlotsRanOutOfCoinsText
jr nz, .you_have_chips
ld hl, .SlotsRanOutOfChipsText
call PrintText1bpp
ld c, 60
call DelayFrames
jr .exit_slots
.you_have_coins
.you_have_chips
ld hl, .SlotsPlayAgainText
call PrintText1bpp
call LoadMenuTextbox
@@ -1810,8 +1810,8 @@ Slots_AskPlayAgain:
scf
ret
.SlotsRanOutOfCoinsText:
text_far _SlotsRanOutOfCoinsText
.SlotsRanOutOfChipsText:
text_far _SlotsRanOutOfChipsText
text_end
.SlotsPlayAgainText:

View File

@@ -67,7 +67,7 @@ ItemEffects:
dw XItemEffect ; X_DEFEND
dw XItemEffect ; X_SPEED
dw XItemEffect ; X_SPECIAL
dw CoinCaseEffect ; COIN_CASE
dw ChipCaseEffect ; CHIP_CASE
dw ItemfinderEffect ; ITEMFINDER
dw PokeFluteEffect ; POKE_FLUTE
dw NoEffect ; EXP_SHARE
@@ -2253,12 +2253,12 @@ BlueCardEffect:
text_far _BlueCardBalanceText
text_end
CoinCaseEffect:
ld hl, .CoinCaseCountText
ChipCaseEffect:
ld hl, .ChipCaseCountText
jp MenuTextboxWaitButton
.CoinCaseCountText:
text_far _CoinCaseCountText
.ChipCaseCountText:
text_far _ChipCaseCountText
text_end
OldRodEffect:

View File

@@ -157,8 +157,8 @@ _ResetWRAM:
ld [wJohtoBadges], a
ld [wKantoBadges], a
ld [wCoins], a
ld [wCoins + 1], a
ld [wChips], a
ld [wChips + 1], a
if START_MONEY >= $10000
ld a, HIGH(START_MONEY >> 8)

View File

@@ -64,25 +64,25 @@ MoneyBottomLeftMenuHeader:
dw NULL
db 1 ; default option
DisplayCoinCaseBalance:
DisplayChipCaseBalance:
; Place a text box of size 1x7 at 11, 0.
hlcoord 11, 0
ld b, 1
ld c, 7
call Textbox1bpp
hlcoord 12, 0
ld de, CoinString
ld de, ChipString
call PlaceString
hlcoord 17, 1
ld de, ShowMoney_TerminatorString
call PlaceString
ld de, wCoins
ld de, wChips
lb bc, 2, 4
hlcoord 13, 1
call PrintNum
ret
DisplayMoneyAndCoinBalance:
DisplayMoneyAndChipBalance:
hlcoord 5, 0
ld b, 3
ld c, 13
@@ -95,18 +95,18 @@ DisplayMoneyAndCoinBalance:
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
hlcoord 6, 3
ld de, CoinString
ld de, ChipString
call PlaceString
hlcoord 15, 3
ld de, wCoins
ld de, wChips
lb bc, 2, 4
call PrintNum
ret
MoneyString:
db "MONEY@"
CoinString:
db "COIN@"
ChipString:
db "CHIP@"
ShowMoney_TerminatorString:
db "@"

View File

@@ -101,9 +101,9 @@ ScriptCommandTable:
dw Script_givemoney ; 22
dw Script_takemoney ; 23
dw Script_checkmoney ; 24
dw Script_givecoins ; 25
dw Script_takecoins ; 26
dw Script_checkcoins ; 27
dw Script_givechips ; 25
dw Script_takechips ; 26
dw Script_checkchips ; 27
dw Script_addcellnum ; 28
dw Script_delcellnum ; 29
dw Script_checkcellnum ; 2a
@@ -126,7 +126,7 @@ ScriptCommandTable:
dw Script_blackoutmod ; 3b
dw Script_warp ; 3c
dw Script_getmoney ; 3d
dw Script_getcoins ; 3e
dw Script_getchips ; 3e
dw Script_getnum ; 3f
dw Script_getmonname ; 40
dw Script_getitemname ; 41
@@ -1659,10 +1659,10 @@ Script_getmoney:
ld de, wStringBuffer1
jp GetStringBuffer
Script_getcoins:
Script_getchips:
call ResetStringBuffer1
ld hl, wStringBuffer1
ld de, wCoins
ld de, wChips
lb bc, PRINTNUM_LEFTALIGN | 2, 6
call PrintNum
ld de, wStringBuffer1
@@ -1824,22 +1824,22 @@ LoadMoneyAmountToMem:
pop bc
ret
Script_givecoins:
call LoadCoinAmountToMem
farcall GiveCoins
Script_givechips:
call LoadChipAmountToMem
farcall GiveChips
ret
Script_takecoins:
call LoadCoinAmountToMem
farcall TakeCoins
Script_takechips:
call LoadChipAmountToMem
farcall TakeChips
ret
Script_checkcoins:
call LoadCoinAmountToMem
farcall CheckCoins
Script_checkchips:
call LoadChipAmountToMem
farcall CheckChips
jr CompareMoneyAction
LoadCoinAmountToMem:
LoadChipAmountToMem:
call GetScriptByte
ldh [hMoneyTemp + 1], a
call GetScriptByte