Rename the concept of Money to Coins (#7)

This commit is contained in:
xCrystal
2023-09-02 23:16:35 +02:00
parent 5d95ff952a
commit eb728d5151
35 changed files with 372 additions and 370 deletions

View File

@@ -2325,19 +2325,19 @@ WinTrainerBattle:
call PrintWinLossText
.skip_win_loss_text
jp .give_money
jp .give_coins
.give_money
.give_coins
ld a, [wAmuletCoin]
and a
call nz, .DoubleReward
call .CheckMaxedOutMomMoney
call .CheckMaxedOutMomCoins
push af
ld a, FALSE
jr nc, .okay
ld a, [wMomSavingMoney]
and MOM_SAVING_MONEY_MASK
cp (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF_MONEY_F)
ld a, [wMomSavingCoins]
and MOM_SAVING_COINS_MASK
cp (1 << MOM_SAVING_SOME_COINS_F) | (1 << MOM_SAVING_HALF_COINS_F)
jr nz, .okay
inc a ; TRUE
@@ -2348,7 +2348,7 @@ WinTrainerBattle:
ld a, b
and a
jr z, .loop2
call .AddMoneyToMom
call .AddCoinsToMom
dec c
dec b
jr .loop
@@ -2357,7 +2357,7 @@ WinTrainerBattle:
ld a, c
and a
jr z, .done
call .AddMoneyToWallet
call .AddCoinsToWallet
dec c
jr .loop2
@@ -2366,8 +2366,8 @@ WinTrainerBattle:
call .DoubleReward
pop af
jr nc, .KeepItAll
ld a, [wMomSavingMoney]
and MOM_SAVING_MONEY_MASK
ld a, [wMomSavingCoins]
and MOM_SAVING_COINS_MASK
jr z, .KeepItAll
ld hl, .SentToMomTexts
dec a
@@ -2381,22 +2381,22 @@ WinTrainerBattle:
jp StdBattleTextbox
.KeepItAll:
ld hl, GotMoneyForWinningText
ld hl, GotCoinsForWinningText
jp StdBattleTextbox
.AddMoneyToMom:
.AddCoinsToMom:
push bc
ld hl, wBattleReward + 2
ld de, wMomsMoney + 2
call AddBattleMoneyToAccount
ld de, wMomsCoins + 2
call AddBattleCoinsToAccount
pop bc
ret
.AddMoneyToWallet:
.AddCoinsToWallet:
push bc
ld hl, wBattleReward + 2
ld de, wMoney + 2
call AddBattleMoneyToAccount
ld de, wCoins + 2
call AddBattleCoinsToAccount
pop bc
ret
@@ -2420,17 +2420,17 @@ WinTrainerBattle:
dw SentHalfToMomText
dw SentAllToMomText
.CheckMaxedOutMomMoney:
ld hl, wMomsMoney + 2
.CheckMaxedOutMomCoins:
ld hl, wMomsCoins + 2
ld a, [hld]
cp LOW(MAX_MONEY)
cp LOW(MAX_COINS)
ld a, [hld]
sbc HIGH(MAX_MONEY) ; mid
sbc HIGH(MAX_COINS) ; mid
ld a, [hl]
sbc HIGH(MAX_MONEY >> 8)
sbc HIGH(MAX_COINS >> 8)
ret
AddBattleMoneyToAccount:
AddBattleCoinsToAccount:
ld c, 3
and a
push de
@@ -2450,17 +2450,17 @@ AddBattleMoneyToAccount:
jr nz, .loop
pop hl
ld a, [hld]
cp LOW(MAX_MONEY)
cp LOW(MAX_COINS)
ld a, [hld]
sbc HIGH(MAX_MONEY) ; mid
sbc HIGH(MAX_COINS) ; mid
ld a, [hl]
sbc HIGH(MAX_MONEY >> 8)
sbc HIGH(MAX_COINS >> 8)
ret c
ld [hl], HIGH(MAX_MONEY >> 8)
ld [hl], HIGH(MAX_COINS >> 8)
inc hl
ld [hl], HIGH(MAX_MONEY) ; mid
ld [hl], HIGH(MAX_COINS) ; mid
inc hl
ld [hl], LOW(MAX_MONEY)
ld [hl], LOW(MAX_COINS)
ret
PlayVictoryMusic:
@@ -2476,7 +2476,7 @@ PlayVictoryMusic:
call IsAnyMonHoldingExpShare
pop de
jr nz, .play_music
ld hl, wPayDayMoney
ld hl, wPayDayCoins
ld a, [hli]
or [hl]
jr nz, .play_music
@@ -8142,7 +8142,7 @@ CleanUpBattleRAM:
ret
CheckPayDay:
ld hl, wPayDayMoney
ld hl, wPayDayCoins
ld a, [hli]
or [hl]
inc hl
@@ -8151,7 +8151,7 @@ CheckPayDay:
ld a, [wAmuletCoin]
and a
jr z, .okay
ld hl, wPayDayMoney + 2
ld hl, wPayDayCoins + 2
sla [hl]
dec hl
rl [hl]
@@ -8164,10 +8164,10 @@ CheckPayDay:
ld [hl], a
.okay
ld hl, wPayDayMoney + 2
ld de, wMoney + 2
call AddBattleMoneyToAccount
ld hl, BattleText_PlayerPickedUpPayDayMoney
ld hl, wPayDayCoins + 2
ld de, wCoins + 2
call AddBattleCoinsToAccount
ld hl, BattleText_PlayerPickedUpPayDayCoins
call StdBattleTextbox
ret

View File

@@ -11,7 +11,7 @@ BattleCommand_PayDay:
.ok
add a
ld hl, wPayDayMoney + 2
ld hl, wPayDayCoins + 2
add [hl]
ld [hld], a
jr nc, .done

View File

@@ -1,12 +1,12 @@
GiveMoney::
GiveCoins::
ld a, 3
call AddMoney
ld bc, MaxMoney
call AddCoins
ld bc, MaxCoins
ld a, 3
call CompareMoney
call CompareCoins
jr z, .not_maxed_out
jr c, .not_maxed_out
ld hl, MaxMoney
ld hl, MaxCoins
ld a, [hli]
ld [de], a
inc de
@@ -22,14 +22,14 @@ GiveMoney::
and a
ret
MaxMoney:
dt MAX_MONEY
MaxCoins:
dt MAX_COINS
TakeMoney::
TakeCoins::
ld a, 3
call SubtractMoney
call SubtractCoins
jr nc, .okay
; leave with 0 money
; leave with 0 coins
xor a
ld [de], a
inc de
@@ -43,7 +43,7 @@ TakeMoney::
and a
ret
CompareMoney::
CompareCoins::
ld a, 3
CompareFunds:
; a: number of bytes
@@ -91,7 +91,7 @@ CompareFunds:
pop hl
ret
SubtractMoney:
SubtractCoins:
ld a, 3
SubtractFunds:
; a: number of bytes
@@ -126,7 +126,7 @@ SubtractFunds:
pop hl
ret
AddMoney:
AddCoins:
ld a, 3
AddFunds:
; a: number of bytes

View File

@@ -17,7 +17,7 @@
const DAYCARETEXT_GOT_BACK
const DAYCARETEXT_TOO_SOON
const DAYCARETEXT_PARTY_FULL
const DAYCARETEXT_NOT_ENOUGH_MONEY
const DAYCARETEXT_NOT_ENOUGH_COINS
const DAYCARETEXT_OH_FINE
const DAYCARETEXT_COME_AGAIN
@@ -45,7 +45,7 @@ DayCareMan:
call DayCare_AskWithdrawBreedMon
jr c, .print_text
farcall RetrieveMonFromDayCareMan
call DayCare_GetBackMonForMoney
call DayCare_GetBackMonForCoins
ld hl, wDayCareMan
res DAYCAREMAN_HAS_MON_F, [hl]
res DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
@@ -83,7 +83,7 @@ DayCareLady:
call DayCare_AskWithdrawBreedMon
jr c, .print_text
farcall RetrieveMonFromDayCareLady
call DayCare_GetBackMonForMoney
call DayCare_GetBackMonForCoins
ld hl, wDayCareLady
res DAYCARELADY_HAS_MON_F, [hl]
ld hl, wDayCareMan
@@ -187,7 +187,7 @@ DayCare_AskWithdrawBreedMon:
call PrintDayCareText
call YesNoBox
jr c, .refused
jr .check_money
jr .check_coins
.grew_at_least_one_level
ld a, DAYCARETEXT_GENIUSES
@@ -199,11 +199,11 @@ DayCare_AskWithdrawBreedMon:
call YesNoBox
jr c, .refused
.check_money
ld de, wMoney
.check_coins
ld de, wCoins
ld bc, wStringBuffer2 + 2
farcall CompareMoney
jr c, .not_enough_money
farcall CompareCoins
jr c, .not_enough_coins
ld a, [wPartyCount]
cp PARTY_LENGTH
jr nc, .party_full
@@ -215,8 +215,8 @@ DayCare_AskWithdrawBreedMon:
scf
ret
.not_enough_money
ld a, DAYCARETEXT_NOT_ENOUGH_MONEY
.not_enough_coins
ld a, DAYCARETEXT_NOT_ENOUGH_COINS
scf
ret
@@ -225,10 +225,10 @@ DayCare_AskWithdrawBreedMon:
scf
ret
DayCare_GetBackMonForMoney:
DayCare_GetBackMonForCoins:
ld bc, wStringBuffer2 + 2
ld de, wMoney
farcall TakeMoney
ld de, wCoins
farcall TakeCoins
ld a, DAYCARETEXT_WITHDRAW
call PrintDayCareText
ld a, [wCurPartySpecies]
@@ -290,7 +290,7 @@ PrintDayCareText:
dw .GotBackMonText ; 0e
dw .BackAlreadyText ; 0f
dw .HaveNoRoomText ; 10
dw .NotEnoughMoneyText ; 11
dw .NotEnoughCoinsText ; 11
dw .OhFineThenText ; 12
dw .ComeAgainText ; 13
@@ -362,8 +362,8 @@ PrintDayCareText:
text_far _HaveNoRoomText
text_end
.NotEnoughMoneyText:
text_far _NotEnoughMoneyText
.NotEnoughCoinsText:
text_far _NotEnoughCoinsText
text_end
.OhFineThenText:

View File

@@ -23,24 +23,24 @@ BankOfMom:
.dw
dw .CheckIfBankInitialized
dw .InitializeBank
dw .IsThisAboutYourMoney
dw .IsThisAboutYourCoins
dw .AccessBankOfMom
dw .StoreMoney
dw .TakeMoney
dw .StopOrStartSavingMoney
dw .StoreCoins
dw .TakeCoins
dw .StopOrStartSavingCoins
dw .JustDoWhatYouCan
dw .AskDST
.CheckIfBankInitialized:
ld a, [wMomSavingMoney]
ld a, [wMomSavingCoins]
bit MOM_ACTIVE_F, a
jr nz, .savingmoneyalready
jr nz, .savingcoinsalready
set MOM_ACTIVE_F, a
ld [wMomSavingMoney], a
ld [wMomSavingCoins], a
ld a, $1
jr .done_0
.savingmoneyalready
.savingcoinsalready
ld a, $2
.done_0
@@ -51,25 +51,25 @@ BankOfMom:
ld hl, MomLeavingText1
call PrintText1bpp
call YesNoBox
jr c, .DontSaveMoney
jr c, .DontSaveCoins
ld hl, MomLeavingText2
call PrintText1bpp
ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_MONEY_F)
ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_COINS_F)
jr .done_1
.DontSaveMoney:
.DontSaveCoins:
ld a, 1 << MOM_ACTIVE_F
.done_1
ld [wMomSavingMoney], a
ld [wMomSavingCoins], a
ld hl, MomLeavingText3
call PrintText1bpp
ld a, $8
ld [wJumptableIndex], a
ret
.IsThisAboutYourMoney:
ld hl, MomIsThisAboutYourMoneyText
.IsThisAboutYourCoins:
ld hl, MomIsThisAboutYourCoinsText
call PrintText1bpp
call YesNoBox
jr c, .nope
@@ -119,8 +119,8 @@ BankOfMom:
ld [wJumptableIndex], a
ret
.StoreMoney:
ld hl, MomStoreMoneyText
.StoreCoins:
ld hl, MomStoreCoinsText
call PrintText1bpp
xor a
ld hl, wStringBuffer2
@@ -141,29 +141,29 @@ BankOfMom:
inc hl
or [hl]
jr z, .CancelDeposit
ld de, wMoney
ld de, wCoins
ld bc, wStringBuffer2
farcall CompareMoney
farcall CompareCoins
jr c, .InsufficientFundsInWallet
ld hl, wStringBuffer2
ld de, wStringBuffer2 + 3
ld bc, 3
call CopyBytes
ld bc, wMomsMoney
ld bc, wMomsCoins
ld de, wStringBuffer2
farcall GiveMoney
farcall GiveCoins
jr c, .NotEnoughRoomInBank
ld bc, wStringBuffer2 + 3
ld de, wMoney
farcall TakeMoney
ld de, wCoins
farcall TakeCoins
ld hl, wStringBuffer2
ld de, wMomsMoney
ld de, wMomsCoins
ld bc, 3
call CopyBytes
ld de, SFX_TRANSACTION
call PlaySFX
call WaitSFX
ld hl, MomStoredMoneyText
ld hl, MomStoredCoinsText
call PrintText1bpp
ld a, $8
jr .done_4
@@ -185,8 +185,8 @@ BankOfMom:
ld [wJumptableIndex], a
ret
.TakeMoney:
ld hl, MomTakeMoneyText
.TakeCoins:
ld hl, MomTakeCoinsText
call PrintText1bpp
xor a
ld hl, wStringBuffer2
@@ -211,25 +211,25 @@ BankOfMom:
ld de, wStringBuffer2 + 3
ld bc, 3
call CopyBytes
ld de, wMomsMoney
ld de, wMomsCoins
ld bc, wStringBuffer2
farcall CompareMoney
farcall CompareCoins
jr c, .InsufficientFundsInBank
ld bc, wMoney
ld bc, wCoins
ld de, wStringBuffer2
farcall GiveMoney
farcall GiveCoins
jr c, .NotEnoughRoomInWallet
ld bc, wStringBuffer2 + 3
ld de, wMomsMoney
farcall TakeMoney
ld de, wMomsCoins
farcall TakeCoins
ld hl, wStringBuffer2
ld de, wMoney
ld de, wCoins
ld bc, 3
call CopyBytes
ld de, SFX_TRANSACTION
call PlaySFX
call WaitSFX
ld hl, MomTakenMoneyText
ld hl, MomTakenCoinsText
call PrintText1bpp
ld a, $8
jr .done_5
@@ -251,22 +251,22 @@ BankOfMom:
ld [wJumptableIndex], a
ret
.StopOrStartSavingMoney:
ld hl, MomSaveMoneyText
.StopOrStartSavingCoins:
ld hl, MomSaveCoinsText
call PrintText1bpp
call YesNoBox
jr c, .StopSavingMoney
ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_MONEY_F)
ld [wMomSavingMoney], a
ld hl, MomStartSavingMoneyText
jr c, .StopSavingCoins
ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_COINS_F)
ld [wMomSavingCoins], a
ld hl, MomStartSavingCoinsText
call PrintText1bpp
ld a, $8
ld [wJumptableIndex], a
ret
.StopSavingMoney:
.StopSavingCoins:
ld a, 1 << MOM_ACTIVE_F
ld [wMomSavingMoney], a
ld [wMomSavingCoins], a
ld a, $7
ld [wJumptableIndex], a
ret
@@ -297,22 +297,22 @@ Mom_ContinueMenuSetup:
ld de, Mom_SavedString
call PlaceString
hlcoord 12, 2
ld de, wMomsMoney
lb bc, PRINTNUM_MONEY | 3, 6
ld de, wMomsCoins
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
hlcoord 1, 4
ld de, Mom_HeldString
call PlaceString
hlcoord 12, 4
ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
ld de, wCoins
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
hlcoord 1, 6
pop de
call PlaceString
hlcoord 12, 6
ld de, wStringBuffer2
lb bc, PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3, 6
lb bc, PRINTNUM_COINS | PRINTNUM_LEADINGZEROS | 3, 6
call PrintNum
call UpdateSprites
call CopyTilemapAtOnce
@@ -342,7 +342,7 @@ Mom_WithdrawDepositMenuJoypad:
call ByteFill
hlcoord 12, 6
ld de, wStringBuffer2
lb bc, PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3, 6
lb bc, PRINTNUM_COINS | PRINTNUM_LEADINGZEROS | 3, 6
call PrintNum
ldh a, [hVBlankCounter]
and $10
@@ -405,7 +405,7 @@ Mom_WithdrawDepositMenuJoypad:
ld c, l
ld b, h
ld de, wStringBuffer2
farcall GiveMoney
farcall GiveCoins
ret
.decrementdigit
@@ -414,7 +414,7 @@ Mom_WithdrawDepositMenuJoypad:
ld c, l
ld b, h
ld de, wStringBuffer2
farcall TakeMoney
farcall TakeCoins
ret
.getdigitquantity
@@ -462,24 +462,24 @@ MomLeavingText3:
text_far _MomLeavingText3
text_end
MomIsThisAboutYourMoneyText:
text_far _MomIsThisAboutYourMoneyText
MomIsThisAboutYourCoinsText:
text_far _MomIsThisAboutYourCoinsText
text_end
MomBankWhatDoYouWantToDoText:
text_far _MomBankWhatDoYouWantToDoText
text_end
MomStoreMoneyText:
text_far _MomStoreMoneyText
MomStoreCoinsText:
text_far _MomStoreCoinsText
text_end
MomTakeMoneyText:
text_far _MomTakeMoneyText
MomTakeCoinsText:
text_far _MomTakeCoinsText
text_end
MomSaveMoneyText:
text_far _MomSaveMoneyText
MomSaveCoinsText:
text_far _MomSaveCoinsText
text_end
MomHaventSavedThatMuchText:
@@ -498,16 +498,16 @@ MomNotEnoughRoomInBankText:
text_far _MomNotEnoughRoomInBankText
text_end
MomStartSavingMoneyText:
text_far _MomStartSavingMoneyText
MomStartSavingCoinsText:
text_far _MomStartSavingCoinsText
text_end
MomStoredMoneyText:
text_far _MomStoredMoneyText
MomStoredCoinsText:
text_far _MomStoredCoinsText
text_end
MomTakenMoneyText:
text_far _MomTakenMoneyText
MomTakenCoinsText:
text_far _MomTakenCoinsText
text_end
MomJustDoWhatYouCanText:

View File

@@ -61,37 +61,37 @@ CheckBalance_MomItem2:
jr nc, .nope
call GetItemFromMom
ld a, [hli]
ldh [hMoneyTemp], a
ldh [hCoinsTemp], a
ld a, [hli]
ldh [hMoneyTemp + 1], a
ldh [hCoinsTemp + 1], a
ld a, [hli]
ldh [hMoneyTemp + 2], a
ld de, wMomsMoney
ld bc, hMoneyTemp
farcall CompareMoney
jr nc, .have_enough_money
ldh [hCoinsTemp + 2], a
ld de, wMomsCoins
ld bc, hCoinsTemp
farcall CompareCoins
jr nc, .have_enough_coins
.nope
jr .check_have_2300
.have_enough_money
.have_enough_coins
scf
ret
.check_have_2300
ld hl, hMoneyTemp
ld [hl], HIGH(MOM_MONEY >> 8)
ld hl, hCoinsTemp
ld [hl], HIGH(MOM_COINS >> 8)
inc hl
ld [hl], HIGH(MOM_MONEY) ; mid
ld [hl], HIGH(MOM_COINS) ; mid
inc hl
ld [hl], LOW(MOM_MONEY)
ld [hl], LOW(MOM_COINS)
.loop
ld de, wMomItemTriggerBalance
ld bc, wMomsMoney
farcall CompareMoney
ld bc, wMomsCoins
farcall CompareCoins
jr z, .exact
jr nc, .less_than
call .AddMoney
call .AddCoins
jr .loop
.less_than
@@ -99,7 +99,7 @@ CheckBalance_MomItem2:
ret
.exact
call .AddMoney
call .AddCoins
ld a, NUM_MOM_ITEMS_1
call RandomRange
inc a
@@ -107,10 +107,10 @@ CheckBalance_MomItem2:
scf
ret
.AddMoney:
.AddCoins:
ld de, wMomItemTriggerBalance
ld bc, hMoneyTemp
farcall AddMoney
ld bc, hCoinsTemp
farcall AddCoins
ret
MomBuysItem_DeductFunds:
@@ -118,14 +118,14 @@ MomBuysItem_DeductFunds:
ld de, 3 ; cost
add hl, de
ld a, [hli]
ldh [hMoneyTemp], a
ldh [hCoinsTemp], a
ld a, [hli]
ldh [hMoneyTemp + 1], a
ldh [hCoinsTemp + 1], a
ld a, [hli]
ldh [hMoneyTemp + 2], a
ld de, wMomsMoney
ld bc, hMoneyTemp
farcall TakeMoney
ldh [hCoinsTemp + 2], a
ld de, wMomsCoins
ld bc, hCoinsTemp
farcall TakeCoins
ret
Mom_GiveItemOrDoll:
@@ -165,14 +165,14 @@ Mom_GetScriptPointer:
.ItemScript:
writetext MomHiHowAreYouText
writetext MomFoundAnItemText
writetext MomBoughtWithYourMoneyText
writetext MomBoughtWithYourCoinsText
writetext MomItsInPCText
end
.DollScript:
writetext MomHiHowAreYouText
writetext MomFoundADollText
writetext MomBoughtWithYourMoneyText
writetext MomBoughtWithYourCoinsText
writetext MomItsInYourRoomText
end
@@ -212,8 +212,8 @@ MomFoundAnItemText:
text_far _MomFoundAnItemText
text_end
MomBoughtWithYourMoneyText:
text_far _MomBoughtWithYourMoneyText
MomBoughtWithYourCoinsText:
text_far _MomBoughtWithYourCoinsText
text_end
MomItsInPCText:

View File

@@ -779,7 +779,7 @@ ChipVendor_IntroScript:
farwritetext ChipVendor_IntroText
.loop
special DisplayMoneyAndChipBalance
special DisplayCoinsAndChipBalance
loadmenu .MenuHeader
verticalmenu
closewindow
@@ -790,10 +790,10 @@ ChipVendor_IntroScript:
.Buy50:
checkchips MAX_CHIPS - 50
ifequal HAVE_MORE, .ChipCaseFull
checkmoney YOUR_MONEY, 1000
ifequal HAVE_LESS, .NotEnoughMoney
checkcoins YOUR_COINS, 1000
ifequal HAVE_LESS, .NotEnoughCoins
givechips 50
takemoney YOUR_MONEY, 1000
takecoins YOUR_COINS, 1000
waitsfx
playsound SFX_TRANSACTION
farwritetext ChipVendor_Buy50ChipsText
@@ -803,18 +803,18 @@ ChipVendor_IntroScript:
.Buy500:
checkchips MAX_CHIPS - 500
ifequal HAVE_MORE, .ChipCaseFull
checkmoney YOUR_MONEY, 10000
ifequal HAVE_LESS, .NotEnoughMoney
checkcoins YOUR_COINS, 10000
ifequal HAVE_LESS, .NotEnoughCoins
givechips 500
takemoney YOUR_MONEY, 10000
takecoins YOUR_COINS, 10000
waitsfx
playsound SFX_TRANSACTION
farwritetext ChipVendor_Buy500ChipsText
waitbutton
sjump .loop
.NotEnoughMoney:
farwritetext ChipVendor_NotEnoughMoneyText
.NotEnoughCoins:
farwritetext ChipVendor_NotEnoughCoinsText
waitbutton
closetext
end

