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.
This commit is contained in:
May Evans 2023-03-25 16:02:23 +00:00
parent f099436f8d
commit 0226ba9579
23 changed files with 347 additions and 180 deletions

View file

@ -143,17 +143,28 @@ CeruleanCityScript1:
; select which team to use during the encounter
ld a, [wRivalStarter]
cp STARTER2
cp STARTER1
jr nz, .NotSquirtle
ld a, $7
ld a, $11
jr .done
.NotSquirtle
cp STARTER3
jr nz, .Charmander
ld a, $8
ld a, $12
jr .done
.Charmander
ld a, $9
cp STARTER2 ; changes start here
ld a, $13
jr nz, .Pikachu
jr .done
.Pikachu ;
cp STARTER4
jr nz, .Eevee
ld a, $14
jr .done
.Eevee
ld a, $15
jr .done
.done
ld [wTrainerNo], a
ld a, 1

View file

@ -69,17 +69,28 @@ GaryScript2:
; select which team to use during the encounter
ld a, [wRivalStarter]
cp STARTER2
jr nz, .NotStarter2
cp STARTER1
jr nz, .NotSquirtle
ld a, $1
jr .saveTrainerId
.NotStarter2
jr .done
.NotSquirtle
cp STARTER3
jr nz, .NotStarter3
jr nz, .Charmander
ld a, $2
jr .saveTrainerId
.NotStarter3
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

View file

@ -102,7 +102,7 @@ FightingDojoTrainerHeader3:
trainer EVENT_BEAT_FIGHTING_DOJO_TRAINER_3, 3, FightingDojoBattleText4, FightingDojoEndBattleText4, FightingDojoAfterBattleText4
db -1 ; end
FightingDojoText1:
FightingDojoText1: ; gym scaling was removed to make space
text_asm
CheckEvent EVENT_DEFEATED_FIGHTING_DOJO
jp nz, .continue1
@ -119,24 +119,7 @@ FightingDojoText1:
ldh a, [hSpriteIndexOrTextID]
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_BLACKBELT
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
call InitBattleEnemyParameters
ld a, $3
ld [wFightingDojoCurScript], a
ld [wCurMapScript], a

View file

