shithub: pokecrystal

Download patch

ref: 04f5c5175343dde082e277420339341951a0b6fc
parent: 883a8b7a90d6de4a9c175ad29c29ece9cde637a7
author: yenatch <[email protected]>
date: Sun Jan 5 03:24:27 EST 2014

explicitly define type categories

--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -3444,7 +3444,7 @@
 	ret z
 
 	ld a, [hl]
-	cp FIRE
+	cp SPECIAL
 	jr nc, .special
 
 
@@ -3586,7 +3586,7 @@
 	and a
 	jr nz, .enemy
 	ld a, [PlayerMoveType]
-	cp FIRE
+	cp SPECIAL
 ; special
 	ld a, [PlayerSAtkLevel]
 	ld b, a
@@ -3600,7 +3600,7 @@
 
 .enemy
 	ld a, [EnemyMoveType]
-	cp FIRE
+	cp SPECIAL
 ; special
 	ld a, [EnemySAtkLevel]
 	ld b, a
@@ -3705,7 +3705,7 @@
 	ret z
 
 	ld a, [hl]
-	cp FIRE
+	cp SPECIAL
 	jr nc, .Special
 
 
@@ -4464,40 +4464,46 @@
 BattleCommand40: ; 35813
 ; counter
 
-	ld a, $1
+	ld a, 1
 	ld [AttackMissed], a
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	and a
 	ret z
-	ld b, a
 
+	ld b, a
 	callab GetMoveEffect
-
 	ld a, b
-	cp $59
+	cp EFFECT_COUNTER
 	ret z
+
 	call BattleCommanda3
 	ld a, [$d265]
 	and a
 	ret z
+
 	call Function36abf
 	ret z
+
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	dec a
 	ld de, StringBuffer1
 	call GetMoveData
+
 	ld a, [$d075]
 	and a
 	ret z
+
 	ld a, [$d076]
-	cp $14
+	cp SPECIAL
 	ret nc
+
 	ld hl, CurDamage
 	ld a, [hli]
 	or [hl]
 	ret z
+
 	ld a, [hl]
 	add a
 	ld [hld], a
@@ -4504,11 +4510,12 @@
 	ld a, [hl]
 	adc a
 	ld [hl], a
-	jr nc, .asm_3585f ; 35859 $4
+	jr nc, .capped
 	ld a, $ff
 	ld [hli], a
 	ld [hl], a
-.asm_3585f
+.capped
+
 	xor a
 	ld [AttackMissed], a
 	ret
@@ -10190,38 +10197,47 @@
 BattleCommand9a: ; 37c95
 ; mirrorcoat
 
-	ld a, $1
+	ld a, 1
 	ld [AttackMissed], a
+
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	and a
 	ret z
+
 	ld b, a
 	callab GetMoveEffect
 	ld a, b
-	cp $90
+	cp EFFECT_MIRROR_COAT
 	ret z
+
 	call BattleCommanda3
 	ld a, [$d265]
 	and a
 	ret z
+
 	call Function36abf
 	ret z
+
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	dec a
 	ld de, StringBuffer1
 	call GetMoveData
+
 	ld a, [$d075]
 	and a
 	ret z
+
 	ld a, [$d076]
-	cp $14
+	cp SPECIAL
 	ret c
+
 	ld hl, CurDamage
 	ld a, [hli]
 	or [hl]
 	ret z
+
 	ld a, [hl]
 	add a
 	ld [hld], a
@@ -10228,11 +10244,12 @@
 	ld a, [hl]
 	adc a
 	ld [hl], a
-	jr nc, .asm_37ce1 ; 37cdb $4
+	jr nc, .capped
 	ld a, $ff
 	ld [hli], a
 	ld [hl], a
-.asm_37ce1
+.capped
+
 	xor a
 	ld [AttackMissed], a
 	ret
--- a/battle/hidden_power.asm
+++ b/battle/hidden_power.asm
@@ -86,10 +86,10 @@
 	jr c, .done
 	inc a
 
-; Skip unused types between Steel and Fire
-	cp STEEL + 1
+; Skip unused types
+	cp UNUSED_TYPES
 	jr c, .done
-	add FIRE - (STEEL + 1)
+	add SPECIAL - UNUSED_TYPES
 
 .done