Restore dedicated overworld poison faint removal path

This commit is contained in:
robjlyons
2026-02-19 10:14:39 +00:00
parent 1264fd42bc
commit d340da9ad8
3 changed files with 13 additions and 34 deletions

View File

@@ -1194,18 +1194,13 @@ EnsureEncounterCatchFlagsInitialized:
ret
EnableEncounterCatchSRAM_Battle:
ld a, $0A
ld [$0000], a ; enable SRAM
ld a, $01
ld [$6000], a ; MBC1: RAM banking mode (harmless on others)
ld a, BANK(sMapEncounterCatchFlags)
ld [$4000], a ; select SRAM bank that holds the flags
ret
ld a, BANK(sMapEncounterCatchFlags)
call OpenSRAM
ret
DisableEncounterCatchSRAM_Battle:
xor a
ld [$0000], a ; disable SRAM
ret
call CloseSRAM
ret
; asks if you want to use next mon
; stores whether you ran in C flag

View File

@@ -148,6 +148,7 @@ ApplyOutOfBattlePoisonDamage:
ld [wOutOfBattleBlackout], a
ret
PoisonFaintedMonRanAwayText:
text_far _PokemonRanAwayBadTrainingText
text_end
@@ -176,6 +177,7 @@ HandlePoisonFaintedMonRanAway:
.done
ret
Func_c4c7:
ld a, [wStepCounter]
and a

View File

@@ -117,7 +117,7 @@ ItemUseBall:
jr nz, .skipEncounterLimitCheck
ld a, [wWildEncounterCanCatch]
and a
jp z, ThrowBallAtUsedEncounter
jp z, ItemUseNotTime
.skipEncounterLimitCheck
; If this is for the old man battle, skip checking if the party & box are full.
@@ -2590,17 +2590,6 @@ ThrowBallAtTrainerMon:
call PrintText
jr RemoveUsedItem
ThrowBallAtUsedEncounter:
call RunDefaultPaletteCommand
call LoadScreenTilesFromBuffer1 ; restore saved screen
call Delay3
ld a, TOSS_ANIM
ld [wAnimationID], a
predef MoveAnimation ; do animation
ld hl, ThrowBallAtUsedEncounterText
call PrintText
jr RemoveUsedItem
NoCyclingAllowedHere:
ld hl, NoCyclingAllowedHereText
jr ItemUseFailed
@@ -2637,10 +2626,6 @@ ThrowBallAtTrainerMonText2:
text_far _ThrowBallAtTrainerMonText2
text_end
ThrowBallAtUsedEncounterText:
text_far _ThrowBallAtUsedEncounterText
text_end
MarkWildEncounterCatchUsedItem:
push af
ld a, [wBattleType]
@@ -2669,16 +2654,13 @@ MarkWildEncounterCatchUsedItem:
ret
EnableEncounterCatchSRAM_Item:
ld a, $0A
ld [$0000], a ; enable SRAM
xor a
ld [$4000], a ; SRAM bank 0
ret
ld a, BANK(sMapEncounterCatchFlags)
call OpenSRAM
ret
DisableEncounterCatchSRAM_Item:
xor a
ld [$0000], a ; disable SRAM
ret
call CloseSRAM
ret
NoCyclingAllowedHereText:
text_far _NoCyclingAllowedHereText