summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Make-the-Lottery-Corner-generate-a-lucky-number-daily-instead-of-weekly.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/Make-the-Lottery-Corner-generate-a-lucky-number-daily-instead-of-weekly.md b/Make-the-Lottery-Corner-generate-a-lucky-number-daily-instead-of-weekly.md
index cfb8667..1a7eb0f 100644
--- a/Make-the-Lottery-Corner-generate-a-lucky-number-daily-instead-of-weekly.md
+++ b/Make-the-Lottery-Corner-generate-a-lucky-number-daily-instead-of-weekly.md
@@ -1,16 +1,16 @@
-In generation 2, the Lottery Corner is located in the 1st floor of the Radio Tower and we can get a random ID number by either talking to a recepcionist or listening to it on the Lucky Channel every Friday, and therefore try our luck to get a prize. As we know, in future generations this number is generated _daily_ instead of weekly, so the objective of this tutorial will be to generate this number daily so that we can try our luck more often.
+In generation 2, the Lottery Corner is located in the 1st floor of the Radio Tower and we can get a random ID number by either talking to a recepcionist or listening to the Lucky Number Show on the Lucky Channel every Friday. As we know, in future generations this number is generated _daily_ instead of weekly, so the objective of this tutorial will be to make it behave like in modern generations so that we can try our luck more often.
## Contents
1. [Reset `wLuckyNumberShowFlag` daily instead of weekly](#1-reset-wluckynumbershowflag-daily-instead-of-weekly)
2. [Change the behavior of both `CheckLuckyNumberShowFlag` and `ResetLuckyNumberShowFlag`](#2-change-the-behavior-of-both-checkluckynumbershowflag-and-resetluckynumbershowflag)
-3. [Edit the recepcionist's script](#3-edit-the-recepcionists-script)
+3. [Modify the recepcionist's script](#3-modify-the-recepcionists-script)
4. [Edit the Lucky Number Show](#4-edit-the-lucky-number-show)
## 1. Reset `wLuckyNumberShowFlag` daily instead of weekly
-There's a variable in WRAM called `wLuckyNumberShowFlag` which contains the flag that gets set when we get a prize from the Lottery Corner and gets reset every Friday. This flag is called `LUCKYNUMBERSHOW_GAME_OVER_F`, which corresponds to bit 0 of `wLuckyNumberShowFlag`. We'll make it reset daily by going to [engine/overworld/time.asm](../blob/master/engine/overworld/time.asm) and editing `CheckDailyResetTimer`:
+There's a variable in WRAM called `wLuckyNumberShowFlag` which contains the flag that gets set when we get a prize from the Lottery Corner and gets reset every Friday. This flag is called `ENGINE_LUCKY_NUMBER_SHOW`, which corresponds to bit 0 of `wLuckyNumberShowFlag`. We'll make it reset daily by going to [engine/overworld/time.asm](../blob/master/engine/overworld/time.asm) and editing `CheckDailyResetTimer`:
```diff
CheckDailyResetTimer::
@@ -32,7 +32,7 @@ With this change, the contents of `wLuckyNumberShowFlag` will get reset every da
## 2. Change the behavior of both `CheckLuckyNumberShowFlag` and `ResetLuckyNumberShowFlag`
-In [maps/RadioTower1F.asm](../blob/master/maps/RadioTower1F.asm), there are two special event commands that get called whenever we either talk to the recepcionist or listen to the Lucky Number Show: `CheckLuckyNumberShowFlag` and `ResetLuckyNumberShowFlag`. The first one checks if the flag is set and how many days are left until the next Friday; the second resets the flag when it's Friday again and also generates the random number. Since we managed to reset `wLuckyNumberShowFlag` daily, we need to modify `ResetLuckyNumberShowFlag` so that it only generates our desired random number. Go to
+In [maps/RadioTower1F.asm](../blob/master/maps/RadioTower1F.asm), there are two special event commands that get called whenever we either talk to the recepcionist or listen to the Lucky Number Show: `CheckLuckyNumberShowFlag` and `ResetLuckyNumberShowFlag`. The first one checks if the flag is set or not and how many days are left until the next Friday; the second resets the flag when it's Friday again and also generates the random number. Since we managed to reset `wLuckyNumberShowFlag` daily, we need to modify `ResetLuckyNumberShowFlag` so that it only generates our desired random number. Go to
[engine/events/specials.asm](../blob/engine/events/specials.asm):
```diff
@@ -55,7 +55,7 @@ CheckLuckyNumberShowFlag:
+ ret
```
-## 3. Edit the recepcionist's script
+## 3. Modify the recepcionist's script
Go to [maps/RadioTower1F.asm](../blob/master/maps/RadioTower1F.asm):
@@ -74,7 +74,7 @@ RadioTower1FLuckyNumberManScript:
...
```
-Now the script will first check the flag's status and, in case it's reset, proceed to generate the new daily random number. But you might be wondering "Why did we modify `CheckLuckyNumberShowFlag` in the first place if we ended up removing it?" Because we'll need this new version for the Lucky Number Show, which we're going to edit in the next step!
+Now the script will first check the flag's status and, in case it's reset, proceed to generate the new daily random number. But you might be wondering "Why did we modify `CheckLuckyNumberShowFlag` in the first place if we ended up removing it from the script?" Because we'll need this new version for the Lucky Number Show, which we're going to edit in the next step!
## 4. Edit the Lucky Number Show
@@ -91,7 +91,7 @@ LuckyNumberShow1:
...
```
-Here we follow a logic similar to the previous step: `CheckLuckyNumberShowFlag` copies the value of the `LUCKYNUMBERSHOW_GAME_OVER_F` flag into the Z flag and if it's set (Z = 1, or NZ), we jump to `.dontreset` so we don't reset the lucky number yet; if the flag is reset then it means it's a new day and we can safely reset the number.
+Here we follow a logic similar to the previous step: `CheckLuckyNumberShowFlag` copies the value of the `ENGINE_LUCKY_NUMBER_SHOW` flag into the Z flag and if it's set (Z = 1, or NZ), we jump to `.dontreset` so we don't reset the lucky number yet; if the flag is reset then it means it's a new day and we can safely reset the number.
-And that's it! Now the Lucky Number Show will generate a lucky number daily and we can get it by either talking to the recepcionist or listening to the show, so go try your luck and get that prize! (And if you don't get it, don't worry, you still have the next day). \ No newline at end of file
+And that's it! Now the Lucky Number Show will generate a lucky number daily and we can get it by either talking to the recepcionist or listening to the show, so go try your luck and get a prize! (And if you don't get it, don't worry, you can now try the next day). ;-) \ No newline at end of file