You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Rename the concept of Coins to Chips (#7)
This commit is contained in:
@@ -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
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user