shithub: pokered

Download patch

ref: 8ce20e5c31ed2255e708e6a38c7b75d3d8bee48c
parent: bfd9f617c96af851ad4100b752ea967ef8989edc
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Mon Aug 31 06:58:41 EDT 2020

Define a constant for the ghost Marowak (hard-coded throughout the engine, like the starters)

--- a/constants.asm
+++ b/constants.asm
@@ -32,7 +32,6 @@
 INCLUDE "constants/audio_constants.asm"
 INCLUDE "constants/music_constants.asm"
 INCLUDE "constants/tileset_constants.asm"
-INCLUDE "constants/starter_mons.asm"
 INCLUDE "constants/event_constants.asm"
 INCLUDE "constants/text_constants.asm"
 INCLUDE "constants/menu_constants.asm"
--- a/constants/pokemon_constants.asm
+++ b/constants/pokemon_constants.asm
@@ -199,3 +199,11 @@
 	const VICTREEBEL   ; $BE
 
 NUM_POKEMON_INDEXES EQU const_value - 1
+
+; starters
+STARTER1 EQU CHARMANDER
+STARTER2 EQU SQUIRTLE
+STARTER3 EQU BULBASAUR
+
+; ghost in Pokémon Tower
+GHOST_MON EQU MAROWAK
--- a/constants/starter_mons.asm
+++ /dev/null
@@ -1,3 +1,0 @@
-STARTER1 EQU CHARMANDER
-STARTER2 EQU SQUIRTLE
-STARTER3 EQU BULBASAUR
--- a/engine/battle/common_text.asm
+++ b/engine/battle/common_text.asm
@@ -33,7 +33,7 @@
 	call IsItemInBag
 	ld a, [wEnemyMonSpecies2]
 	ld [wcf91], a
-	cp MAROWAK
+	cp GHOST_MON
 	jr z, .isMarowak
 	ld a, b
 	and a
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -6784,7 +6784,7 @@
 	call LoadEnemyMonData
 	call DoBattleTransitionAndInitBattleVariables
 	ld a, [wCurOpponent]
-	cp MAROWAK
+	cp GHOST_MON
 	jr z, .isGhost
 	call IsGhostBattle
 	jr nz, .isNoGhost
--- a/engine/battle/ghost_marowak_anim.asm
+++ b/engine/battle/ghost_marowak_anim.asm
@@ -11,7 +11,7 @@
 	xor a
 	ldh [hAutoBGTransferEnabled], a ; disable BG transfer so we don't see the Marowak too soon
 ; replace ghost pic with Marowak in BG
-	ld a, MAROWAK
+	ld a, GHOST_MON
 	ld [wChangeMonPicEnemyTurnSpecies], a
 	ld a, $1
 	ldh [hWhoseTurn], a
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -170,7 +170,7 @@
 	cp POKEMON_TOWER_6F
 	jr nz, .loop
 	ld a, [wEnemyMonSpecies2]
-	cp MAROWAK
+	cp GHOST_MON
 	ld b, $10 ; can't be caught value
 	jp z, .setAnimData
 
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -117,6 +117,7 @@
 	call SaveScreenTilesToBuffer2
 	call LoadScreenTilesFromBuffer2
 	call EnableLCD
+
 IF DEF(_RED)
 	ld a, CHARMANDER ; which Pokemon to show first on the title screen
 ENDC
@@ -123,9 +124,9 @@
 IF DEF(_BLUE)
 	ld a, SQUIRTLE ; which Pokemon to show first on the title screen
 ENDC
-
 	ld [wTitleMonSpecies], a
 	call LoadTitleMonSprite
+
 	ld a, HIGH(vBGMap0 + $300)
 	call TitleScreenCopyTileMapToVRAM
 	call SaveScreenTilesToBuffer1