mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-16 02:13:23 +12:00

(kinda just clearing my commits list while I'm working on 1.3 still.) - Lance's Room is no longer listed as a dungeon map - Changed the layout of Cinnabar Volcano YET AGAIN, making it a little more visually appealing. If you get softlocked here, I will just sigh disapprovingly. - Various moveset fixes: - Arcanine-H gets EQ and Fissure now - Raichu-A loses Counter - Raticate-A gets TBolt and Thunder - Swapped Bullet Punch and Iron Head around in Scizor's learnset - Umbreon gets Psychic - WigWug both now get Ice Beam and Blizzard - Seel and Dewgong get Water Gun by level up - Swapped inconsistent moveset levels for Omanyte and Omastar - Eevee gets Quick Attack earlier - Fixed a typo in Slowbro-G's dex entry - Changed the Tauros Combat Breed trader's text to remove a moveset inaccuracy - Changed Misty's AI to now use X Specials instead of Potions - Gave Chief's teams a slightly updated moveset - Fixed an issue where Steel just...didn't resist Rock? How did I miss this????? - Made Sandshrew more common in Mt Moon B2F - Changed the Marowaks on Silph Gauntlet 4F to Guardias - Fixed issues where receiving a Gym badge wouldn't play the correct sound in most situations - Increased the level of the Salesman's Cubone gift from 17 to 23 - Decreased the levels of the Fossil gifts from 44 to 35 - More text fixes -
302 lines
6.6 KiB
NASM
302 lines
6.6 KiB
NASM
VermilionGym_Script:
|
|
ld hl, wCurrentMapScriptFlags
|
|
bit 5, [hl]
|
|
res 5, [hl]
|
|
push hl
|
|
call nz, .LoadNames
|
|
pop hl
|
|
bit 6, [hl]
|
|
res 6, [hl]
|
|
call nz, VermilionGymSetDoorTile
|
|
call EnableAutoTextBoxDrawing
|
|
ld hl, VermilionGymTrainerHeaders
|
|
ld de, VermilionGym_ScriptPointers
|
|
ld a, [wVermilionGymCurScript]
|
|
call ExecuteCurMapScriptInTable
|
|
ld [wVermilionGymCurScript], a
|
|
ret
|
|
|
|
.LoadNames:
|
|
ld hl, .CityName
|
|
ld de, .LeaderName
|
|
jp LoadGymLeaderAndCityName
|
|
|
|
.CityName:
|
|
db "VERMILION CITY@"
|
|
|
|
.LeaderName:
|
|
db "LT.SURGE@"
|
|
|
|
VermilionGymSetDoorTile:
|
|
CheckEvent EVENT_2ND_LOCK_OPENED
|
|
jr nz, .doorsOpen
|
|
ld a, $24 ; double door tile ID
|
|
jr .replaceTile
|
|
.doorsOpen
|
|
ld a, SFX_GO_INSIDE
|
|
call PlaySound
|
|
ld a, $5 ; clear floor tile ID
|
|
.replaceTile
|
|
ld [wNewTileBlockID], a
|
|
lb bc, 2, 2
|
|
predef_jump ReplaceTileBlock
|
|
|
|
VermilionGymResetScripts:
|
|
xor a
|
|
ld [wJoyIgnore], a
|
|
ld [wVermilionGymCurScript], a
|
|
ld [wCurMapScript], a
|
|
ret
|
|
|
|
VermilionGym_ScriptPointers:
|
|
dw CheckFightingMapTrainers
|
|
dw DisplayEnemyTrainerTextAndStartBattle
|
|
dw EndTrainerBattle
|
|
dw VermilionGymLTSurgePostBattle
|
|
|
|
VermilionGymLTSurgePostBattle:
|
|
ld a, [wIsInBattle]
|
|
cp $ff ; did we lose?
|
|
jp z, VermilionGymResetScripts
|
|
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
|
|
ld [wJoyIgnore], a
|
|
|
|
VermilionGymReceiveTM24:
|
|
ld a, $6
|
|
ldh [hSpriteIndexOrTextID], a
|
|
call DisplayTextID
|
|
SetEvent EVENT_BEAT_LT_SURGE
|
|
lb bc, TM_THUNDERBOLT, 1
|
|
call GiveItem
|
|
jr nc, .BagFull
|
|
ld a, $7
|
|
ldh [hSpriteIndexOrTextID], a
|
|
call DisplayTextID
|
|
SetEvent EVENT_GOT_TM24
|
|
jr .gymVictory
|
|
.BagFull
|
|
ld a, $8
|
|
ldh [hSpriteIndexOrTextID], a
|
|
call DisplayTextID
|
|
.gymVictory
|
|
ld hl, wObtainedBadges
|
|
set BIT_THUNDERBADGE, [hl]
|
|
ld hl, wBeatGymFlags
|
|
set BIT_THUNDERBADGE, [hl]
|
|
|
|
; deactivate gym trainers
|
|
SetEventRange EVENT_BEAT_VERMILION_GYM_TRAINER_0, EVENT_BEAT_VERMILION_GYM_TRAINER_2
|
|
|
|
jp VermilionGymResetScripts
|
|
|
|
VermilionGym_TextPointers:
|
|
dw LTSurgeText
|
|
dw VermilionGymTrainerText1
|
|
dw VermilionGymTrainerText2
|
|
dw VermilionGymTrainerText3
|
|
dw VermilionGymGuideText
|
|
dw LTSurgeThunderBadgeInfoText
|
|
dw ReceivedTM24Text
|
|
dw TM24NoRoomText
|
|
|
|
VermilionGymTrainerHeaders:
|
|
def_trainers 2
|
|
VermilionGymTrainerHeader0:
|
|
trainer EVENT_BEAT_VERMILION_GYM_TRAINER_0, 3, VermilionGymBattleText1, VermilionGymEndBattleText1, VermilionGymAfterBattleText1
|
|
VermilionGymTrainerHeader1:
|
|
trainer EVENT_BEAT_VERMILION_GYM_TRAINER_1, 2, VermilionGymBattleText2, VermilionGymEndBattleText2, VermilionGymAfterBattleText2
|
|
VermilionGymTrainerHeader2:
|
|
trainer EVENT_BEAT_VERMILION_GYM_TRAINER_2, 3, VermilionGymBattleText3, VermilionGymEndBattleText3, VermilionGymAfterBattleText3
|
|
db -1 ; end
|
|
|
|
LTSurgeText:
|
|
text_asm
|
|
CheckEvent EVENT_POST_GAME_ATTAINED ; No need to view previous stuff, technically you can skip Bide this way but I think that's hilarious
|
|
jr nz, .rematchMode
|
|
CheckEvent EVENT_BEAT_LT_SURGE
|
|
jr z, .beforeBeat
|
|
CheckEventReuseA EVENT_GOT_TM24
|
|
jr nz, .afterBeat
|
|
call z, VermilionGymReceiveTM24
|
|
call DisableWaitingAfterTextDisplay
|
|
jp .done ; needed due to the rematch script length.
|
|
.rematchMode ; Rematch functionality. Just loads pre-battle text and his trainer.
|
|
ld hl, SurgeRematchPreBattleText
|
|
call PrintText
|
|
ld c, BANK(Music_MeetMaleTrainer)
|
|
ld a, MUSIC_MEET_MALE_TRAINER
|
|
call PlayMusic
|
|
ld hl, wd72d
|
|
set 6, [hl]
|
|
set 7, [hl]
|
|
ldh a, [hSpriteIndex]
|
|
ld [wSpriteIndex], a
|
|
ld hl, SurgeRematchDefeatedText
|
|
ld de, SurgeRematchDefeatedText
|
|
call SaveEndBattleTextPointers
|
|
call EngageMapTrainer
|
|
ld a, OPP_LT_SURGE
|
|
ld [wCurOpponent], a
|
|
ld a, 9
|
|
ld [wTrainerNo], a
|
|
ld a, 1
|
|
ld [wIsTrainerBattle], a
|
|
ld a, $3
|
|
ld [wGymLeaderNo], a
|
|
jr .done
|
|
.afterBeat
|
|
ld hl, LTSurgePostBattleAdviceText
|
|
call PrintText
|
|
jr .done
|
|
.beforeBeat
|
|
ld hl, LTSurgePreBattleText
|
|
call PrintText
|
|
ld hl, wd72d
|
|
set 6, [hl]
|
|
set 7, [hl]
|
|
ld hl, ReceivedThunderBadgeText
|
|
ld de, ReceivedThunderBadgeText
|
|
call SaveEndBattleTextPointers
|
|
ldh a, [hSpriteIndex]
|
|
ld [wSpriteIndex], a
|
|
call EngageMapTrainer
|
|
; call InitBattleEnemyParameters ; put this back if you mess up
|
|
|
|
; gym scaling spaghetti code begins here - remove initial parameters as we're making our own
|
|
ld a, OPP_LT_SURGE
|
|
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
|
|
|
|
ld a, $3
|
|
ld [wGymLeaderNo], a
|
|
xor a
|
|
ldh [hJoyHeld], a
|
|
ld a, $3 ; set script index to LT Surge post-battle script
|
|
ld [wVermilionGymCurScript], a
|
|
ld [wCurMapScript], a
|
|
.done
|
|
jp TextScriptEnd
|
|
|
|
LTSurgePreBattleText:
|
|
text_far _LTSurgePreBattleText
|
|
text_end
|
|
|
|
LTSurgePostBattleAdviceText:
|
|
text_far _LTSurgePostBattleAdviceText
|
|
text_end
|
|
|
|
LTSurgeThunderBadgeInfoText:
|
|
text_far _LTSurgeThunderBadgeInfoText
|
|
text_end
|
|
|
|
ReceivedTM24Text:
|
|
text_far _ReceivedTM24Text
|
|
sound_get_item_1
|
|
text_far _TM24ExplanationText
|
|
text_end
|
|
|
|
TM24NoRoomText:
|
|
text_far _TM24NoRoomText
|
|
text_end
|
|
|
|
ReceivedThunderBadgeText:
|
|
text_far _ReceivedThunderBadgeText
|
|
sound_get_key_item
|
|
text_promptbutton
|
|
text_end
|
|
|
|
VermilionGymTrainerText1:
|
|
text_asm
|
|
ld hl, VermilionGymTrainerHeader0
|
|
call TalkToTrainer
|
|
jp TextScriptEnd
|
|
|
|
VermilionGymBattleText1:
|
|
text_far _VermilionGymBattleText1
|
|
text_end
|
|
|
|
VermilionGymEndBattleText1:
|
|
text_far _VermilionGymEndBattleText1
|
|
text_end
|
|
|
|
VermilionGymAfterBattleText1:
|
|
text_far _VermilionGymAfterBattleText1
|
|
text_end
|
|
|
|
VermilionGymTrainerText2:
|
|
text_asm
|
|
ld hl, VermilionGymTrainerHeader1
|
|
call TalkToTrainer
|
|
jp TextScriptEnd
|
|
|
|
VermilionGymBattleText2:
|
|
text_far _VermilionGymBattleText2
|
|
text_end
|
|
|
|
VermilionGymEndBattleText2:
|
|
text_far _VermilionGymEndBattleText2
|
|
text_end
|
|
|
|
VermilionGymAfterBattleText2:
|
|
text_far _VermilionGymAfterBattleText2
|
|
text_end
|
|
|
|
VermilionGymTrainerText3:
|
|
text_asm
|
|
ld hl, VermilionGymTrainerHeader2
|
|
call TalkToTrainer
|
|
jp TextScriptEnd
|
|
|
|
VermilionGymBattleText3:
|
|
text_far _VermilionGymBattleText3
|
|
text_end
|
|
|
|
VermilionGymEndBattleText3:
|
|
text_far _VermilionGymEndBattleText3
|
|
text_end
|
|
|
|
VermilionGymAfterBattleText3:
|
|
text_far _VermilionGymAfterBattleText3
|
|
text_end
|
|
|
|
VermilionGymGuideText:
|
|
text_asm
|
|
ld a, [wBeatGymFlags]
|
|
bit BIT_THUNDERBADGE, a
|
|
jr nz, .afterBeat
|
|
ld hl, VermilionGymGuidePreBattleText
|
|
call PrintText
|
|
jr .done
|
|
.afterBeat
|
|
ld hl, VermilionGymGuidePostBattleText
|
|
call PrintText
|
|
.done
|
|
jp TextScriptEnd
|
|
|
|
VermilionGymGuidePreBattleText:
|
|
text_far _VermilionGymGuidePreBattleText
|
|
text_end
|
|
|
|
VermilionGymGuidePostBattleText:
|
|
text_far _VermilionGymGuidePostBattleText
|
|
text_end
|
|
|
|
SurgeRematchPreBattleText:
|
|
text_far _SurgeRematchPreBattleText
|
|
text_end
|
|
|
|
SurgeRematchDefeatedText:
|
|
text_far _SurgeRematchDefeatedText
|
|
text_end
|