Some progress on the Chief fight

Right now I'm facing a weird bug where if you enter, you get the quote, but the fight doesn't start and it happens while you're stepping for some reason. Very odd.
This commit is contained in:
Llinos Evans 2023-04-24 23:22:35 +01:00
parent 59a9bdb62e
commit ca1cc6af90
9 changed files with 186 additions and 6 deletions

View file

@ -1,6 +1,113 @@
; Much of this is a recoded version of the Champion's room, which serves the same purpose.
SilphGauntlet7F_Script:
jp EnableAutoTextBoxDrawing
call EnableAutoTextBoxDrawing
ld hl, SilphGauntlet7F_ScriptPointers
ld a, [wSilphGauntlet7FCurScript]
jp CallFunctionInTable
ResetChiefScript:
xor a
ld [wJoyIgnore], a
ld [wSilphGauntlet7FCurScript], a
ret
SilphGauntlet7F_ScriptPointers:
;dw ChiefScript0
dw ChiefScript1
dw ChiefScript2
dw ChiefScript3
ChiefScript0:
ret
ChiefScript1:
ld a, $ff
ld [wJoyIgnore], a
ld hl, wSimulatedJoypadStatesEnd
ld de, ChiefEntrance_RLEMovement
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $2
ld [wSilphGauntlet7FCurScript], a
ret
ChiefEntrance_RLEMovement:
db D_UP, 4
db -1 ; end
ChiefScript2:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
call Delay3
xor a
ld [wJoyIgnore], a
ld hl, wOptions
res 7, [hl] ; Turn on battle animations like with Blue
ld a, $1
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld hl, wd72d
set 6, [hl]
set 7, [hl]
ld hl, ChiefDefeatedText
ld de, ChiefVictoryText
call SaveEndBattleTextPointers
ld a, OPP_CHIEF
ld [wCurOpponent], a
ld a, 1
ld [wTrainerNo], a
ld [wIsTrainerBattle], a
ld a, $1
xor a
ldh [hJoyHeld], a
ld a, $3
ld [wSilphGauntlet7FCurScript], a
ret
ChiefScript3:
ld a, [wIsInBattle]
cp $ff
jp z, ResetChiefScript
xor a
ld [wIsTrainerBattle], a
call UpdateSprites
SetEvent EVENT_BEAT_CHIEF
ld a, $f0
ld [wJoyIgnore], a
ld a, $1
ldh [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $1
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
ld a, $4
ld [wSilphGauntlet7FCurScript], a
ret
SilphGauntlet7F_TextPointers:
dw ChiefMonologue
ChiefMonologue:
text_far _ChiefMonologue
text_end
ChiefDefeatedText:
text_far _ChiefDefeatedText
text_end
ChiefVictoryText:
text_far _ChiefVictoryText
text_end
ChiefAfterBattleText:
text_far _ChiefAfterBattleText
text_end
text_end