@ -47,11 +47,11 @@ OaksLabScript0:
ret
OaksLabScript1:
ld a, $8
ld a, $6 ; accounting for the dex entities being removed
ldh [hSpriteIndex], a
ld de, OakEntryMovement
call MoveSprite
ld a, $2
ld [wOaksLabCurScript], a
ret
@ -101,7 +101,7 @@ OaksLabScript3:
ret
PlayerEntryMovementRLE:
db D_UP, 8
db D_UP, 7
db -1 ; end
OaksLabScript4:
@ -197,17 +197,21 @@ OaksLabScript8:
jr z, .Charmander
cp STARTER2
jr z, .Squirtle
jr .Bulbasaur
cp STARTER3
jr z, .Bulbasaur ; yes process of elimination is necessary.
cp STARTER4
jr z, .Pikachu
cp STARTER5
jr z, .Eevee
.Charmander
ld de, .MiddleBallMovement1
ld de, .CharmanderMovement2
ld a, [wYCoord]
cp 4 ; is the player standing below the table?
jr z, .moveBlue
ld de, .MiddleBallMovement2
jr .moveBlue
.MiddleBallMovement1
db NPC_MOVEMENT_DOWN
ld de, .CharmanderMovement1
jp .moveBlue
.CharmanderMovement1
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
@ -215,41 +219,36 @@ OaksLabScript8:
db NPC_MOVEMENT_UP
db -1 ; end
.MiddleBallMovement2
db NPC_MOVEMENT_DOWN
.CharmanderMovement2
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db -1 ; end
.Squirtle
ld de, .RightBallMovement1
ld de, .SquirtleMovement2
ld a, [wYCoord]
cp 4 ; is the player standing below the table?
jr z, .moveBlue
ld de, .RightBallMovement2
jr .moveBlue
ld de, .CharmanderMovement1
jp .moveBlue
.RightBallMovement1
.SquirtleMovement1
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_UP
db -1 ; end
.RightBallMovement2
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
.SquirtleMovement2
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db -1 ; end
.Bulbasaur
ld de, .LeftBallMovement1
ld de, .BulbasaurMovement1
ld a, [wXCoord]
cp 9 ; is the player standing to the right of the table?
jr nz, .moveBlue
@ -269,17 +268,42 @@ OaksLabScript8:
ld [hl], 8 ; SPRITESTATEDATA2_MAPY
inc hl
ld [hl], 9 ; SPRITESTATEDATA2_MAPX
ld de, .LeftBallMovement2 ; the rival is not currently onscreen, so account for that
ld de, .BulbasaurMovement2 ; the rival is not currently onscreen, so account for that
pop hl
jr .moveBlue
.LeftBallMovement1
.BulbasaurMovement1
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
.LeftBallMovement2
.BulbasaurMovement2
db NPC_MOVEMENT_RIGHT
db -1 ; end
.Pikachu
ld de, .PikachuMovement1
jr z, .moveBlue
.PikachuMovement1
db NPC_MOVEMENT_LEFT
db -1 ; end
.Eevee
ld de, .EeveeMovement1
ld a, [wYCoord]
cp 4 ; is the player standing below the table?
jr z, .moveBlue
ld de, .EeveeMovement2
jp .moveBlue
.EeveeMovement1
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_LEFT
db NPC_MOVEMENT_LEFT
db NPC_MOVEMENT_UP
db -1 ; end
.EeveeMovement2
db NPC_MOVEMENT_LEFT
db NPC_MOVEMENT_LEFT
db -1 ; end
.moveBlue
ld a, $1
ldh [hSpriteIndex], a
@ -289,7 +313,7 @@ OaksLabScript8:
ld [wOaksLabCurScript], a
ret
OaksLabScript9:
OaksLabScript9: ; This is where Blue picks up the ball and removes the sprite.
ld a, [wd730]
bit 0, a
ret nz
@ -381,13 +405,13 @@ OaksLabScript11:
bit 0, a
ret nz
; define which team rival uses, and fight it
; define which team rival uses, and fight it, by process of elimination
ld a, 1
ld [wIsTrainerBattle], a
ld a, OPP_RIVAL1
ld [wCurOpponent], a
ld a, [wRivalStarter]
cp STARTER2
cp STARTER1
jr nz, .NotSquirtle
ld a, $1
jr .done
@ -397,7 +421,19 @@ OaksLabScript11:
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 .done ; new code ends here. use as ref for oak.
.done
ld [wTrainerNo], a
ld a, $1
@ -582,12 +618,12 @@ OaksLabScript16:
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld a, HS_POKEDEX_1
ld [wMissableObjectIndex], a
predef HideObject
ld a, HS_POKEDEX_2
ld [wMissableObjectIndex], a
predef HideObject
;ld a, HS_POKEDEX_1; sprite limits
;ld [wMissableObjectIndex], a
;predef HideObject
;ld a, HS_POKEDEX_2
;ld [wMissableObjectIndex], a
;predef HideObject
call OaksLabScript_1cefd
ld a, $1a
ldh [hSpriteIndexOrTextID], a
@ -752,6 +788,8 @@ OaksLab_TextPointers:
dw OaksLabText25
dw OaksLabText26
dw OaksLabText27
dw OaksLabTextPikachu
dw OaksLabTextEevee
OaksLab_TextPointers2:
dw OaksLabText1
@ -797,6 +835,8 @@ OaksLabText41:
text_far _OaksLabText41
text_end
; These are the starter balls that you're picking.
; They go in order from left to right; Charmander, Squirtle, Bulbasaur.
OaksLabText2:
text_asm
ld a, STARTER2
@ -825,6 +865,32 @@ OaksLabText4:
ld [wRivalStarterBallSpriteIndex], a
ld a, STARTER3
ld b, $4
jr OaksLabScript_1d133 ; new
; So when adding the new starters, we go this way.
; For Pikachu and Eevee Mode, you only have these two.
; $5 = Pikachu
; $6 = Eevee
; I have no idea how Blue comes to the correct conclusions after, but I won't question it...for now.
OaksLabTextPikachu:
text_asm
ld a, STARTER5
ld [wRivalStarterTemp], a
ld a, $5
ld [wRivalStarterBallSpriteIndex], a
ld a, STARTER4
ld b, $6
jr OaksLabScript_1d133
OaksLabTextEevee:
text_asm
ld a, STARTER4
ld [wRivalStarterTemp], a
ld a, $5
ld [wRivalStarterBallSpriteIndex], a
ld a, STARTER5
ld b, $5
; ends here
OaksLabScript_1d133:
ld [wcf91], a
@ -869,7 +935,13 @@ OaksLabScript_1d157:
jr z, OaksLabLookAtCharmander
cp $3
jr z, OaksLabLookAtSquirtle
jr OaksLabLookAtBulbasaur
cp $4
jr z, OaksLabLookAtBulbasaur
cp $5 ; these may be the wrong way around.
jr nz, OaksLabLookAtPikachu
cp $6 ; ^
jr nz, OaksLabLookAtEevee
OaksLabLookAtCharmander:
ld hl, OaksLabCharmanderText
@ -892,6 +964,20 @@ OaksLabBulbasaurText:
text_far _OaksLabBulbasaurText
text_end
OaksLabLookAtPikachu:
ld hl, OaksLabPikachuText
jr OaksLabMonChoiceMenu
OaksLabPikachuText:
text_far _OaksLabPikachuText
text_end
OaksLabLookAtEevee:
ld hl, OaksLabEeveeText
jr OaksLabMonChoiceMenu
OaksLabEeveeText:
text_far _OaksLabEeveeText
text_end
OaksLabMonChoiceMenu:
call PrintText
ld a, $1
@ -907,7 +993,7 @@ OaksLabMonChoiceMenu:
ld a, [wSpriteIndex]
cp $2
jr nz, .asm_1d1db
ld a, HS_STARTER_BALL_1
ld a, HS_STARTER_BALL_1 ; somewhere the starter balls need removing
jr .asm_1d1e5
.asm_1d1db
cp $3

