diff --git a/audio.asm b/audio.asm index 16efad80..dce355bf 100644 --- a/audio.asm +++ b/audio.asm @@ -574,9 +574,10 @@ PlayBattleMusic:: ; 0x90c6 ld a, MUSIC_GYM_LEADER_BATTLE jr .playSong .notGymLeaderBattle + ld a, [wIsTrainerBattle] + and a + jr z, .wildBattle ld a, [W_CUROPPONENT] - cp $c8 - jr c, .wildBattle cp SONY3 + $c8 jr z, .finalBattle cp LANCE + $c8 diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm index b3ae8e21..1ef2a976 100755 --- a/constants/sprite_constants.asm +++ b/constants/sprite_constants.asm @@ -88,10 +88,12 @@ SPRITE_LYING_OLD_MAN EQU $48 ITEM EQU $80 TRAINER EQU $40 +OW_POKEMON EQU $80 + BOULDER_MOVEMENT_BYTE_2 EQU $10 ; sprite facing directions SPRITE_FACING_DOWN EQU $00 SPRITE_FACING_UP EQU $04 SPRITE_FACING_LEFT EQU $08 -SPRITE_FACING_RIGHT EQU $0C \ No newline at end of file +SPRITE_FACING_RIGHT EQU $0C diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index e06ca2ce..500d3d2a 100644 --- a/constants/wram_constants.asm +++ b/constants/wram_constants.asm @@ -1,14 +1,3 @@ SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile) -; Overload W_GRASSMONS -wd893 EQU $d893 ; W_GRASSMONS + 11 -wd896 EQU $d896 ; W_GRASSMONS + 14 - -; Overload enemy party data -W_WATERRATE EQU $d8a4 ; wEnemyMon1Species -W_WATERMONS EQU $d8a5 ; wEnemyMon1Species + 1 - -; Overload enemy stat modifiers -wTradeMonNick EQU $cd1e ; wPlayerMonAccuracyMod - diff --git a/data/mapObjects/powerplant.asm b/data/mapObjects/powerplant.asm index 98e80ff9..31f74f4b 100755 --- a/data/mapObjects/powerplant.asm +++ b/data/mapObjects/powerplant.asm @@ -9,15 +9,15 @@ PowerPlantObject: ; 0x1e3bf (size=135) db $0 ; signs db $e ; people - db SPRITE_BALL, $14 + 4, $9 + 4, $ff, $ff, TRAINER | $1, VOLTORB, 40 - db SPRITE_BALL, $12 + 4, $20 + 4, $ff, $ff, TRAINER | $2, VOLTORB, 40 - db SPRITE_BALL, $19 + 4, $15 + 4, $ff, $ff, TRAINER | $3, VOLTORB, 40 - db SPRITE_BALL, $12 + 4, $19 + 4, $ff, $ff, TRAINER | $4, ELECTRODE, 43 - db SPRITE_BALL, $22 + 4, $17 + 4, $ff, $ff, TRAINER | $5, VOLTORB, 40 - db SPRITE_BALL, $1c + 4, $1a + 4, $ff, $ff, TRAINER | $6, VOLTORB, 40 - db SPRITE_BALL, $e + 4, $15 + 4, $ff, $ff, TRAINER | $7, ELECTRODE, 43 - db SPRITE_BALL, $20 + 4, $25 + 4, $ff, $ff, TRAINER | $8, VOLTORB, 40 - db SPRITE_BIRD, $9 + 4, $4 + 4, $ff, $d1, TRAINER | $9, ZAPDOS, 50 + db SPRITE_BALL, $14 + 4, $9 + 4, $ff, $ff, TRAINER | $1, VOLTORB, 40 | OW_POKEMON + db SPRITE_BALL, $12 + 4, $20 + 4, $ff, $ff, TRAINER | $2, VOLTORB, 40 | OW_POKEMON + db SPRITE_BALL, $19 + 4, $15 + 4, $ff, $ff, TRAINER | $3, VOLTORB, 40 | OW_POKEMON + db SPRITE_BALL, $12 + 4, $19 + 4, $ff, $ff, TRAINER | $4, ELECTRODE, 43 | OW_POKEMON + db SPRITE_BALL, $22 + 4, $17 + 4, $ff, $ff, TRAINER | $5, VOLTORB, 40 | OW_POKEMON + db SPRITE_BALL, $1c + 4, $1a + 4, $ff, $ff, TRAINER | $6, VOLTORB, 40 | OW_POKEMON + db SPRITE_BALL, $e + 4, $15 + 4, $ff, $ff, TRAINER | $7, ELECTRODE, 43 | OW_POKEMON + db SPRITE_BALL, $20 + 4, $25 + 4, $ff, $ff, TRAINER | $8, VOLTORB, 40 | OW_POKEMON + db SPRITE_BIRD, $9 + 4, $4 + 4, $ff, $d1, TRAINER | $9, ZAPDOS, 50 | OW_POKEMON db SPRITE_BALL, $19 + 4, $7 + 4, $ff, $ff, ITEM | $a, CARBOS db SPRITE_BALL, $3 + 4, $1c + 4, $ff, $ff, ITEM | $b, HP_UP db SPRITE_BALL, $3 + 4, $22 + 4, $ff, $ff, ITEM | $c, RARE_CANDY diff --git a/data/mapObjects/seafoamislands5.asm b/data/mapObjects/seafoamislands5.asm index 6c207975..cc1af811 100755 --- a/data/mapObjects/seafoamislands5.asm +++ b/data/mapObjects/seafoamislands5.asm @@ -14,7 +14,7 @@ SeafoamIslands5Object: ; 0x468bc (size=62) db $3 ; people db SPRITE_BOULDER, $f + 4, $4 + 4, $ff, $ff, $1 ; person db SPRITE_BOULDER, $f + 4, $5 + 4, $ff, $ff, $2 ; person - db SPRITE_BIRD, $1 + 4, $6 + 4, $ff, $d0, TRAINER | $3, ARTICUNO, 50 + db SPRITE_BIRD, $1 + 4, $6 + 4, $ff, $d0, TRAINER | $3, ARTICUNO, 50 | OW_POKEMON ; warp-to EVENT_DISP SEAFOAM_ISLANDS_5_WIDTH, $11, $14 ; SEAFOAM_ISLANDS_4 diff --git a/data/mapObjects/unknowndungeon3.asm b/data/mapObjects/unknowndungeon3.asm index a3fba264..9b486b39 100755 --- a/data/mapObjects/unknowndungeon3.asm +++ b/data/mapObjects/unknowndungeon3.asm @@ -7,7 +7,7 @@ UnknownDungeon3Object: ; 0x45f36 (size=34) db $0 ; signs db $3 ; people - db SPRITE_SLOWBRO, $d + 4, $1b + 4, $ff, $d0, TRAINER | $1, MEWTWO, 70 + db SPRITE_SLOWBRO, $d + 4, $1b + 4, $ff, $d0, TRAINER | $1, MEWTWO, 70 | OW_POKEMON db SPRITE_BALL, $9 + 4, $10 + 4, $ff, $ff, ITEM | $2, ULTRA_BALL db SPRITE_BALL, $1 + 4, $12 + 4, $ff, $ff, ITEM | $3, MAX_REVIVE diff --git a/data/mapObjects/victoryroad2.asm b/data/mapObjects/victoryroad2.asm index 39ec23c5..a2bf713e 100755 --- a/data/mapObjects/victoryroad2.asm +++ b/data/mapObjects/victoryroad2.asm @@ -18,7 +18,7 @@ VictoryRoad2Object: ; 0x51915 (size=154) db SPRITE_BLACK_HAIR_BOY_1, $8 + 4, $13 + 4, $ff, $d0, TRAINER | $3, TAMER + $C8, $5 db SPRITE_BLACK_HAIR_BOY_2, $2 + 4, $4 + 4, $ff, $d0, TRAINER | $4, POKEMANIAC + $C8, $6 db SPRITE_BLACK_HAIR_BOY_2, $3 + 4, $1a + 4, $ff, $d2, TRAINER | $5, JUGGLER + $C8, $5 - db SPRITE_BIRD, $5 + 4, $b + 4, $ff, $d1, TRAINER | $6, MOLTRES, 50 + db SPRITE_BIRD, $5 + 4, $b + 4, $ff, $d1, TRAINER | $6, MOLTRES, 50 | OW_POKEMON db SPRITE_BALL, $5 + 4, $1b + 4, $ff, $ff, ITEM | $7, TM_17 db SPRITE_BALL, $9 + 4, $12 + 4, $ff, $ff, ITEM | $8, FULL_HEAL db SPRITE_BALL, $b + 4, $9 + 4, $ff, $ff, ITEM | $9, TM_05 diff --git a/data/pokedex_entries.asm b/data/pokedex_entries.asm index 9b9f0ace..6543b36e 100755 --- a/data/pokedex_entries.asm +++ b/data/pokedex_entries.asm @@ -1319,6 +1319,8 @@ VictreebelDexEntry: ; 40fd1 (10:4fd1) MissingNoDexEntry: ; 40fe5 (10:4fe5) db "???@" - db 10 ; 1.0 m - db 100 ; 10.0 kg - db 0,"コメント さくせいちゅう@" ; コメント作成中 (Comment to be written) + db 0, 0 + dw 0000 + text "No entry" + dex + db "@" diff --git a/engine/battle/1c.asm b/engine/battle/1c.asm index bceeac2b..b5bc1261 100755 --- a/engine/battle/1c.asm +++ b/engine/battle/1c.asm @@ -159,9 +159,9 @@ BattleTransitions: ; 709d2 (1c:49d2) dw BattleTransition_Split ; %111 GetBattleTransitionID_WildOrTrainer: ; 709e2 (1c:49e2) - ld a, [W_CUROPPONENT] - cp $c8 - jr nc, .trainer + ld a, [wIsTrainerBattle] + and a + jr nz, .trainer res 0, c ret .trainer diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 1cf56cf4..9d4a596b 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1021,6 +1021,8 @@ TrainerBattleVictory: ; 3c696 (f:4696) ld de, wPlayerMoney + 2 ld hl, wd07b ld c, $3 + xor a + ld [wIsTrainerBattle], a predef_jump AddBCDPredef MoneyForWinningText: ; 3c6e4 (f:46e4) @@ -1198,6 +1200,8 @@ ChooseNextMon: ; 3c7d8 (f:47d8) ; called when player is out of usable mons. ; prints approriate lose message, sets carry flag if player blacked out (special case for initial rival fight) HandlePlayerBlackOut: ; 3c837 (f:4837) + xor a + ld [wIsTrainerBattle], a ld a, [W_ISLINKBATTLE] cp $4 jr z, .notSony1Battle @@ -6769,9 +6773,11 @@ asm_3ef3d: ; 3ef3d (f:6f3d) push af res 1, [hl] callab Func_525af - ld a, [wEnemyMonSpecies2] - sub $c8 - jp c, InitWildBattle + ld a, [wIsTrainerBattle] + and a + jp z, InitWildBattle + ld a, [wEnemyMonSpecies2] + sub $c8 ld [W_TRAINERCLASS], a call GetTrainerInformation callab ReadTrainer diff --git a/engine/menu/debug_menu.asm b/engine/menu/debug_menu.asm index a1e6a842..1e427ae3 100644 --- a/engine/menu/debug_menu.asm +++ b/engine/menu/debug_menu.asm @@ -22,6 +22,14 @@ DebugMenu: call PrintDebugMenuItem ld de,DebugMenuItem2 call PrintDebugMenuItem + ld de,DebugMenuItem3 + call PrintDebugMenuItem + ld de,DebugMenuItem4 + call PrintDebugMenuItem + ld de,DebugMenuItem5 + call PrintDebugMenuItem + ld de,DebugMenuItem6 + call PrintDebugMenuItem ld hl,wd730 res 6,[hl] ; turn pauses between printing letters back on @@ -73,6 +81,12 @@ DebugMenu: cp a, 1 jp z, DebugMenuFly + + cp a, 2 + jp z, DebugMenu251 + + cp a, 3 + jp z, DebugMenuMasterB CloseDebugMenu:: ret @@ -91,12 +105,13 @@ PrintDebugMenuItem: ; 71bb (1:71bb) add hl,de ret -DebugMenuItem0: - db "WTW@" -DebugMenuItem1: - db "FLY@" -DebugMenuItem2: - db "LV.100@" +DebugMenuItem0: db "WTW@" +DebugMenuItem1: db "FLY@" +DebugMenuItem2: db "Wild 251@" +DebugMenuItem3: db "MasterB@" +DebugMenuItem4: db "-@" +DebugMenuItem5: db "-@" +DebugMenuItem6: db "-@" DebugMenuWTW: ld a, 1 @@ -110,3 +125,24 @@ DebugMenuFly: ld [hl], a call ChooseFlyDestination ret + +DebugMenu251: + ld hl, wd72d + res 4, [hl] + ld hl, wd72e + res 4, [hl] + ld a, 251 + ld [W_CUROPPONENT], a + ld a, 5 + ld [W_CURENEMYLVL], a + ret + +DebugMenuMasterB: + ld hl, wNumBagItems + inc [hl] + inc hl + ld a, 1 + ld [hli], a + ld a, 99 + ld [hl], a + ret diff --git a/home.asm b/home.asm index d501380f..1d40c9ab 100644 --- a/home.asm +++ b/home.asm @@ -2381,9 +2381,8 @@ EndTrainerBattle:: ; 3275 (0:3275) ld c, a ld b, $1 call TrainerFlagAction ; flag trainer as fought - ld a, [W_ENEMYMONORTRAINERCLASS] - cp $c8 - jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) + ld a, [wIsTrainerBattle] + jr nz, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) ld hl, W_MISSABLEOBJECTLIST ld de, $2 ld a, [wSpriteIndex] @@ -2393,6 +2392,8 @@ EndTrainerBattle:: ; 3275 (0:3275) ld [wcc4d], a ; load corresponding missable object index and remove it predef HideObject .skipRemoveSprite + xor a + ld [wIsTrainerBattle], a ld hl, wd730 bit 4, [hl] res 4, [hl] @@ -2418,9 +2419,10 @@ InitBattleEnemyParameters:: ; 32d7 (0:32d7) ld a, [wEngagedTrainerClass] ld [W_CUROPPONENT], a ; wd059 ld [W_ENEMYMONORTRAINERCLASS], a - cp $c8 + ld a, [wIsTrainerBattle] + and a + jr z, .noTrainer ld a, [wEngagedTrainerSet] ; wcd2e - jr c, .noTrainer ld [W_TRAINERNO], a ; wd05d ret .noTrainer @@ -2519,6 +2521,14 @@ EngageMapTrainer:: ; 336a (0:336a) ld a, [hli] ; load trainer class ld [wEngagedTrainerClass], a ld a, [hl] ; load trainer mon set + bit 7, a + jr nz, .pokemon + ld [wEnemyMonAttackMod], a ; wcd2e + ld a, 1 + ld [wIsTrainerBattle], a + jp PlayTrainerMusic +.pokemon + and $7F ld [wEnemyMonAttackMod], a ; wcd2e jp PlayTrainerMusic diff --git a/wram.asm b/wram.asm index e7464a3c..7604b6ba 100755 --- a/wram.asm +++ b/wram.asm @@ -120,10 +120,11 @@ wc0ee:: ds 1 wc0ef:: ds 1 wc0f0:: ds 1 wc0f1:: ds 1 -wc0f2:: ds 12 ;14 +wc0f2:: ds 11 ;14 wHaltAudio:: ds 1 wSFXDontWait:: ds 1 +wIsTrainerBattle:: ds 1 SECTION "Sprite State Data", WRAM0[$c100] @@ -2031,6 +2032,16 @@ W_GRASSRATE:: ; d887 W_GRASSMONS:: ; d888 ds 20 +; Overload W_GRASSMONS +wd893:: ds 3 +wd896:: ds 3 + +; Overload enemy party data +W_WATERRATE:: ds 1 +W_WATERMONS:: ds 20 + +; Overload enemy stat modifiers +wTradeMonNick:: ds 11 wEnemyPartyCount:: ds 1 ; d89c wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89d @@ -2099,21 +2110,7 @@ wBoxMonOT:: ds 11 * MONS_PER_BOX ; dd2a wBoxMonNicks:: ds 11 * MONS_PER_BOX ; de06 wBoxMonNicksEnd:: ; dee2 -SECTION "Splash", WRAMX, BANK[1] -wVWFLetterNum:: ds 1 -wVWFChar:: ds 1 -wVWFTileLoc:: ds 2 -wVWFFirstTileNum:: ds 1 -wVWFCurTileNum:: ds 1 -wVWFCurTileCol:: ds 1 -wVWFNumTilesUsed:: ds 1 -wVWFCharWidth:: ds 1 - -wVWFBuildArea0:: ds 8 -wVWFBuildArea1:: ds 8 -wVWFBuildArea2:: ds 8 -wVWFBuildArea3:: ds 8 -wVWFCopyArea:: ds $10 +SECTION "Empty", WRAMX, BANK[1] SECTION "Stack", WRAMX[$dfff], BANK[1]