kep-hack/scripts/ChampionsRoom.asm
May Evans 0226ba9579 Pikachu/Eevee Mode
So some bits of this are untested, but the base starters are unaffected. I had to work a lot with the sprite limits so Oak's lab has been changed a bit.

This adds a Pikachu and Eevee "mode" to the game, allowing you to pick them as starters. When doing so, the Rival will always pick the opposite.

There are some glitches;
- Picking Charmander makes Blue erase himself from existence
- Picking from anywhere other than the front of the table may have odd results.
- Oak has to be shown in the lab at the start from now on for some reason; side effect of removing the dexes, there's definitely a fix for this.
These are from me not finishing the ball picking process - it was a little weird.

Parties based on starters have been updated but I had to cut out a lot of unused trainer slots.

Also the unused names were removed.
2023-03-25 16:02:23 +00:00

314 lines
5.3 KiB
NASM

ChampionsRoom_Script:
call EnableAutoTextBoxDrawing
ld hl, ChampionsRoom_ScriptPointers
ld a, [wChampionsRoomCurScript]
jp CallFunctionInTable
ResetGaryScript:
xor a
ld [wJoyIgnore], a
ld [wChampionsRoomCurScript], a
ret
ChampionsRoom_ScriptPointers:
dw GaryScript0
dw GaryScript1
dw GaryScript2
dw GaryScript3
dw GaryScript4
dw GaryScript5
dw GaryScript6
dw GaryScript7
dw GaryScript8
dw GaryScript9
dw GaryScript10
GaryScript0:
ret
GaryScript1:
ld a, $ff
ld [wJoyIgnore], a
ld hl, wSimulatedJoypadStatesEnd
ld de, GaryEntrance_RLEMovement
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $2
ld [wChampionsRoomCurScript], a
ret
GaryEntrance_RLEMovement:
db D_UP, 1
db D_RIGHT, 1
db D_UP, 3
db -1 ; end
GaryScript2:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
call Delay3
xor a
ld [wJoyIgnore], a
ld hl, wOptions
res 7, [hl] ; Turn on battle animations to make the battle feel more epic.
ld a, $1
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld hl, wd72d
set 6, [hl]
set 7, [hl]
ld hl, GaryDefeatedText
ld de, GaryVictoryText
call SaveEndBattleTextPointers
ld a, OPP_RIVAL3
ld [wCurOpponent], a
; select which team to use during the encounter
ld a, [wRivalStarter]
cp STARTER1
jr nz, .NotSquirtle
ld a, $1
jr .done
.NotSquirtle
cp STARTER3
jr nz, .Charmander
ld a, $2
jr .done
.Charmander
cp STARTER2 ; changes start here
ld a, $3
jr nz, .Pikachu
jr .done
.Pikachu ;
cp STARTER4
jr nz, .Eevee
ld a, $4
jr .done
.Eevee
ld a, $5
jr .saveTrainerId
.saveTrainerId
ld [wTrainerNo], a
ld a, 1
ld [wIsTrainerBattle], a
xor a
ldh [hJoyHeld], a
ld a, $3
ld [wChampionsRoomCurScript], a
ret
GaryScript3:
ld a, [wIsInBattle]
cp $ff
jp z, ResetGaryScript
xor a
ld [wIsTrainerBattle], a
call UpdateSprites
SetEvent EVENT_BEAT_CHAMPION_RIVAL
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 [wChampionsRoomCurScript], a
ret
GaryScript4:
farcall Music_Cities1AlternateTempo
ld a, $2
ldh [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $2
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
ld de, OakEntranceAfterVictoryMovement
ld a, $2
ldh [hSpriteIndex], a
call MoveSprite
ld a, HS_CHAMPIONS_ROOM_OAK
ld [wMissableObjectIndex], a
predef ShowObject
ld a, $5
ld [wChampionsRoomCurScript], a
ret
OakEntranceAfterVictoryMovement:
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db -1 ; end
GaryScript5:
ld a, [wd730]
bit 0, a
ret nz
ld a, PLAYER_DIR_LEFT
ld [wPlayerMovingDirection], a
ld a, $1
ldh [hSpriteIndex], a
ld a, SPRITE_FACING_LEFT
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $2
ldh [hSpriteIndex], a
xor a ; SPRITE_FACING_DOWN
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $3
ldh [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $6
ld [wChampionsRoomCurScript], a
ret
GaryScript6:
ld a, $2
ldh [hSpriteIndex], a
ld a, SPRITE_FACING_RIGHT
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $4
ldh [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $7
ld [wChampionsRoomCurScript], a
ret
GaryScript7:
ld a, $2
ldh [hSpriteIndex], a
xor a ; SPRITE_FACING_DOWN
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $5
ldh [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld de, OakExitGaryRoomMovement
ld a, $2
ldh [hSpriteIndex], a
call MoveSprite
ld a, $8
ld [wChampionsRoomCurScript], a
ret
OakExitGaryRoomMovement:
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db -1 ; end
GaryScript8:
ld a, [wd730]
bit 0, a
ret nz
ld a, HS_CHAMPIONS_ROOM_OAK
ld [wMissableObjectIndex], a
predef HideObject
ld a, $9
ld [wChampionsRoomCurScript], a
ret
GaryScript9:
ld a, $ff
ld [wJoyIgnore], a
ld hl, wSimulatedJoypadStatesEnd
ld de, WalkToHallOfFame_RLEMovment
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $a
ld [wChampionsRoomCurScript], a
ret
WalkToHallOfFame_RLEMovment:
db D_UP, 4
db D_LEFT, 1
db -1 ; end
GaryScript10:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
xor a
ld [wJoyIgnore], a
ld a, $0
ld [wChampionsRoomCurScript], a
ret
GaryScript_760c8:
ld a, $f0
ld [wJoyIgnore], a
call DisplayTextID
ld a, $ff
ld [wJoyIgnore], a
ret
ChampionsRoom_TextPointers:
dw GaryText1
dw GaryText2
dw GaryText3
dw GaryText4
dw GaryText5
GaryText1:
text_asm
CheckEvent EVENT_BEAT_CHAMPION_RIVAL
ld hl, GaryChampionIntroText
jr z, .printText
ld hl, GaryText_76103
.printText
call PrintText
jp TextScriptEnd
GaryChampionIntroText:
text_far _GaryChampionIntroText
text_end
GaryDefeatedText:
text_far _GaryDefeatedText
text_end
GaryVictoryText:
text_far _GaryVictoryText
text_end
GaryText_76103:
text_far _GaryText_76103
text_end
GaryText2:
text_far _GaryText2
text_end
GaryText3:
text_asm
ld a, [wPlayerStarter]
ld [wd11e], a
call GetMonName
ld hl, GaryText_76120
call PrintText
jp TextScriptEnd
GaryText_76120:
text_far _GaryText_76120
text_end
GaryText4:
text_far _GaryText_76125
text_end
GaryText5:
text_far _GaryText_7612a
text_end