Yellow Trainer Arrays

Allows more freedom in enemy design
This commit is contained in:
emaskyesmogon 2022-09-02 20:34:43 -06:00
parent 198c9c8255
commit 392f7abb97
2 changed files with 201 additions and 87 deletions

View file

@ -1,25 +1,160 @@
; unique moves for gym leaders ; Yellow entry format:
; this is not automatic! you have to write the index you want to [wLoneAttackNo] ; db trainerclass, trainerid
; first. e.g., erika's script writes 4 to [wLoneAttackNo] to get mega drain, ; repeat { db partymon location, partymon move, move id }
; the fourth entry in the list. ; db 0
LoneMoves:
; pokemon index, move to give nth pokemon
db 1, BIDE
db 1, BUBBLEBEAM
db 2, THUNDERBOLT
db 2, MEGA_DRAIN
db 3, TOXIC
db 3, PSYWAVE
db 3, FIRE_BLAST
db 4, FISSURE
; unique moves for elite 4 SpecialTrainerMoves:
; all trainers in this class are given this move automatically db BUG_CATCHER, 15
; (unrelated to LoneMoves) db 2, 2, TACKLE
TeamMoves: db 2, 3, STRING_SHOT
; trainer, move db 0
db LORELEI, BLIZZARD
db BRUNO, FISSURE db YOUNGSTER, 14
db AGATHA, TOXIC db 1, 4, FISSURE
db LANCE, BARRIER db 0
db -1 ; end
db BROCK, 1
db 2, 3, BIND
db 2, 4, BIDE
db 0
db MISTY, 1
db 2, 4, BUBBLEBEAM
db 0
db LT_SURGE, 1
db 1, 1, THUNDERBOLT
db 1, 2, MEGA_PUNCH
db 1, 3, MEGA_KICK
db 1, 4, GROWL
db 0
db ERIKA, 1
db 1, 3, MEGA_DRAIN
db 2, 1, RAZOR_LEAF
db 3, 1, PETAL_DANCE
db 0
db KOGA, 1
db 1, 1, TOXIC
db 1, 2, TACKLE
db 2, 1, TOXIC
db 2, 3, SUPERSONIC
db 3, 1, TOXIC
db 3, 2, DOUBLE_EDGE
db 4, 1, LEECH_LIFE
db 4, 2, DOUBLE_TEAM
db 4, 3, PSYCHIC_M
db 4, 4, TOXIC
db 0
db BLAINE, 1
db 1, 1, FLAMETHROWER
db 1, 4, CONFUSE_RAY
db 3, 1, FLAMETHROWER
db 3, 2, FIRE_BLAST
db 3, 3, REFLECT
db 0
db SABRINA, 1
db 1, 1, FLASH
db 2, 1, KINESIS
db 2, 4, PSYWAVE
db 3, 1, PSYWAVE
db 0
db GIOVANNI, 3
db 1, 3, FISSURE
db 2, 2, DOUBLE_TEAM
db 3, 1, EARTHQUAKE
db 3, 3, THUNDER
db 4, 1, EARTHQUAKE
db 4, 2, LEER
db 4, 3, THUNDER
db 5, 1, ROCK_SLIDE
db 5, 4, EARTHQUAKE
db 0
db LORELEI, 1
db 1, 1, BUBBLEBEAM
db 2, 3, ICE_BEAM
db 3, 1, PSYCHIC_M
db 3, 2, SURF
db 4, 3, LOVELY_KISS
db 5, 3, BLIZZARD
db 0
db BRUNO, 1
db 1, 1, ROCK_SLIDE
db 1, 2, SCREECH
db 1, 4, DIG
db 2, 3, FIRE_PUNCH
db 2, 4, DOUBLE_TEAM
db 3, 1, DOUBLE_KICK
db 3, 2, MEGA_KICK
db 3, 4, DOUBLE_TEAM
db 4, 1, ROCK_SLIDE
db 4, 2, SCREECH
db 4, 4, EARTHQUAKE
db 5, 2, KARATE_CHOP
db 5, 3, STRENGTH
db 0
db AGATHA, 1
db 1, 2, SUBSTITUTE
db 1, 3, LICK
db 1, 4, MEGA_DRAIN
db 2, 2, TOXIC
db 2, 4, LEECH_LIFE
db 3, 2, LICK
db 4, 1, WRAP
db 5, 2, PSYCHIC_M
db 0
db LANCE, 1
db 1, 1, DRAGON_RAGE
db 2, 1, THUNDER_WAVE
db 2, 3, THUNDERBOLT
db 3, 1, BUBBLEBEAM
db 3, 2, WRAP
db 3, 3, ICE_BEAM
db 4, 1, WING_ATTACK
db 4, 2, SWIFT
db 4, 3, FLY
db 5, 1, BLIZZARD
db 5, 2, FIRE_BLAST
db 5, 3, THUNDER
db 0
db RIVAL3, 1
db 1, 3, EARTHQUAKE
db 2, 4, KINESIS
db 3, 4, LEECH_SEED
db 4, 1, ICE_BEAM
db 5, 1, CONFUSE_RAY
db 5, 4, FIRE_SPIN
db 6, 3, QUICK_ATTACK
db 0
db RIVAL3, 2
db 1, 3, EARTHQUAKE
db 2, 4, KINESIS
db 3, 4, LEECH_SEED
db 4, 1, THUNDERBOLT
db 5, 1, ICE_BEAM
db 6, 2, REFLECT
db 6, 3, QUICK_ATTACK
db 0
db RIVAL3, 3
db 1, 3, EARTHQUAKE
db 2, 4, KINESIS
db 3, 4, LEECH_SEED
db 4, 1, CONFUSE_RAY
db 4, 4, FIRE_SPIN
db 5, 1, THUNDERBOLT
db 6, 1, AURORA_BEAM
db 6, 3, QUICK_ATTACK
db 0
db -1 ; end

