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

@ -11,8 +11,8 @@
const ENGINE_DAY_CARE_MAN_HAS_MON
; wDayCareLady
const ENGINE_DAY_CARE_LADY_HAS_MON
; wMomSavingMoney
const ENGINE_MOM_SAVING_MONEY
; wMomSavingCoins
const ENGINE_MOM_SAVING_COINS
const ENGINE_MOM_ACTIVE
; wStatusFlags
const ENGINE_POKEDEX

View File

@ -34,10 +34,10 @@ DEF NOON_HOUR EQU 12 ; 12 PM
DEF MAX_DAYS EQU 36 * 7 ; 252
; significant money values
DEF START_MONEY EQU 3000
DEF MOM_MONEY EQU 2300
DEF MAX_MONEY EQU 999999
; significant coins values
DEF START_COINS EQU 3000
DEF MOM_COINS EQU 2300
DEF MAX_COINS EQU 999999
DEF MAX_CHIPS EQU 9999
; link record

View File

@ -11,12 +11,12 @@ DEF NUM_STRING_BUFFERS EQU const_value
DEF STRING_BUFFER_LENGTH EQU 19
; checkmoney/takemoney accounts
; checkcoins/takecoins accounts
const_def
const YOUR_MONEY ; 0
const MOMS_MONEY ; 1
const YOUR_COINS ; 0
const MOMS_COINS ; 1
; checkmoney/checkchips return values
; checkcoins/checkchips return values
const_def
const HAVE_MORE ; 0
const HAVE_AMOUNT ; 1

View File

@ -36,12 +36,12 @@ DEF OW_TEXTBOX_FRAME_TILES EQU 14
; PrintNum bit flags
const_def 5
const PRINTNUM_MONEY_F ; 5
const PRINTNUM_COINS_F ; 5
const PRINTNUM_LEFTALIGN_F ; 6
const PRINTNUM_LEADINGZEROS_F ; 7
; PrintNum arguments (see engine/math/print_num.asm)
DEF PRINTNUM_MONEY EQU 1 << PRINTNUM_MONEY_F
DEF PRINTNUM_COINS EQU 1 << PRINTNUM_COINS_F
DEF PRINTNUM_LEFTALIGN EQU 1 << PRINTNUM_LEFTALIGN_F
DEF PRINTNUM_LEADINGZEROS EQU 1 << PRINTNUM_LEADINGZEROS_F

View File

@ -2,7 +2,7 @@
rsreset
DEF TRNATTR_ITEM1 rb ; 0
DEF TRNATTR_ITEM2 rb ; 1
DEF TRNATTR_BASEMONEY rb ; 2
DEF TRNATTR_BASECOINS rb ; 2
DEF TRNATTR_AI_MOVE_WEIGHTS rw ; 3
DEF TRNATTR_AI_ITEM_SWITCH rw ; 5
DEF NUM_TRAINER_ATTRIBUTES EQU _RS

View File

@ -212,13 +212,13 @@ DEF SPAWN_RED EQU 2
const STATUSFLAGS2_REACHED_GOLDENROD_F ; 6
const STATUSFLAGS2_ROCKETS_IN_MAHOGANY_F ; 7
; wMomSavingMoney::
DEF MOM_SAVING_SOME_MONEY_F EQU 0
DEF MOM_SAVING_HALF_MONEY_F EQU 1
DEF MOM_SAVING_ALL_MONEY_F EQU 2
; wMomSavingCoins::
DEF MOM_SAVING_SOME_COINS_F EQU 0
DEF MOM_SAVING_HALF_COINS_F EQU 1
DEF MOM_SAVING_ALL_COINS_F EQU 2
DEF MOM_ACTIVE_F EQU 7
DEF MOM_SAVING_MONEY_MASK EQU (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF_MONEY_F) | (1 << MOM_SAVING_ALL_MONEY_F)
DEF MOM_SAVING_COINS_MASK EQU (1 << MOM_SAVING_SOME_COINS_F) | (1 << MOM_SAVING_HALF_COINS_F) | (1 << MOM_SAVING_ALL_COINS_F)
; wJohtoBadges::
const_def

View File

