summaryrefslogtreecommitdiff
path: root/engine/evolve_trade.asm
diff options
context:
space:
mode:
authorU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-22 18:13:20 -0400
committerU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-22 18:13:20 -0400
commit15427f532085846ab6b51719be687951a094cb6c (patch)
treeedea9b189e91641a12dd521756894df84aeeace7 /engine/evolve_trade.asm
parentea3ba4cde3706b7c77efb705555ec0c86321cbe2 (diff)
Pull a lot of engine out of main.asm
Diffstat (limited to 'engine/evolve_trade.asm')
-rwxr-xr-xengine/evolve_trade.asm44
1 files changed, 44 insertions, 0 deletions
diff --git a/engine/evolve_trade.asm b/engine/evolve_trade.asm
new file mode 100755
index 00000000..9758b99f
--- /dev/null
+++ b/engine/evolve_trade.asm
@@ -0,0 +1,44 @@
+EvolveTradeMon: ; 17d7d (5:7d7d)
+; Verify the TradeMon's species name before
+; attempting to initiate a trade evolution.
+
+; The names of the trade evolutions in Blue (JP)
+; are checked. In that version, TradeMons that
+; can evolve are Graveler and Haunter.
+
+; In localization, this check was translated
+; before monster names were finalized.
+; Then, Haunter's name was "Spectre".
+; Since its name no longer starts with
+; "SP", it is prevented from evolving.
+
+; This may have been why Red/Green's trades
+; were used instead, where none can evolve.
+
+; This was fixed in Yellow.
+
+ ld a, [wTradeMonNick]
+
+ ; GRAVELER
+ cp "G"
+ jr z, .ok
+
+ ; "SPECTRE" (HAUNTER)
+ cp "S"
+ ret nz
+ ld a, [wTradeMonNick + 1]
+ cp "P"
+ ret nz
+
+.ok
+ ld a, [W_NUMINPARTY] ; $d163
+ dec a
+ ld [wWhichPokemon], a ; $cf92
+ ld a, $1
+ ld [$ccd4], a
+ ld a, $32
+ ld [W_ISLINKBATTLE], a ; $d12b
+ callab Func_3ad0e
+ xor a
+ ld [W_ISLINKBATTLE], a ; $d12b
+ jp Func_2307