From 7ebb4d02a4dde4c0128d50a6d5e96e5d05b5a716 Mon Sep 17 00:00:00 2001 From: Llinos Evans <36418502+PlagueVonKarma@users.noreply.github.com> Date: Sun, 14 May 2023 20:28:37 +0100 Subject: [PATCH] Battle Tent done! So it turns out that the code used in Factory Adventure *or* the TPP Anniversary Repository, by all accounts, should not actually work. Like, no, really, it ends up loading 0xFF as code, thus why it would always rst38. It just...doesn't...do anything. My friend Enigami, who figured out the issue, described the function as being "half-finished". We came up with a solution that results in less functionality - now it needs a free box - but it results in less load times, so maybe it's just better this way. I doubt many people will catch that many Pokemon unless they were shooting for a living dex, which is unfeasible in its current state anyway. I considered putting Bottle Caps in here, but it felt like making the game too grindy, so I changed it to just be in the Battle Tent shop with a very high price. --- README.md | 1 + data/items/prices.asm | 2 +- engine/battletentdata.asm | 2 +- scripts/BattleTent.asm | 44 ++++++++++++++++++--------------------- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 793772fc..b68ef66e 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,7 @@ Credits * dannye33 - Assisting with crysaudio implementation * erosunica - Assistance with developing Celadon University & Citrine City, plus sources for various subjects. * Chatot4444 - Assisting with gym scaling code +* Enigami - Reworking the Battle Tent's RestoreTeam code to make it work properly * ZumiIsawhat? - Restorations of beta OST * FrenchOrange - Reconstructions of various overworld beta sprites. * Helix Chamber, RacieBeep, loumilouminosus, Orchid, GBCRetro, & catstorm26 - Prototype Pokémon sprites diff --git a/data/items/prices.asm b/data/items/prices.asm index b56bcf59..79a06bca 100644 --- a/data/items/prices.asm +++ b/data/items/prices.asm @@ -76,7 +76,7 @@ ItemPrices:: bcd3 0 ; LIFT_KEY bcd3 0 ; EXP_ALL bcd3 0 ; was OLD_ROD, now CANDY_SACK. Plan to be one-of-a-kind, so 0 to discourage sale a la Master Ball. - bcd3 5000 ; was GOOD_ROD, now BOTTLE_CAP. Sells for 5000 in SV. + bcd3 9800 ; was GOOD_ROD, now BOTTLE_CAP. Sells for 5000 in SV, but making it in-line with the Stat Exp items feels right. bcd3 0 ; SUPER_ROD bcd3 0 ; PP_UP bcd3 0 ; ETHER diff --git a/engine/battletentdata.asm b/engine/battletentdata.asm index 23e454f5..f4b34333 100644 --- a/engine/battletentdata.asm +++ b/engine/battletentdata.asm @@ -207,7 +207,7 @@ BTTrainerClassList:: db ENGINEER, SPRITE_SUPER_NERD, 4 db FISHER, SPRITE_FISHER, 3 db CUE_BALL, SPRITE_HIKER, 0 - db GAMBLER, SPRITE_GAMBLER, 0 + db COOLTRAINER_F, SPRITE_COOLTRAINER_F, 0 db BEAUTY, SPRITE_BEAUTY, 7 db PSYCHIC_TR, SPRITE_YOUNGSTER, 5 db ROCKER, SPRITE_ROCKER, 4 diff --git a/scripts/BattleTent.asm b/scripts/BattleTent.asm index 71d2d332..d134b884 100644 --- a/scripts/BattleTent.asm +++ b/scripts/BattleTent.asm @@ -171,22 +171,21 @@ BattleTent_Normal: BattleTent_RestoreTeam: ld b, 3 ; remove the current 3 team +; The original Battle Tent's removeloop effectively didn't work, so Enigami replaced it with one that does. +; However, it results in the need for compromises with box functionality. +; We don't know how the code in the port managed to function - it's possible the streamed version was different. .removeloop - push bc - xor a - ld [wRemoveMonFromBox], a - ld [wWhichPokemon], a - call RemovePokemon - pop bc - dec b - jr nz, .removeloop - ld a, [wBTOrder+1] - swap a - and $7 - ld b, a - ld a, [wBoxCount] - sub b - ld c, a + push bc + xor a + ld [wRemoveMonFromBox], a + ld [wWhichPokemon], a + call RemovePokemon + pop bc + dec b + jr nz, .removeloop + ld a, [wBoxCount] + ld b, a + ld c, 0 ; withdraw all party 'mons from the box .withdloop @@ -438,11 +437,9 @@ BattleTentGuy: ld hl, BattleTentNotEnough jr c, .finalskip ; box space check - ld a, [wPartyCount] - ld b, a +; Due to the way the loops have changed, and the weird old function, the Battle Tent now requires a free box to work. ld a, [wBoxCount] - add b - cp MONS_PER_BOX + 1 + cp 1 ld hl, BattleTentNoBoxTmp jr c, .skip2 .finalskip @@ -717,14 +714,13 @@ BattleTentNotEnough: BattleTentNoBoxTmp: text "..whoops! your" line "current #MON" - cont "BOX does not" - cont "have enough" - cont "space!" + cont "BOX needs to" + cont "be empty!" para "We need to" line "store all of your" cont "party's #MON" - cont "into the box." + cont "into a BOX." para "Try changing" line "or emptying it." @@ -810,6 +806,6 @@ BattleTentGuy2_Heal: ; Battle Tent BattleTentMart:: - script_mart POTION, SUPER_POTION, HYPER_POTION, REVIVE, FULL_HEAL, POKE_DOLL, X_ATTACK, X_DEFEND, X_SPEED, X_SPECIAL + script_mart FULL_RESTORE, MAX_REVIVE, FULL_HEAL, BOTTLE_CAP, POKE_DOLL, X_ATTACK, X_DEFEND, X_SPEED, X_SPECIAL, GUARD_SPEC INCLUDE "engine/battletentdata.asm"