View File

@@ -14,7 +14,7 @@ Script_Whiteout:
special HealParty
checkflag ENGINE_BUG_CONTEST_TIMER
iftrue .bug_contest
callasm HalveMoney
callasm HalveCoins
callasm GetWhiteoutSpawn
farscall Script_AbortBugContest
special WarpToSpawnPoint
@@ -42,9 +42,9 @@ BattleBGMap:
call SetPalettes
ret
HalveMoney:
; Halve the player's money.
ld hl, wMoney
HalveCoins:
; Halve the player's coins.
ld hl, wCoins
ld a, [hl]
srl a
ld [hli], a

View File

@@ -187,7 +187,7 @@ Sell_HalvePrice:
BuySell_DisplaySubtotal:
push hl
ld hl, hMoneyTemp
ld hl, hCoinsTemp
ldh a, [hProduct + 1]
ld [hli], a
ldh a, [hProduct + 2]
@@ -196,8 +196,8 @@ BuySell_DisplaySubtotal:
ld [hl], a
pop hl
inc hl
ld de, hMoneyTemp
lb bc, PRINTNUM_MONEY | 3, 6
ld de, hCoinsTemp
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
call WaitBGMap
ret

View File

@@ -1,7 +1,7 @@
const_def
const MARTTEXT_HOW_MANY
const MARTTEXT_COSTS_THIS_MUCH
const MARTTEXT_NOT_ENOUGH_MONEY
const MARTTEXT_NOT_ENOUGH_COINS
const MARTTEXT_BAG_FULL
const MARTTEXT_HERE_YOU_GO
const MARTTEXT_SOLD_OUT
@@ -398,7 +398,7 @@ GetMartDialogGroup:
.StandardMartPointers:
dw MartHowManyText
dw MartFinalPriceText
dw MartNoMoneyText
dw MartNoCoinsText
dw MartPackFullText
dw MartThanksText
dw BuyMenuLoop
@@ -406,7 +406,7 @@ GetMartDialogGroup:
.HerbShopPointers:
dw HerbalLadyHowManyText
dw HerbalLadyFinalPriceText
dw HerbalLadyNoMoneyText
dw HerbalLadyNoCoinsText
dw HerbalLadyPackFullText
dw HerbalLadyThanksText
dw BuyMenuLoop
@@ -422,13 +422,13 @@ GetMartDialogGroup:
.PharmacyPointers:
dw PharmacyHowManyText
dw PharmacyFinalPriceText
dw PharmacyNoMoneyText
dw PharmacyNoCoinsText
dw PharmacyPackFullText
dw PharmacyThanksText
dw BuyMenuLoop
BuyMenuLoop:
farcall PlaceMoneyTopRight
farcall PlaceCoinsTopRight
call UpdateSprites
ld hl, MenuHeader_Buy
call CopyMenuHeader
@@ -453,10 +453,10 @@ BuyMenuLoop:
jr c, .cancel
call MartConfirmPurchase
jr c, .cancel
ld de, wMoney
ld bc, hMoneyTemp
ld de, wCoins
ld bc, hCoinsTemp
ld a, 3 ; useless load
call CompareMoney
call CompareCoins
jr c, .insufficient_funds
ld hl, wNumItems
call ReceiveItem
@@ -468,9 +468,9 @@ BuyMenuLoop:
ld hl, wBargainShopFlags
call FlagAction
call PlayTransactionSound
ld de, wMoney
ld bc, hMoneyTemp
call TakeMoney
ld de, wCoins
ld bc, hCoinsTemp
call TakeCoins
ld a, MARTTEXT_HERE_YOU_GO
call LoadBuyMenuText
call JoyWaitAorB
@@ -492,7 +492,7 @@ BuyMenuLoop:
ret
.insufficient_funds
ld a, MARTTEXT_NOT_ENOUGH_MONEY
ld a, MARTTEXT_NOT_ENOUGH_COINS
call LoadBuyMenuText
call JoyWaitAorB
and a
@@ -539,11 +539,11 @@ BargainShopAskPurchaseQuantity:
add hl, de
inc hl
ld a, [hli]
ldh [hMoneyTemp + 2], a
ldh [hCoinsTemp + 2], a
ld a, [hl]
ldh [hMoneyTemp + 1], a
ldh [hCoinsTemp + 1], a
xor a
ldh [hMoneyTemp], a
ldh [hCoinsTemp], a
and a
ret
@@ -619,7 +619,7 @@ MenuHeader_Buy:
pop hl
ld bc, SCREEN_WIDTH
add hl, bc
ld c, PRINTNUM_LEADINGZEROS | PRINTNUM_MONEY | 3
ld c, PRINTNUM_LEADINGZEROS | PRINTNUM_COINS | 3
call PrintBCDNumber
ret
@@ -643,8 +643,8 @@ HerbalLadyPackFullText:
text_far _HerbalLadyPackFullText
text_end
HerbalLadyNoMoneyText:
text_far _HerbalLadyNoMoneyText
HerbalLadyNoCoinsText:
text_far _HerbalLadyNoCoinsText
text_end
HerbalLadyComeAgainText:
@@ -699,8 +699,8 @@ PharmacyPackFullText:
text_far _PharmacyPackFullText
text_end
PharmacyNoMoneyText:
text_far _PharmacyNoMoneyText
PharmacyNoCoinsText:
text_far _PharmacyNoCoinsText
text_end
PharmacyComeAgainText:
@@ -765,7 +765,7 @@ SellMenu:
.okay_to_sell
ld hl, MartSellHowManyText
call PrintText1bpp
farcall PlaceMoneyAtTopLeftOfTextbox
farcall PlaceCoinsAtTopLeftOfTextbox
farcall SelectQuantityToSell
call ExitMenu
jr c, .declined
@@ -776,9 +776,9 @@ SellMenu:
call PrintTextboxText
call YesNoBox
jr c, .declined
ld de, wMoney
ld bc, hMoneyTemp
call GiveMoney
ld de, wCoins
ld bc, hCoinsTemp
call GiveCoins
ld a, [wMartItemID]
ld hl, wNumItems
call TossItem
@@ -789,7 +789,7 @@ SellMenu:
ld hl, MartBoughtText
call PrintTextboxText
call PlayTransactionSound
farcall PlaceMoneyBottomLeft
farcall PlaceCoinsBottomLeft
call JoyWaitAorB
.declined
@@ -826,8 +826,8 @@ MartThanksText:
text_far _MartThanksText
text_end
MartNoMoneyText:
text_far _MartNoMoneyText
MartNoCoinsText:
text_far _MartNoCoinsText
text_end
MartPackFullText:

View File

@@ -5,7 +5,7 @@ _PrintNum::
; The high nybble of the c register specifies how many of the total amount of
; digits will be in front of the decimal point.
; Some extra flags can be given in bits 5-7 of b.
; Bit 5: money if set (unless left-aligned without leading zeros)
; Bit 5: coins if set (unless left-aligned without leading zeros)
; Bit 6: left-aligned if set
; Bit 7: print leading zeros if set
@@ -14,11 +14,11 @@ _PrintNum::
bit 5, b
jr z, .main
bit 7, b
jr nz, .moneyflag
jr nz, .coinsflag
bit 6, b
jr z, .main
.moneyflag ; 101xxxxx or 011xxxxx
.coinsflag ; 101xxxxx or 011xxxxx
ld a, "<COIN>"
ld [hli], a
res 5, b ; 100xxxxx or 010xxxxx
@@ -150,11 +150,11 @@ _PrintNum::
ld b, a
ldh a, [hPrintNumBuffer + 0]
or c
jr nz, .money
jr nz, .coins
call .PrintLeadingZero
jr .money_leading_zero
jr .coins_leading_zero
.money
.coins
call .PrintCoin
push af
ld a, "0"
@@ -164,11 +164,11 @@ _PrintNum::
ldh [hPrintNumBuffer + 0], a
inc e
dec e
jr nz, .money_leading_zero
jr nz, .coins_leading_zero
inc hl
ld [hl], "."
.money_leading_zero
.coins_leading_zero
call .AdvancePointer
call .PrintCoin
ld a, "0"