@ -20,8 +20,8 @@ EngineFlags:
engine_flag wDayCareMan, DAYCAREMAN_HAS_MON_F
engine_flag wDayCareLady, DAYCARELADY_HAS_MON_F
engine_flag wMomSavingMoney, MOM_SAVING_SOME_MONEY_F
engine_flag wMomSavingMoney, MOM_ACTIVE_F
engine_flag wMomSavingCoins, MOM_SAVING_SOME_COINS_F
engine_flag wMomSavingCoins, MOM_ACTIVE_F
engine_flag wStatusFlags, STATUSFLAGS_POKEDEX_F
engine_flag wStatusFlags, STATUSFLAGS_UNOWN_DEX_F

View File

@ -85,8 +85,8 @@ SpecialsPointers::
add_special BillsGrandfather
add_special CheckPokerus
add_special DisplayChipCaseBalance
add_special DisplayMoneyAndChipBalance
add_special PlaceMoneyTopRight
add_special DisplayCoinsAndChipBalance
add_special PlaceCoinsTopRight
add_special CheckForLuckyNumberWinners
add_special CheckLuckyNumberShowFlag
add_special ResetLuckyNumberShowFlag

View File

@ -1,5 +1,5 @@
MACRO momitem
; money to trigger, cost, kind, item
; coins to trigger, cost, kind, item
dt \1
dt \2
db \3, \4

View File

@ -1,9 +1,9 @@
BattleText:: ; used only for BANK(BattleText)
BattleText_PlayerPickedUpPayDayMoney:
BattleText_PlayerPickedUpPayDayCoins:
text "<PLAYER> picked up"
line "<COIN>@"
text_decimal wPayDayMoney, 3, 6
text_decimal wPayDayCoins, 3, 6
text "!"
prompt
@ -166,7 +166,7 @@ BattleText_EnemyMonFainted:
line "fainted!"
prompt
GotMoneyForWinningText:
GotCoinsForWinningText:
text "<PLAYER> got <COIN>@"
text_decimal wBattleReward, 3, 6
text_start

View File

@ -359,9 +359,9 @@ _MomFoundAnItemText::
line "item shopping, so"
prompt
_MomBoughtWithYourMoneyText::
_MomBoughtWithYourCoinsText::
text "I bought it with"
line "your money. Sorry!"
line "your coins. Sorry!"
prompt
_MomItsInPCText::
@ -1553,18 +1553,19 @@ _MomLeavingText1::
line "for you?"
para "I know! I'll save"
line "money for you."
line "coins for you."
para "On a long journey,"
line "money's important."
line "coins are"
cont "important."
para "Do you want me to"
line "save your money?"
line "save your coins?"
done
_MomLeavingText2::
text "OK, I'll take care"
line "of your money."
line "of your coins."
para "<……><……><……>"
prompt
@ -1579,7 +1580,7 @@ _MomLeavingText3::
para "Now, go on!"
done
_MomIsThisAboutYourMoneyText::
_MomIsThisAboutYourCoinsText::
text "Hi! Welcome home!"
line "You're trying very"
cont "hard, I see."
@ -1588,7 +1589,7 @@ _MomIsThisAboutYourMoneyText::
line "room tidy."
para "Or is this about"
line "your money?"
line "your coins?"
done
_MomBankWhatDoYouWantToDoText::
@ -1596,19 +1597,19 @@ _MomBankWhatDoYouWantToDoText::
line "to do?"
done
_MomStoreMoneyText::
_MomStoreCoinsText::
text "How much do you"
line "want to save?"
done
_MomTakeMoneyText::
_MomTakeCoinsText::
text "How much do you"
line "want to take?"
done
_MomSaveMoneyText::
_MomSaveCoinsText::
text "Do you want to"
line "save some money?"
line "save some coins?"
done
_MomHaventSavedThatMuchText::
@ -1631,20 +1632,21 @@ _MomNotEnoughRoomInBankText::
line "that much."
prompt
_MomStartSavingMoneyText::
_MomStartSavingCoinsText::
text "OK, I'll save your"
line "money. Trust me!"
line "coins. Trust me!"
para "<PLAYER>, stick"
line "with it!"
done
_MomStoredMoneyText::
text "Your money's safe"
line "here! Get going!"
_MomStoredCoinsText::
text "Your coins are"
line "safe here! Get"
cont "going!"
done
_MomTakenMoneyText::
_MomTakenCoinsText::
text "<PLAYER>, don't"
line "give up!"
done
@ -1804,9 +1806,9 @@ _HaveNoRoomText::
line "for it."
prompt
_NotEnoughMoneyText::
_NotEnoughCoinsText::
text "You don't have"
line "enough money."
line "enough coins."
prompt
_OhFineThenText::

