summaryrefslogtreecommitdiff
path: root/engine/items/items.asm
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2015-08-24 00:23:38 -0500
committerdannye <corrnondacqb@yahoo.com>2015-08-25 21:42:59 -0500
commit8a9db5ef59ea0220a5cad88d59bf7c5f92c048b8 (patch)
tree90b606a93214ba4ae791e945562b6b5ca5937206 /engine/items/items.asm
parent364e6a058a763ccc41f0dab3225072a9b452920b (diff)
Add Devolve Stoneadding-pokemon
rolls back Pokemon to their pre-evolution without degenerating stats
Diffstat (limited to 'engine/items/items.asm')
-rwxr-xr-xengine/items/items.asm12
1 files changed, 12 insertions, 0 deletions
diff --git a/engine/items/items.asm b/engine/items/items.asm
index c996ba96..334eea67 100755
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -114,6 +114,7 @@ ItemUsePtrTable: ; d5e1 (3:55e1)
dw UnusableItem ; FLOOR_11F
dw UnusableItem ; FLOOR_B4F
dw ItemUseEvoStone ; ICE_STONE
+ dw ItemUseEvoStone ; DEVOLVE_STONE
ItemUseBall: ; d687 (3:5687)
ld a,[W_ISINBATTLE]
@@ -643,9 +644,13 @@ ItemUseEvoStone: ; da5b (3:5a5b)
ld a,[wWhichPokemon]
push af
ld a,[wcf91]
+ cp DEVOLVE_STONE
ld [wEvoStoneItemID],a
push af
+ ld a,DEVO_STONE_PARTY_MENU
+ jr z, .devolveMenu
ld a,EVO_STONE_PARTY_MENU
+.devolveMenu
ld [wPartyMenuTypeOrMessageID],a
ld a,$ff
ld [wUpdateSpritesEnabled],a
@@ -659,7 +664,14 @@ ItemUseEvoStone: ; da5b (3:5a5b)
ld a,SFX_HEAL_AILMENT
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
+ ld a, [wPartyMenuTypeOrMessageID]
+ cp DEVO_STONE_PARTY_MENU
+ jr z, .devolvePokemon
callab TryEvolvingMon ; try to evolve pokemon
+ jr .doneEvolving
+.devolvePokemon
+ callab DevolvePokemon
+.doneEvolving
ld a,[wEvolutionOccurred]
and a
jr z,.noEffect