View File

@@ -160,24 +160,24 @@ _ResetWRAM:
ld [wChips], a
ld [wChips + 1], a
if START_MONEY >= $10000
ld a, HIGH(START_MONEY >> 8)
if START_COINS >= $10000
ld a, HIGH(START_COINS >> 8)
endc
ld [wMoney], a
ld a, HIGH(START_MONEY) ; mid
ld [wMoney + 1], a
ld a, LOW(START_MONEY)
ld [wMoney + 2], a
ld [wCoins], a
ld a, HIGH(START_COINS) ; mid
ld [wCoins + 1], a
ld a, LOW(START_COINS)
ld [wCoins + 2], a
xor a
ld [wWhichMomItem], a
ld hl, wMomItemTriggerBalance
ld [hl], HIGH(MOM_MONEY >> 8)
ld [hl], HIGH(MOM_COINS >> 8)
inc hl
ld [hl], HIGH(MOM_MONEY) ; mid
ld [hl], HIGH(MOM_COINS) ; mid
inc hl
ld [hl], LOW(MOM_MONEY)
ld [hl], LOW(MOM_COINS)
call InitializeNPCNames

View File

@@ -27,38 +27,38 @@ PlaceMenuItemQuantity:
.done
ret
PlaceMoneyTopRight:
ld hl, MoneyTopRightMenuHeader
PlaceCoinsTopRight:
ld hl, CoinsTopRightMenuHeader
call CopyMenuHeader
jr PlaceMoneyTextbox
jr PlaceCoinsTextbox
PlaceMoneyBottomLeft:
ld hl, MoneyBottomLeftMenuHeader
PlaceCoinsBottomLeft:
ld hl, CoinsBottomLeftMenuHeader
call CopyMenuHeader
jr PlaceMoneyTextbox
jr PlaceCoinsTextbox
PlaceMoneyAtTopLeftOfTextbox:
ld hl, MoneyTopRightMenuHeader
PlaceCoinsAtTopLeftOfTextbox:
ld hl, CoinsTopRightMenuHeader
lb de, 0, 11
call OffsetMenuHeader
PlaceMoneyTextbox:
PlaceCoinsTextbox:
call MenuBox
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH + 1
add hl, de
ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
ld de, wCoins
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
ret
MoneyTopRightMenuHeader:
CoinsTopRightMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 11, 0, SCREEN_WIDTH - 1, 2
dw NULL
db 1 ; default option
MoneyBottomLeftMenuHeader:
CoinsBottomLeftMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 11, 8, 13
dw NULL
@@ -74,7 +74,7 @@ DisplayChipCaseBalance:
ld de, ChipString
call PlaceString
hlcoord 17, 1
ld de, ShowMoney_TerminatorString
ld de, ShowCoins_TerminatorString
call PlaceString
ld de, wChips
lb bc, 2, 4
@@ -82,17 +82,17 @@ DisplayChipCaseBalance:
call PrintNum
ret
DisplayMoneyAndChipBalance:
DisplayCoinsAndChipBalance:
hlcoord 5, 0
ld b, 3
ld c, 13
call Textbox1bpp
hlcoord 6, 1
ld de, MoneyString
ld de, CoinsString
call PlaceString
hlcoord 12, 1
ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
ld de, wCoins
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
hlcoord 6, 3
ld de, ChipString
@@ -103,11 +103,11 @@ DisplayMoneyAndChipBalance:
call PrintNum
ret
MoneyString:
db "MONEY@"
CoinsString:
db "COINS@"
ChipString:
db "CHIP@"
ShowMoney_TerminatorString:
ShowCoins_TerminatorString:
db "@"
StartMenu_PrintSafariGameStatus: ; unreferenced

