mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
Yujirou Event Scripting, half-finished
This code has a lot of problems with solutions that me and Frrf can't seem to figure out. We've taken a lot of references from Erika's Gym but we've got many bugs after Yujirou is defeated, such as one case where you end up instantly doing the rematch fight, which is insane because there's no way this can actually happen. What's committed is a fight that can be re-fought when it shouldn't.
This commit is contained in:
parent
71de0f07a5
commit
67132fefcb
10 changed files with 163 additions and 15 deletions
|
|
@ -109,6 +109,12 @@ HallofFameRoomScript1:
|
|||
ld a, HS_MANSION_GUARD
|
||||
ld [wMissableObjectIndex], a
|
||||
predef HideObject
|
||||
ld a, HS_YUJIROU
|
||||
ld [wMissableObjectIndex], a
|
||||
predef HideObject
|
||||
ld a, HS_YUJIROU_REMATCH
|
||||
ld [wMissableObjectIndex], a
|
||||
predef ShowObject
|
||||
ld a, $2
|
||||
ld [wHallOfFameCurScript], a
|
||||
ret
|
||||
|
|
|
|||
|
|
@ -1,17 +1,62 @@
|
|||
; This code has a lot of problems with solutions that barely escape me. Many references from Erika's Gym have been taken to make a fight that cannot be done again, but with a rematch later. In other words, your average gym.
|
||||
; SetEvent EVENT_BEAT_YUJIROU does not seem to be applying.
|
||||
; It's very easy to cause an infinite loop where you somehow get catapulted into the rematch fight
|
||||
; And much more.
|
||||
; Commit on 30-3-23 has a somewhat stable version of the fight.
|
||||
|
||||
ViridianPreGym_Script:
|
||||
call EnableAutoTextBoxDrawing
|
||||
ld de, ViridianPreGym_ScriptPointers
|
||||
ld a, [wViridianPreGymCurScript]
|
||||
call ExecuteCurMapScriptInTable
|
||||
ld [wViridianPreGymCurScript], a
|
||||
ret
|
||||
|
||||
LoadNames:
|
||||
ld hl, .CityName
|
||||
ld de, .LeaderName
|
||||
jp LoadGymLeaderAndCityName
|
||||
|
||||
.CityName:
|
||||
db "VIRIDIAN PRE-GYM@"
|
||||
|
||||
.LeaderName:
|
||||
db "YUJIROU@"
|
||||
|
||||
ViridianPreGymResetScripts:
|
||||
xor a
|
||||
ld [wJoyIgnore], a
|
||||
ld [wViridianPreGymCurScript], a
|
||||
ld [wCurMapScript], a
|
||||
ret
|
||||
|
||||
ViridianPreGym_ScriptPointers:
|
||||
dw EndTrainerBattle
|
||||
dw ViridianGymYujirouPostBattle
|
||||
|
||||
ViridianPreGym_TextPointers:
|
||||
dw YujirouText
|
||||
dw YujirouRematch
|
||||
|
||||
ViridianGymYujirouPostBattle:
|
||||
ld a, [wIsInBattle]
|
||||
cp $ff
|
||||
jp z, ViridianGymResetScripts
|
||||
ld a, $f0
|
||||
ld [wJoyIgnore], a
|
||||
|
||||
YujirouHasBeenBeaten:
|
||||
;text_asm
|
||||
;ld hl, YujirouAfterBattleText
|
||||
;call PrintText
|
||||
SetEvent EVENT_BEAT_YUJIROU
|
||||
jp ViridianPreGymResetScripts
|
||||
|
||||
YujirouText:
|
||||
text_asm
|
||||
|
||||
CheckEvent EVENT_BEAT_YUJIROU
|
||||
jr z, .YujirouBeaten
|
||||
|
||||
ld hl, YujirouIntro
|
||||
call PrintText
|
||||
|
||||
|
|
@ -27,18 +72,21 @@ YujirouText:
|
|||
ld [wCurOpponent], a
|
||||
ld a, 1
|
||||
ld [wTrainerNo], a
|
||||
ld [wIsTrainerBattle], a ; note to self - make him play gym music...somehow.
|
||||
ld a, $2
|
||||
ld [wViridianPreGymCurScript], a
|
||||
ld [wIsTrainerBattle], a
|
||||
ld hl, YujirouLoseText
|
||||
ld de, YujirouWinText
|
||||
call SaveEndBattleTextPointers
|
||||
jp TextScriptEnd
|
||||
ld a, $6
|
||||
ld [wViridianPreGymCurScript], a
|
||||
ld [wCurMapScript], a
|
||||
jr .done
|
||||
.done
|
||||
.YujirouBeaten
|
||||
ld hl, YujirouAfterBattleText
|
||||
call PrintText
|
||||
jr .done
|
||||
.done
|
||||
jp TextScriptEnd
|
||||
; where the hell do i put SetEvent EVENT_BEAT_YUJIROU
|
||||
|
||||
YujirouIntro::
|
||||
text_far _YujirouIntro
|
||||
|
|
@ -56,4 +104,46 @@ YujirouAfterBattleText::
|
|||
text_far _YujirouAfterBattleText
|
||||
text_end
|
||||
|
||||
YujirouRematch:
|
||||
text_asm
|
||||
ld hl, YujirouIntro2
|
||||
call PrintText
|
||||
|
||||
ld c, BANK(Music_MeetMaleTrainer)
|
||||
ld a, MUSIC_MEET_MALE_TRAINER
|
||||
call PlayMusic
|
||||
|
||||
ld hl, wd72d
|
||||
set 6, [hl]
|
||||
set 7, [hl]
|
||||
call Delay3
|
||||
ld a, OPP_YUJIROU
|
||||
ld [wCurOpponent], a
|
||||
ld a, 2
|
||||
ld [wTrainerNo], a
|
||||
ld [wIsTrainerBattle], a
|
||||
ld a, $2
|
||||
ld [wViridianPreGymCurScript], a
|
||||
ld hl, YujirouLoseText2
|
||||
ld de, YujirouWinText
|
||||
call SaveEndBattleTextPointers
|
||||
jp TextScriptEnd
|
||||
jr .done
|
||||
.done
|
||||
ld hl, YujirouAfterBattleText2
|
||||
call PrintText
|
||||
jp TextScriptEnd
|
||||
|
||||
YujirouIntro2::
|
||||
text_far _YujirouIntro2
|
||||
text_end
|
||||
|
||||
YujirouLoseText2::
|
||||
text_far _YujirouLoseText2
|
||||
text_end
|
||||
|
||||
YujirouAfterBattleText2::
|
||||
text_far _YujirouAfterBattleText2
|
||||
text_end
|
||||
|
||||
text_end ; unused
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue