summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMajorAgnostic <68892400+MajorAgnostic@users.noreply.github.com>2021-02-28 02:30:26 -0500
committerMajorAgnostic <68892400+MajorAgnostic@users.noreply.github.com>2021-02-28 02:30:26 -0500
commitc13414fb81b403a2513a30e3261936d6d7cba99b (patch)
treea32b505c49ef4cde906c35d2f5a42f813a3136b3
parent6e099d8eadd8ed45b836c36b60b76f8354c27d53 (diff)
Added second section for removing `endifjustbattled` and touched up generally
-rw-r--r--Improve-the-trainer-rematch-system.md36
1 files changed, 28 insertions, 8 deletions
diff --git a/Improve-the-trainer-rematch-system.md b/Improve-the-trainer-rematch-system.md
index 3ade600..02ab9f1 100644
--- a/Improve-the-trainer-rematch-system.md
+++ b/Improve-the-trainer-rematch-system.md
@@ -1,14 +1,17 @@
-This tutorial aims to remove the fight count check that the trainer rematch system performs before selecting a 'rematchable' trainer's party. First, I think it useful to provide a brief primer on the party selection component of the rematch system, what exactly we will change, and why this is desirable.
+This tutorial aims to improve the rematch system by removing the fight count check that the trainer rematch system performs before selecting a 'rematchable' trainer's party and by making trainers automatically offer their phone number after first battling them. First, I think it useful to provide a brief primer on the rematch system, what exactly we will change, and why the changes may be desirable.
Before a rematch, the Pokemon Crystal rematch system performs two checks: it initially looks in memory for a count that is based on which of the rematchable trainer's parties you have last defeated, then it checks whether you have reached a certain point in the game. Upon first defeating a rematchable trainer, a count of 1 will be stored in memory, followed by a count of 2 once you defeat the first rematch party, etc. However, the first rematch party will not load unless you have also reached a certain point in the game, determined by either a location (flypoint check) or an event being cleared (event flag check).
-In this tutorial, we will use Schoolboy Alan on Route 36 as an example. In order to rematch him a second time, you must have defeated him in the first rematch battle (storing a count of 2) in addition to having reached Blackthorn. Say that you never received a call from him by the time you have reached Blackthorn (a common scenario), so you never defeated him in a rematch. This means that, since you cannot load the required count (2), it does not matter whether you have reached Blackthorn or not; you must fight Alan's first rematch party, which will likely be thoroughly underleveled relative to your party.
+In this tutorial, we will use Schoolboy Alan on Route 36 as an example. In order to rematch him a second time, you must have defeated him in the first rematch battle (storing a count of 2) in addition to having reached Blackthorn. Say that you never received a rematch call from him by the time you have reached Blackthorn (a common scenario), so you never defeated him in a rematch. This means that, since you cannot load the required count (2), it does not matter whether you have reached Blackthorn or not; you must fight Alan's first rematch party, which will likely be thoroughly underleveled relative to your party.
-We will resolve this by removing the fight count check entirely, thus checking only for the player's game progress in determining the rematch party that will be loaded. This will allow for rematch trainers to be much closer to the player's level even if they have not been defeated in a rematch before. Despite the impression perhaps left by my lengthy preamble, this is actually very simple to do.
+We will resolve this by removing the fight count check entirely, thus checking only for the player's game progress in determining the rematch party that will be loaded. This will allow for rematch trainers to be much closer to the player's level even if they have not been defeated in a rematch before.
+
+Additionally, it is mildly annoying to have to talk to trainers after battling them for the first time in order to obtain their numbers. If you do not know which trainers offer their phone numbers, then you either have to talk to every trainer after battle or look up a guide, so it is quite convenient to have the rematch trainers load the 'phone number offer' text immediately after battle. Despite the impression perhaps left by my lengthy preamble, these changes are actually very simple to make.
## Contents
1. [Remove the fight count check](#1-remove-the-fight-count-check)
-2. [Tips](#2-tips)
+2. [Make trainers automatically offer their phone number after battle](#2-autooffer)
+3. [Tips](#3-tips)
## 1. Remove the fight count check
@@ -45,11 +48,28 @@ The code to be changed is in the map file where the trainer is located - Route 3
end
```
-And done! You will need to edit the equivalent code in each map file for every trainer that you want to have ignore the fight count check. This is technically all that is required to make the change, although you may want to clean up the code by removing the "loadmem wAlanFightCount" line in the edited code as well as from each ".LoadFight" just below it, since they are now useless.
+The script no longer checks for the count using `readmem`, thus the corresponding functions are no longer necessary; the code will simply perform the event/flag checks in order. You will need to edit the equivalent code in each map file for every trainer that you want to have ignore the fight count check.
+
+This is technically all that is required, although you may want to clean up the code by removing the `loadmem wAlanFightCount` line in the edited code as well as from each `.LoadFight` just below it, since they are now useless.
+
+## 2. Make trainers automatically offer their phone number after battle
+We will accomplish this by removing every instance of `endifjustbattled` (simply ends the script after battle, which we don't want) in every rematch script. This forces rematch trainers to automatically offer their phone number after battle, rather than requiring the player to speak to trainers after battle to obtain it. Simply do the following:
+
+```diff
+TrainerSchoolboyAlan1:
+ trainer SCHOOLBOY, ALAN1, EVENT_BEAT_SCHOOLBOY_ALAN, SchoolboyAlan1SeenText, SchoolboyAlan1BeatenText, 0, .Script
+
+.Script:
+ loadvar VAR_CALLERID, PHONE_SCHOOLBOY_ALAN
+- endifjustbattled
+ opentext
+```
+
+Again, you will need remove this code from every rematch trainer script. And that's it!
-## 2. Tips
-The events that are checked in order to determine which party to load can be easily modified by swapping a checkflag _____ or checkevent ______ with any other listed in either the flypoints or event_flags asm files. This is especially useful if you wish to add rematch parties or simply upgrade rematch parties more frequently, progression-wise.
+## 3. Tips
+The events that are checked in order to determine which party to load can be easily modified by swapping a `checkflag` ______ or `checkevent` ______ with any other listed in either [data/maps/flypoints.asm](../blob/master/data/maps/flypoints.asm) or [constants/event_flags.asm](../blob/master/constants/event_flags.asm). This is especially useful if you wish to add rematch parties or simply upgrade rematch parties more frequently, progression-wise.
-Also, when modifying rematch parties, keep in mind that not all of them correspond to the map file code as neatly as they do for Schoolboy Alan, where ALAN1 is loaded for the initial fight, ALAN2 for the first rematch, ALAN3 for the second rematch, etc. For example, some will load TRAINERNAME3 for the initial fight, so you must make sure that you enter the initial party data (in trainers/parties.asm) in the field for the given trainer's third party; generally, TRAINERNAME3 will correspond to the third field for a given trainer starting from the top of the parties file. The exact trainer that is loaded is indicated below each .Loadfight__ (directly below the code we edited), for example: "loadtrainer SCHOOLBOY, ALAN2".
+Also, when modifying rematch parties, keep in mind that not all of them correspond to the map file code as neatly as they do for Schoolboy Alan, where ALAN1 is loaded for the initial fight, ALAN2 for the first rematch, ALAN3 for the second rematch, etc. For example, some will load TRAINERNAME3 for the initial fight, so you must make sure that you enter the initial party data (in trainers/parties.asm) in the field for the given trainer's third party; generally, TRAINERNAME3 will correspond to the third field for a given trainer name starting from the top of the parties file. The exact trainer that is loaded is indicated below each `.Loadfight` (directly below the code we edited). For example: `loadtrainer SCHOOLBOY, ALAN2`.
Finally, for a list of rematchable trainers to help you find and change all of their codes, see the third header (Phone) on this page: [https://www.serebii.net/crystal/pokegear.shtml](https://www.serebii.net/crystal/pokegear.shtml) \ No newline at end of file