summaryrefslogtreecommitdiff
path: root/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java
diff options
context:
space:
mode:
authortom-overton <tom.overton@outlook.com>2023-07-03 18:24:26 -0700
committerRafael Marçalo <raroma09@gmail.com>2023-07-06 16:27:24 +0100
commit4a2a4ed62c1bbe638d12896e6acf640c119e2b5e (patch)
tree418484039e7353329c0cfba6eb1f14adddb10343 /src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java
parenta7f62ba9b303e8d1429c42fa5bb3759a99888586 (diff)
HGSS: Add support for Lyra/Ethan to have 'big' Pokemon
Diffstat (limited to 'src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java')
-rwxr-xr-xsrc/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java
index 80687a9..cbc7fac 100755
--- a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java
+++ b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java
@@ -4779,12 +4779,20 @@ public class Gen4RomHandler extends AbstractDSRomHandler {
while (Gen4Constants.hgssBannedOverworldPokemon.contains(marillReplacement)) {
marillReplacement = this.random.nextInt(548) + 297;
}
+
byte[] fieldOverlay = readOverlay(romEntry.getInt("FieldOvlNumber"));
String prefix = Gen4Constants.lyraEthanMarillSpritePrefix;
int offset = find(fieldOverlay, prefix);
if (offset > 0) {
offset += prefix.length() / 2; // because it was a prefix
writeWord(fieldOverlay, offset, marillReplacement);
+ if (Gen4Constants.hgssBigOverworldPokemon.contains(marillReplacement)) {
+ // Write the constant to indicate it's big (0x208 | (20 << 10))
+ writeWord(fieldOverlay, offset + 2, 0x5208);
+ } else {
+ // Write the constant to indicate it's normal-sized (0x227 | (19 << 10))
+ writeWord(fieldOverlay, offset + 2, 0x4E27);
+ }
}
writeOverlay(romEntry.getInt("FieldOvlNumber"), fieldOverlay);