diff --git a/engine/battle/core.asm b/engine/battle/core.asm index f13ed4b7..9f45c390 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -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 diff --git a/engine/events/poison.asm b/engine/events/poison.asm index 9d87b3ca..a6aa6789 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -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 diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 1f6b4d34..4388e398 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -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