View File

@ -380,7 +380,7 @@ _MartFinalPriceText::
text_ram wStringBuffer2
text "(S)"
line "will be <COIN>@"
text_decimal hMoneyTemp, 3, 6
text_decimal hCoinsTemp, 3, 6
text "."
done
@ -409,7 +409,7 @@ _HerbalLadyFinalPriceText::
text_ram wStringBuffer2
text "(S)"
line "will be <COIN>@"
text_decimal hMoneyTemp, 3, 6
text_decimal hCoinsTemp, 3, 6
text "."
done
@ -423,9 +423,9 @@ _HerbalLadyPackFullText::
line "full, dear."
done
_HerbalLadyNoMoneyText::
_HerbalLadyNoCoinsText::
text "Hehehe… You don't"
line "have the money."
line "have the coins."
done
_HerbalLadyComeAgainText::
@ -448,7 +448,7 @@ _BargainShopFinalPriceText::
text_ram wStringBuffer2
text " costs"
line "<COIN>@"
text_decimal hMoneyTemp, 3, 6
text_decimal hCoinsTemp, 3, 6
text ". Want it?"
done
@ -492,7 +492,7 @@ _PharmacyFinalPriceText::
text_ram wStringBuffer2
text "(S)"
line "will cost <COIN>@"
text_decimal hMoneyTemp, 3, 6
text_decimal hCoinsTemp, 3, 6
text "."
done
@ -505,9 +505,9 @@ _PharmacyPackFullText::
line "more space."
done
_PharmacyNoMoneyText::
_PharmacyNoCoinsText::
text "Huh? That's not"
line "enough money."
line "enough coins."
done
_PharmacyComeAgainText::
@ -527,7 +527,7 @@ _MartSellHowManyText::
_MartSellPriceText::
text "I can pay you"
line "<COIN>@"
text_decimal hMoneyTemp, 3, 6
text_decimal hCoinsTemp, 3, 6
text "."
para "Is that OK?"
@ -543,9 +543,9 @@ _MartThanksText::
line "Thank you!"
done
_MartNoMoneyText::
_MartNoCoinsText::
text "You don't have"
line "enough money."
line "enough coins."
done
_MartPackFullText::
@ -569,7 +569,7 @@ _MartAskMoreText::
_MartBoughtText::
text "Got <COIN>@"
text_decimal hMoneyTemp, 3, 6
text_decimal hCoinsTemp, 3, 6
text " for"
line "@"
text_ram wStringBuffer2

View File

@ -331,9 +331,9 @@ ChipVendor_Buy500ChipsText:
line "are 500 chips."
done
ChipVendor_NotEnoughMoneyText:
ChipVendor_NotEnoughCoinsText:
text "You don't have"
line "enough money."
line "enough coins."
done
ChipVendor_ChipCaseFullText:

View File

@ -123,13 +123,13 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii
## `$21`: <code>checkitem <i>item_id</i></code>
## `$22`: <code>givemoney <i>account</i>, <i>value</i></code>
## `$22`: <code>givecoins <i>account</i>, <i>value</i></code>
## `$23`: <code>takemoney <i>account</i>, <i>value</i></code>
## `$23`: <code>takecoins <i>account</i>, <i>value</i></code>
## `$24`: <code>checkmoney <i>account</i>, <i>value</i></code>
## `$24`: <code>checkcoins <i>account</i>, <i>value</i></code>
## `$25`: <code>givechips <i>value</i></code>
@ -204,9 +204,9 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii
## `$3C`: <code>warp <i>map</i>, <i>x</i>, <i>y</i></code>
## `$3D`: <code>getmoney <i>string_buffer</i>, <i>account</i></code>
## `$3D`: <code>getcoins <i>string_buffer</i>, <i>account</i></code>
<code>GetStringBuffer(<i>string_buffer</i>) = PrintNum(GetMoneyAccount(<i>account</i>))</code>
<code>GetStringBuffer(<i>string_buffer</i>) = PrintNum(GetCoinsAccount(<i>account</i>))</code>
## `$3E`: <code>getchips <i>string_buffer</i></code>

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:

Some files were not shown because too many files have changed in this diff Show More