summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-01-20 00:07:51 -0500
committeryenatch <yenatch@gmail.com>2014-01-20 00:07:51 -0500
commit08a0462c1e588c2efb99097cf1e9b314f600b009 (patch)
tree8e4477cfd7b8ef0e2f4ee2511b252d6e19f40ec2
parent04f5c5175343dde082e277420339341951a0b6fc (diff)
downloadpokecrystal-08a0462c1e588c2efb99097cf1e9b314f600b009.tar.gz
pokecrystal-08a0462c1e588c2efb99097cf1e9b314f600b009.zip
use constants for berserk gene, kings rock, scope lens effects
-rw-r--r--battle/core.asm36
-rw-r--r--battle/effect_commands.asm4
2 files changed, 23 insertions, 17 deletions
diff --git a/battle/core.asm b/battle/core.asm
index 92a0e80a..be7abc8f 100644
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -354,47 +354,53 @@ Function3c25c: ; 3c25c
Function3c27c: ; 3c27c
ld a, [$ffcb]
cp $1
- jr z, .asm_3c287
- call .asm_3c28a
- jr .asm_3c296
+ jr z, .reverse
-.asm_3c287
- call .asm_3c296
-.asm_3c28a
+ call .player
+ jr .enemy
+
+.reverse
+ call .enemy
+; jr .player
+
+.player
call SetPlayerTurn
ld de, PartyMon1Item
ld a, [CurBattleMon]
ld b, a
- jr .asm_3c2a0
+ jr .go
-.asm_3c296
+.enemy
call SetEnemyTurn
ld de, OTPartyMon1Item
ld a, [CurOTMon]
ld b, a
+; jr .go
-.asm_3c2a0
+.go
push de
push bc
callab GetUserItem
ld a, [hl]
ld [$d265], a
- sub $98
+ sub BERSERK_GENE
pop bc
pop de
ret nz
+
ld [hl], a
+
ld h, d
ld l, e
ld a, b
call GetPartyLocation
xor a
ld [hl], a
- ld a, $2
+ ld a, BATTLE_VARS_SUBSTATUS3
call _GetBattleVar
push af
- set 7, [hl]
- ld a, $c
+ set SUBSTATUS_CONFUSED, [hl]
+ ld a, BATTLE_VARS_MOVE_ANIM
call _GetBattleVar
push hl
push af
@@ -411,7 +417,7 @@ Function3c27c: ; 3c27c
call StdBattleTextBox
callab BattleCommand8c
pop af
- bit 7, a
+ bit SUBSTATUS_CONFUSED, a
ret nz
xor a
ld [$cfca], a
@@ -1340,7 +1346,7 @@ Function3c8eb: ; 3c8eb
ld [$d265], a
call GetItemName
ld a, b
- cp $3
+ cp HELD_LEFTOVERS
ret nz
ld hl, BattleMonHP
ld a, [hBattleTurn]
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index 33a95017..b9de6192 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -1313,7 +1313,7 @@ BattleCommand05: ; 34631
push bc
call GetUserItem
ld a, b
- cp $49 ; Increased critical chance. Only Scope Lens has this.
+ cp HELD_CRITICAL_UP ; Increased critical chance. Only Scope Lens has this.
pop bc
jr nz, .Tally
@@ -7654,7 +7654,7 @@ BattleCommand4d: ; 36ac9
call GetUserItem
ld a, b
- cp $4b ; king's rock
+ cp HELD_TRADE_EVOLVE ; king's rock
ret nz
call CheckSubstituteOpp