View file

@ -153,17 +153,28 @@ PokemonTower2Text1:
; select which team to use during the encounter
ld a, [wRivalStarter]
cp STARTER2
cp STARTER1
jr nz, .NotSquirtle
ld a, $4
ld a, $6
jr .done
.NotSquirtle
cp STARTER3
jr nz, .Charmander
ld a, $5
ld a, $7
jr .done
.Charmander
ld a, $6
cp STARTER2 ; changes start here
ld a, $8
jr nz, .Pikachu
jr .done
.Pikachu ;
cp STARTER4
jr nz, .Eevee
ld a, $9
jr .done
.Eevee
ld a, $10
jr .done
.done
ld [wTrainerNo], a
ld a, 1

View file

@ -91,7 +91,18 @@ Route1OakText:
ld a, $3 ; If Bulbasaur, Totartle
jr .done
.Charmander
cp STARTER1
jr nz, .Pikachu
ld a, $1 ; If Squirtle, Charizard
jr .done
.Pikachu
cp STARTER4
jr nz, .Eevee
ld a, $4 ; If Pikachu, Espeon
jr .done
.Eevee
ld a, $5 ; If Eevee, Gorochu
jr .done
.done
ld [wTrainerNo], a
ld a, 1

View file

@ -143,9 +143,11 @@ Route22Script1:
StarterMons_50faf:
; starter the rival picked, rival trainer number
db STARTER2, 4
db STARTER3, 5
db STARTER1, 6
db STARTER2, 7
db STARTER3, 8
db STARTER4, 9
db STARTER5, 10
Route22Script2:
ld a, [wIsInBattle]
@ -300,9 +302,11 @@ Route22Script4:
ret
StarterMons_510d9:
db STARTER2, 10
db STARTER3, 11
db STARTER1, 12
db STARTER2, 16
db STARTER3, 17
db STARTER1, 18
db STARTER4, 19
db STARTER5, 20
Route22Script5:
ld a, [wIsInBattle]

View file

@ -101,7 +101,7 @@ SSAnne2Script1:
; select which team to use during the encounter
ld a, [wRivalStarter]
cp STARTER2
cp STARTER1
jr nz, .NotSquirtle
ld a, $1
jr .done
@ -111,7 +111,18 @@ SSAnne2Script1:
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 .done
.done
ld [wTrainerNo], a
ld a, 1

View file

@ -186,17 +186,28 @@ SilphCo7Script3:
ld a, OPP_RIVAL2
ld [wCurOpponent], a
ld a, [wRivalStarter]
cp STARTER2
jr nz, .asm_51cb6
ld a, $7
jr .asm_51cc0
.asm_51cb6
cp STARTER1
jr nz, .NotSquirtle
ld a, $11
jr .done
.NotSquirtle
cp STARTER3
jr nz, .asm_51cbe
ld a, $8
jr .asm_51cc0
.asm_51cbe
ld a, $9
jr nz, .Charmander
ld a, $12
jr .done
.Charmander
cp STARTER2 ; changes start here
ld a, $13
jr nz, .Pikachu
jr .done
.Pikachu ;
cp STARTER4
jr nz, .Eevee
ld a, $14
jr .done
.Eevee
ld a, $15
jr .done
.asm_51cc0
ld [wTrainerNo], a
ld a, 1