Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to increase MAX_MONEY #4943

Merged
merged 18 commits into from
Jul 13, 2024

Conversation

pkmnsnfrn
Copy link
Collaborator

Description

Screenshot of the Trainer Card with max money

  • Allows the user to increase MAX_MONEY to any number up to INT_MAX, while menus and texts will adjust to match.
  • Refactors CountDigits to work with values greater than 100M.

Usage

MAX_MONEY

In include/money.h, developers can change MAX_MONEY to any integer less than 2147483648.

Testing

Clean Branch

You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:

Patch

wget https://files.catbox.moe/1urr6w.patch -O increaseMoney.patch ; git apply increaseMoney.patch ; rm increaseMoney.patch

Repo

git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion increaseMoney

Manual Tests

After replicating the branch, to recreate my testing environment, you can either directly download the debug script and config file, or manually create the changes.

Download

MAX_MONEY Command
9 wget https://files.catbox.moe/ourb5p.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
99 wget https://files.catbox.moe/pbkxuj.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
999 wget https://files.catbox.moe/l0gyte.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
9999 wget https://files.catbox.moe/l1n9g8.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
99999 wget https://files.catbox.moe/2b4bw0.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
999999 wget https://files.catbox.moe/e831bv.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
9999999 wget https://files.catbox.moe/4ehple.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
99999999 wget https://files.catbox.moe/9yhna4.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
999999999 wget https://files.catbox.moe/g5yanb.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc
INT_MAX wget https://files.catbox.moe/f82nww.h -O include/money.h && wget https://files.catbox.moe/0kor2h.h -O src/data/items.h && wget https://files.catbox.moe/wsd3z6.inc -O data/scripts/debug.inc

Manual Testing

Verified Scenarios

All videos show the player:

  • opens and then closes Trainer Card
  • runs Debug Script 1
  • talks to the Ever Grande shopkeeper
  • sells 4 Big Nugget
  • sells 1 Potion
  • buys 1 Ultra Ball
  • opens Trainer Card

MAX_MONEY == 9

9.mp4

MAX_MONEY == 99

99.mp4

MAX_MONEY == 999

999.mp4

MAX_MONEY == 9999

9999.mp4

MAX_MONEY == 99999

99999.mp4

MAX_MONEY == 999999

999999.mp4

MAX_MONEY == 9999999

999999.mp4

MAX_MONEY == 99999999

9999999.mp4

MAX_MONEY == 999999999

99999999.mp4

MAX_MONEY == INT_MAX

int.mp4

People who collaborated with me in this PR

This feature was originally written by @DizzyEggg.

Features this PR does NOT handle:

n/a

Discord Contact Info

I am pkmnsnfrn on Discord.

@pkmnsnfrn
Copy link
Collaborator Author

Explicitly requesting the eyes of @DizzyEggg and @mrgriffin , and I'm happy to wait until they have time or they refuse.

@Bassoonian
Copy link
Collaborator

You have tabs instead of spaces in the vast majority of your files

@pkmnsnfrn
Copy link
Collaborator Author

You have tabs instead of spaces in the vast majority of your files
FUCK

f1f285e

@Bassoonian Bassoonian merged commit 522a8ba into rh-hideout:upcoming Jul 13, 2024
1 check passed
Copy link
Collaborator

@mrgriffin mrgriffin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see shrinking fonts being used! I think you've summoned me to comment on those bits, and I don't see anything wrong :)

Comment on lines +159 to +160
if (numDigits > 8)
PrependFontIdToFit(gStringVar4, txtPtr + 1 + numDigits, FONT_NORMAL, 54);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I was going to say that PrependFontIdToFit should work for any number of digits (it just doesn't do anything if the text already fits), but perhaps I'm wrong due to the alignment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the spaces fuck it all up, and when I remove the spaces and try to manually align, the text doesn't get overwritten if you change the number of digits mid transaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants