Yujirou is now marginally less of a twat

He now gives you a Bottle Cap when you win, but still crashes the game when you lose for some reason...
This commit is contained in:
Martha Schilling 2023-12-29 19:11:11 +00:00
parent 2a714f3dff
commit 9b4a9d5839
5 changed files with 127 additions and 67 deletions

View file

@ -36,8 +36,9 @@
const EVENT_BEAT_VIRIDIAN_PREGYM_TRAINER_0
const EVENT_BEAT_VIRIDIAN_PREGYM_TRAINER_1
const EVENT_GOT_TM42
const EVENT_GOT_YUJIROU_BOTTLE_CAP
const EVENT_BEAT_YUJIROU
const_skip 11
const_skip 10
const EVENT_OAK_GOT_PARCEL
const EVENT_GOT_OAKS_PARCEL
const_skip 22

View file

@ -128,8 +128,6 @@ FightingDojoText1: ; gym scaling can be removed to make space
ld [wTrainerNo], a
ld a, 1
ld [wIsTrainerBattle], a
ld a, $1
ld [wGymLeaderNo], a
jr .asm_9dba4
.normalProcessing
CheckEvent EVENT_DEFEATED_FIGHTING_DOJO
@ -164,8 +162,6 @@ FightingDojoText1: ; gym scaling can be removed to make space
ld [wTrainerNo], a
ld a, 1
ld [wIsTrainerBattle], a
ld a, $1
ld [wGymLeaderNo], a ; play gym music
;ends here

View file

@ -26,12 +26,24 @@ ViridianGymYujirouPostBattle:
jp z, ViridianGymResetScripts
ld a, $f0
ld [wJoyIgnore], a
; SetEvents EVENT_BEAT_YUJIROU, EVENT_BEAT_VIRIDIAN_PREGYM_TRAINER_0, EVENT_BEAT_VIRIDIAN_PREGYM_TRAINER_1 ; Needs to be set here for the correct text to pop up.
; ld a, $3
; ld [hSpriteIndex], a
; call DisplayTextID
; xor a
; ld [wViridianPreGymCurScript], a
ViridianPreGymScriptReceiveBottleCap:
ld a, $b
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
SetEvent EVENT_BEAT_YUJIROU
lb bc, BOTTLE_CAP, 1
call GiveItem
jr nc, .BagFull
ld a, $c
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
SetEvent EVENT_GOT_YUJIROU_BOTTLE_CAP
jp ViridianPreGymResetScripts
.BagFull
ld a, $d
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
jp ViridianPreGymResetScripts
ViridianPreGym_TextPointers:
dw ViridianPreGymText1
@ -44,6 +56,9 @@ ViridianPreGym_TextPointers:
dw ViridianPreGymSign4
dw ViridianPreGymStatue1
dw ViridianPreGymStatue2
dw BeforeReceivedBottleCapText
dw ReceivedBottleCapText
dw BottleCapNoRoomText
ViridianPreGymTrainerHeaders:
def_trainers
@ -58,41 +73,12 @@ YujirouText:
CheckEvent EVENT_POST_GAME_ATTAINED ; No need to view previous stuff
jr nz, .rematchMode
CheckEvent EVENT_BEAT_YUJIROU
jp nz, .YujirouBeaten
ld hl, YujirouIntro
call PrintText
ld c, BANK(Music_MeetMaleTrainer)
ld a, MUSIC_MEET_MALE_TRAINER
call PlayMusic
ld hl, wd72d
set 6, [hl]
set 7, [hl]
ld hl, YujirouLoseText
ld de, YujirouWinText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
call EngageMapTrainer
; gym scaling spaghetti code begins here - remove initial parameters as we're making our own
ld a, OPP_YUJIROU
ld [wCurOpponent], a
ld hl, wObtainedBadges ; Picking the team based on badge count. Need +1 so it loads the right team: remember, you're fighting for the badge! Thanks to Chatot4444 for the help.
ld b, 1
call CountSetBits
ld a, [wNumSetBits]
inc a
ld [wTrainerNo], a
ld a, 1
ld [wIsTrainerBattle], a
ld a, $3
ld [wViridianPreGymCurScript], a
ld [wCurMapScript], a
jr .done
jp z, .yujirouNotBeaten
CheckEventReuseA EVENT_GOT_YUJIROU_BOTTLE_CAP
jr nz, .yujirouBeaten
call z, PewterGymScriptReceiveTM34
call DisableWaitingAfterTextDisplay
jp .done ; needed due to the rematch script length.
.rematchMode ; Rematch functionality. Just loads pre-battle text and his trainer.
ld hl, YujirouIntro2
call PrintText
@ -105,7 +91,7 @@ YujirouText:
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
ld hl, YujirouLoseText2
ld de, YujirouWinText
ld de, YujirouLoseText2
call SaveEndBattleTextPointers
call EngageMapTrainer
ld a, OPP_YUJIROU
@ -114,12 +100,46 @@ YujirouText:
ld [wTrainerNo], a
ld a, 1
ld [wIsTrainerBattle], a
ld a, $1
ld [wGymLeaderNo], a
jr .done
.YujirouBeaten
.yujirouBeaten
ld hl, YujirouAfterBattleText
call PrintText
jr .done
.yujirouNotBeaten
ld hl, YujirouIntro
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
ld hl, YujirouLoseText
ld de, YujirouLoseText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
call EngageMapTrainer
; gym scaling spaghetti code begins here - remove initial parameters as we're making our own
ld a, OPP_YUJIROU
ld [wCurOpponent], a
ld hl, wObtainedBadges ; Picking the team based on badge count. Need +1 so it loads the right team: remember, you're fighting for the badge! Thanks to Chatot4444 for the help.
ld b, 1
call CountSetBits
ld a, [wNumSetBits]
inc a
ld [wTrainerNo], a
ld a, 1
ld [wIsTrainerBattle], a
;ends here
xor a
ldh [hJoyHeld], a
ld a, $3
ld [wViridianPreGymCurScript], a
ld [wCurMapScript], a
.done
jp TextScriptEnd
@ -131,14 +151,24 @@ YujirouLoseText::
text_far _YujirouLoseText
text_end
YujirouWinText::
text_far _YujirouWinText
text_end
YujirouAfterBattleText::
text_far _YujirouAfterBattleText
text_end
BeforeReceivedBottleCapText:
text_far _BeforeReceivedBottleCapText
text_end
ReceivedBottleCapText:
text_far _ReceivedBottleCapText
sound_get_item_1
text_far _BottleCapExplanationText
text_end
BottleCapNoRoomText:
text_far _BottleCapNoRoomText
text_end
YujirouIntro2::
text_far _YujirouIntro2
text_end

View file

@ -35,10 +35,9 @@ _FightingDojoText_5ce98::
done
_FightingDojoText_5ce9d::
text "Ho!"
para "Stay and train at"
line "Karate with us!"
text "Hyah!"
line "Stay and train at"
cont "karate with us!"
done
_FightingDojoBattleText1::
@ -139,7 +138,7 @@ _OiMateText::
done
_KoichiRematchPreBattleText::
text "Ho, <PLAYER>!"
text "<PLAYER>!"
para "Did you return"
line "to spar with us"

View file

@ -17,12 +17,19 @@ _YujirouLoseText::
line "I lost?!"
prompt
_YujirouWinText::
text "Ha!"
line "Small fry!"
prompt
_YujirouAfterBattleText::
text "I won't give up!"
line "I'll train with"
cont "my #MON until"
cont "we're the best"
cont "there is!"
para "One day, we will"
line "beat you!"
done
_BeforeReceivedBottleCapText::
text "I lost..."
para "..."
@ -35,7 +42,34 @@ _YujirouAfterBattleText::
para "One day, we will"
line "beat you!"
para "Oh yeah! You can"
line "have this for"
cont "winning!"
done
_ReceivedBottleCapText::
text "<PLAYER> received"
line "BOTTLE CAP!@"
text_end
_BottleCapExplanationText::
text_start
para "I know it's not"
line "a real BADGE..."
cont "but look at how"
cont "shiny it is!"
para "Maybe it'll come"
line "in handy some"
cont "other time."
done
_BottleCapNoRoomText::
text "Wait, you've got"
line "way too many"
cont "items already!"
done
_YujirouIntro2::
@ -95,8 +129,8 @@ _ViridianPreGymBattleText2::
done
_ViridianPreGymEndBattleText2::
text "CLEFAIRY!"
line "No!"
text "No!"
line "CLEFAIRY!"
prompt
_ViridianPreGymAfterBattleText2::