mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00

In RBY, there are extremely minor situations where zero damage can be dealt. These usually involve quad resists and profound level differences. To quote the disassembly: ; this only occurs if a move that would do 2 or 3 damage is 0.25x effective against the target However, Psywave is also capable of this. Thus, a new case has been added for when this occurs, which is triggered through a new WRAM entry. Easiest way to do it without having to restructure how misses are handled. This is overall minor, but it'll probably make at least one person laugh, and that's all I need.
124 lines
2 KiB
NASM
124 lines
2 KiB
NASM
DebugMenu:
|
|
IF DEF(_DEBUG)
|
|
call ClearScreen
|
|
|
|
; These debug names are used for TestBattle.
|
|
; StartNewGameDebug uses the debug names from PrepareOakSpeech.
|
|
ld hl, DebugBattlePlayerName
|
|
ld de, wPlayerName
|
|
ld bc, NAME_LENGTH
|
|
call CopyData
|
|
|
|
ld hl, DebugBattleRivalName
|
|
ld de, wRivalName
|
|
ld bc, NAME_LENGTH
|
|
call CopyData
|
|
|
|
call LoadFontTilePatterns
|
|
call LoadHpBarAndStatusTilePatterns
|
|
call ClearSprites
|
|
call RunDefaultPaletteCommand
|
|
|
|
hlcoord 5, 6
|
|
ld b, 3
|
|
ld c, 9
|
|
call TextBoxBorder
|
|
|
|
hlcoord 7, 7
|
|
ld de, DebugMenuOptions
|
|
call PlaceString
|
|
|
|
ld a, TEXT_DELAY_FAST
|
|
ld [wOptions], a
|
|
|
|
ld a, A_BUTTON | B_BUTTON | START
|
|
ld [wMenuWatchedKeys], a
|
|
xor a
|
|
ld [wMenuJoypadPollCount], a
|
|
inc a
|
|
ld [wMaxMenuItem], a
|
|
ld a, 7
|
|
ld [wTopMenuItemY], a
|
|
dec a
|
|
ld [wTopMenuItemX], a
|
|
xor a
|
|
ld [wCurrentMenuItem], a
|
|
ld [wLastMenuItem], a
|
|
ld [wMenuWatchMovingOutOfBounds], a
|
|
|
|
call HandleMenuInput
|
|
bit BIT_B_BUTTON, a
|
|
jp nz, DisplayTitleScreen
|
|
|
|
ld a, [wCurrentMenuItem]
|
|
and a ; FIGHT?
|
|
jp z, TestBattle
|
|
|
|
; DEBUG
|
|
ld hl, wd732
|
|
set 1, [hl]
|
|
jp StartNewGameDebug
|
|
|
|
DebugBattlePlayerName:
|
|
db "Tom@"
|
|
|
|
DebugBattleRivalName:
|
|
db "Juerry@"
|
|
|
|
DebugMenuOptions:
|
|
db "FIGHT"
|
|
next "DEBUG@"
|
|
ELSE
|
|
ret
|
|
ENDC
|
|
|
|
TestBattle:
|
|
.loop
|
|
call GBPalNormal
|
|
|
|
; Don't mess around
|
|
; with obedience.
|
|
ld a, 1 << BIT_EARTHBADGE
|
|
ld [wObtainedBadges], a
|
|
|
|
ld hl, wFlags_D733
|
|
set BIT_TEST_BATTLE, [hl]
|
|
|
|
; Reset the party.
|
|
ld hl, wPartyCount
|
|
xor a
|
|
ld [hli], a
|
|
dec a
|
|
ld [hl], a
|
|
|
|
; Player's Pokemon.
|
|
ld a, NIDOREIGN
|
|
ld [wcf91], a
|
|
ld a, 100
|
|
ld [wCurEnemyLVL], a
|
|
xor a
|
|
ld [wMonDataLocation], a
|
|
ld [wCurMap], a
|
|
call AddPartyMon
|
|
|
|
; This function gives you a way to waste a turn, never know when you'll need it.
|
|
; Alternatively, add a move to test.
|
|
ld hl, wPartyMon1Moves
|
|
ld a, SPLASH
|
|
ld [hli], a
|
|
|
|
; Opponent's Pokemon.
|
|
ld a, WEEDLE
|
|
ld [wCurOpponent], a
|
|
ld a, 100 ; Set the level you want here.
|
|
ld [wCurEnemyLVL], a
|
|
|
|
predef InitOpponent
|
|
|
|
; When the battle ends,
|
|
; do it all again.
|
|
ld a, 1
|
|
ld [wUpdateSpritesEnabled], a
|
|
ldh [hAutoBGTransferEnabled], a
|
|
jr .loop
|