View file

@ -15,8 +15,8 @@ ReadTrainer:
ld [hl], a ld [hl], a
; get the pointer to trainer data for this class ; get the pointer to trainer data for this class
ld a, [wCurOpponent] ld a, [wTrainerClass] ; get trainer class
sub OPP_ID_OFFSET + 1 ; convert value from pokemon to trainer dec a
add a add a
ld hl, TrainerDataPointers ld hl, TrainerDataPointers
ld c, a ld c, a
@ -53,7 +53,7 @@ ReadTrainer:
.LoopTrainerData .LoopTrainerData
ld a, [hli] ld a, [hli]
and a ; have we reached the end of the trainer data? and a ; have we reached the end of the trainer data?
jr z, .FinishUp jp z, .AddAdditionalMoveData
ld [wcf91], a ; write species somewhere (XXX why?) ld [wcf91], a ; write species somewhere (XXX why?)
ld a, ENEMY_PARTY_DATA ld a, ENEMY_PARTY_DATA
ld [wMonDataLocation], a ld [wMonDataLocation], a
@ -68,7 +68,7 @@ ReadTrainer:
; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move ; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move
ld a, [hli] ld a, [hli]
and a ; have we reached the end of the trainer data? and a ; have we reached the end of the trainer data?
jr z, .AddLoneMove jr z, .AddAdditionalMoveData
ld [wCurEnemyLVL], a ld [wCurEnemyLVL], a
ld a, [hli] ld a, [hli]
ld [wcf91], a ld [wcf91], a
@ -78,69 +78,48 @@ ReadTrainer:
call AddPartyMon call AddPartyMon
pop hl pop hl
jr .SpecialTrainer jr .SpecialTrainer
.AddLoneMove .AddAdditionalMoveData
; does the trainer have a single monster with a different move? ; does the trainer have additional move data?
ld a, [wLoneAttackNo] ; Brock is 01, Misty is 02, Erika is 04, etc ld a, [wTrainerClass]
and a ld b, a
jr z, .AddTeamMove ld a, [wTrainerNo]
dec a
add a
ld c, a ld c, a
ld b, 0 ld hl, SpecialTrainerMoves
ld hl, LoneMoves .loopAdditionalMoveData
add hl, bc
ld a, [hli] ld a, [hli]
ld d, [hl] cp $ff
ld hl, wEnemyMon1Moves + 2 jr z, .FinishUp
cp b
jr nz, .asm_39c46
ld a, [hli]
cp c
jr nz, .asm_39c46
ld d, h
ld e, l
.writeAdditionalMoveDataLoop
ld a, [de]
inc de
and a
jp z, .FinishUp
dec a
ld hl, wEnemyMon1Moves
ld bc, wEnemyMon2 - wEnemyMon1 ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes call AddNTimes
ld [hl], d ld a, [de]
jr .FinishUp inc de
.AddTeamMove dec a
; check if our trainer's team has special moves ld c, a
ld b, 0
; get trainer class number add hl, bc
ld a, [wCurOpponent] ld a, [de]
sub OPP_ID_OFFSET inc de
ld b, a ld [hl], a
ld hl, TeamMoves jr .writeAdditionalMoveDataLoop
.asm_39c46
; iterate through entries in TeamMoves, checking each for our trainer class
.IterateTeamMoves
ld a, [hli] ld a, [hli]
cp b and a
jr z, .GiveTeamMoves ; is there a match? jr nz, .asm_39c46
inc hl ; if not, go to the next entry jr .loopAdditionalMoveData
inc a
jr nz, .IterateTeamMoves
; no matches found. is this trainer champion rival?
ld a, b
cp RIVAL3
jr z, .ChampionRival
jr .FinishUp ; nope
.GiveTeamMoves
ld a, [hl]
ld [wEnemyMon5Moves + 2], a
jr .FinishUp
.ChampionRival ; give moves to his team
; pidgeot
ld a, SKY_ATTACK
ld [wEnemyMon1Moves + 2], a
; starter
ld a, [wRivalStarter]
cp STARTER3
ld b, MEGA_DRAIN
jr z, .GiveStarterMove
cp STARTER1
ld b, FIRE_BLAST
jr z, .GiveStarterMove
ld b, BLIZZARD ; must be squirtle
.GiveStarterMove
ld a, b
ld [wEnemyMon6Moves + 2], a
.FinishUp .FinishUp
; clear wAmountMoneyWon addresses ; clear wAmountMoneyWon addresses
xor a xor a
@ -163,4 +142,4 @@ ReadTrainer:
inc de inc de
dec b dec b
jr nz, .LastLoop ; repeat wCurEnemyLVL times jr nz, .LastLoop ; repeat wCurEnemyLVL times
ret ret