shithub: pokecrystal

Download patch

ref: f0b01a4eeafe6393b55c4d1a1f6bc464590c725b
parent: 7df5d4f25e00236921a78b397ffc2d3b364089c4
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Mon Feb 26 08:41:48 EST 2018

Document more quirks and bugs

--- a/data/maps/attributes.asm
+++ b/data/maps/attributes.asm
@@ -16,6 +16,7 @@
 	db \4
 ENDM
 
+; Connections go in order: north, south, west, east
 connection: MACRO
 ;\1: direction
 ;\2: map name
--- a/data/pokemon/evos_attacks.asm
+++ b/data/pokemon/evos_attacks.asm
@@ -8,7 +8,19 @@
 
 
 EvosAttacks::
+; Evos+attacks data structure:
+; - Evolution methods:
+;    * db EVOLVE_LEVEL, level, species
+;    * db EVOLVE_ITEM, used item, species
+;    * db EVOLVE_TRADE, held item (or -1 for none), species
+;    * db EVOLVE_HAPPINESS, TR_* constant (ANYTIME, MORNDAY, NITE), species
+;    * db EVOLVE_STAT, level, ATK_*_DEF constant (LT, GT, EQ), species
+; - db 0 ; no more evolutions
+; - Learnset (in increasing level order):
+;    * db level, move
+; - db 0 ; no more level-up moves
 
+
 BulbasaurEvosAttacks:
 	db EVOLVE_LEVEL, 16, IVYSAUR
 	db 0 ; no more evolutions
@@ -831,7 +843,7 @@
 	db 0 ; no more level-up moves
 
 KadabraEvosAttacks:
-	db EVOLVE_TRADE, $ff, ALAKAZAM
+	db EVOLVE_TRADE, -1, ALAKAZAM
 	db 0 ; no more evolutions
 	db 1, TELEPORT
 	db 1, KINESIS
@@ -875,7 +887,7 @@
 	db 0 ; no more level-up moves
 
 MachokeEvosAttacks:
-	db EVOLVE_TRADE, $ff, MACHAMP
+	db EVOLVE_TRADE, -1, MACHAMP
 	db 0 ; no more evolutions
 	db 1, LOW_KICK
 	db 1, LEER
@@ -989,7 +1001,7 @@
 	db 0 ; no more level-up moves
 
 GravelerEvosAttacks:
-	db EVOLVE_TRADE, $ff, GOLEM
+	db EVOLVE_TRADE, -1, GOLEM
 	db 0 ; no more evolutions
 	db 1, TACKLE
 	db 1, DEFENSE_CURL
@@ -1248,7 +1260,7 @@
 	db 0 ; no more level-up moves
 
 HaunterEvosAttacks:
-	db EVOLVE_TRADE, $ff, GENGAR
+	db EVOLVE_TRADE, -1, GENGAR
 	db 0 ; no more evolutions
 	db 1, HYPNOSIS
 	db 1, LICK
--- a/data/trainers/parties.asm
+++ b/data/trainers/parties.asm
@@ -1,12 +1,12 @@
 Trainers:
 ; Trainer data structure:
-;	db "NAME@", TRAINERTYPE_* constant
-;	1 to 6 Pokémon:
-;	* for TRAINERTYPE_NORMAL:     db level, species
-;	* for TRAINERTYPE_ITEM:       db level, species, item
-;	* for TRAINERTYPE_MOVES:      db level, species, 4 moves
-;	* for TRAINERTYPE_ITEM_MOVES: db level, species, item, 4 moves
-;	db -1 ; end
+; - db "NAME@", TRAINERTYPE_* constant
+; - 1 to 6 Pokémon:
+;    * for TRAINERTYPE_NORMAL:     db level, species
+;    * for TRAINERTYPE_ITEM:       db level, species, item
+;    * for TRAINERTYPE_MOVES:      db level, species, 4 moves
+;    * for TRAINERTYPE_ITEM_MOVES: db level, species, item, 4 moves
+; - db -1 ; end
 
 
 FalknerGroup:
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -48,6 +48,7 @@
 - [Using a Park Ball in normal battles has a corrupt animation](#using-a-park-ball-in-normal-battles-has-a-corrupt-animation)
 - [`HELD_CATCH_CHANCE` has no effect](#held_catch_chance-has-no-effect)
 - [Only the first three `EvosAttacks` evolution entries can have Stone compatibility reported correctly](#only-the-first-three-evosattacks-evolution-entries-can-have-stone-compatibility-reported-correctly)
+- [`EVOLVE_STAT` can break Stone compatibility reporting](#evolve_stat-can-break-stone-compatibility-reporting)
 - [`ScriptCall` can overflow `wScriptStack` and crash](#scriptcall-can-overflow-wscriptstack-and-crash)
 - [`LoadSpriteGFX` does not limit the capacity of `UsedSprites`](#loadspritegfx-does-not-limit-the-capacity-of-usedsprites)
 - [`ChooseWildEncounter` doesn't really validate the wild Pokémon species](#choosewildencounter-doesnt-really-validate-the-wild-pokémon-species)
@@ -1297,6 +1298,39 @@
 ```
 
 **Fix:** Change `ld bc, 10` to `ld bc, wStringBuffer2 - wStringBuffer1` to support up to six Stone entries.
+
+
+## `EVOLVE_STAT` can break Stone compatibility reporting
+
+This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/party_menu.asm](/engine/party_menu.asm):
+
+```asm
+.loop2
+	ld a, [hli]
+	and a
+	jr z, .nope
+	inc hl
+	inc hl
+	cp EVOLVE_ITEM
+	jr nz, .loop2
+```
+
+**Fix:**
+
+```asm
+.loop2
+	ld a, [hli]
+	and a
+	jr z, .nope
+	cp EVOLVE_STAT
+	jr nz, .not_four_bytes
+	inc hl
+.not_four_bytes
+	inc hl
+	inc hl
+	cp EVOLVE_ITEM
+	jr nz, .loop2
+```
 
 
 ## `ScriptCall` can overflow `wScriptStack` and crash