View File

@@ -228,7 +228,7 @@ TrainerCard_PrintTopHalfOfCard:
ld d, 5
call TrainerCard_InitBorder
hlcoord 2, 2
ld de, .Name_Money
ld de, .Name_Coins
call PlaceString
hlcoord 2, 4
ld de, .ID_No
@@ -241,8 +241,8 @@ TrainerCard_PrintTopHalfOfCard:
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
hlcoord 7, 6
ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
ld de, wCoins
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
hlcoord 1, 3
ld de, .HorizontalDivider
@@ -254,10 +254,10 @@ TrainerCard_PrintTopHalfOfCard:
predef PlaceGraphic
ret
.Name_Money:
.Name_Coins:
db "NAME/"
next ""
next "MONEY@"
next "COINS@"
.ID_No:
db $27, $28, -1 ; ID NO

View File

@@ -98,9 +98,9 @@ ScriptCommandTable:
dw Script_giveitem ; 1f
dw Script_takeitem ; 20
dw Script_checkitem ; 21
dw Script_givemoney ; 22
dw Script_takemoney ; 23
dw Script_checkmoney ; 24
dw Script_givecoins ; 22
dw Script_takecoins ; 23
dw Script_checkcoins ; 24
dw Script_givechips ; 25
dw Script_takechips ; 26
dw Script_checkchips ; 27
@@ -125,7 +125,7 @@ ScriptCommandTable:
dw Script_warpmod ; 3a
dw Script_blackoutmod ; 3b
dw Script_warp ; 3c
dw Script_getmoney ; 3d
dw Script_getcoins ; 3d
dw Script_getchips ; 3e
dw Script_getnum ; 3f
dw Script_getmonname ; 40
@@ -1650,9 +1650,9 @@ Script_gettrainerclassname:
ld [wNamedObjectType], a
jr ContinueToGetName
Script_getmoney:
Script_getcoins:
call ResetStringBuffer1
call GetMoneyAccount
call GetCoinsAccount
ld hl, wStringBuffer1
lb bc, PRINTNUM_LEFTALIGN | 3, 6
call PrintNum
@@ -1771,24 +1771,24 @@ Script_checkitem:
ld [wScriptVar], a
ret
Script_givemoney:
call GetMoneyAccount
call LoadMoneyAmountToMem
farcall GiveMoney
Script_givecoins:
call GetCoinsAccount
call LoadCoinsAmountToMem
farcall GiveCoins
ret
Script_takemoney:
call GetMoneyAccount
call LoadMoneyAmountToMem
farcall TakeMoney
Script_takecoins:
call GetCoinsAccount
call LoadCoinsAmountToMem
farcall TakeCoins
ret
Script_checkmoney:
call GetMoneyAccount
call LoadMoneyAmountToMem
farcall CompareMoney
Script_checkcoins:
call GetCoinsAccount
call LoadCoinsAmountToMem
farcall CompareCoins
CompareMoneyAction:
CompareCoinsAction:
jr c, .less
jr z, .exact
ld a, HAVE_MORE
@@ -1802,16 +1802,16 @@ CompareMoneyAction:
ld [wScriptVar], a
ret
GetMoneyAccount:
GetCoinsAccount:
call GetScriptByte
and a
ld de, wMoney ; YOUR_MONEY
ld de, wCoins ; YOUR_COINS
ret z
ld de, wMomsMoney ; MOMS_MONEY
ld de, wMomsCoins ; MOMS_COINS
ret
LoadMoneyAmountToMem:
ld bc, hMoneyTemp
LoadCoinsAmountToMem:
ld bc, hCoinsTemp
push bc
call GetScriptByte
ld [bc], a
@@ -1837,14 +1837,14 @@ Script_takechips:
Script_checkchips:
call LoadChipAmountToMem
farcall CheckChips
jr CompareMoneyAction
jr CompareCoinsAction
LoadChipAmountToMem:
call GetScriptByte
ldh [hMoneyTemp + 1], a
ldh [hCoinsTemp + 1], a
call GetScriptByte
ldh [hMoneyTemp], a
ld bc, hMoneyTemp
ldh [hCoinsTemp], a
ld bc, hCoinsTemp
ret
Script_checktime: