shithub: pokered

Download patch

ref: aa361c3bf7a302dd9a883ff869c06305f3fc0436
parent: 29aff84107a6463a94f0d7d81de8a1603e0d741f
author: yenatch <yenatch@gmail.com>
date: Wed Sep 17 08:37:47 EDT 2014

Use move animation constants instead of static values.

This allows new moves and animations to be added without overlap.

--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -525,9 +525,9 @@
 	ld [wcc79], a
 	ld b, $e4
 	ld a, [W_ANIMATIONID] ; W_ANIMATIONID
-	cp $aa
+	cp ANIM_AA
 	jr c, .asm_78e3f
-	cp $ae
+	cp ANIM_AD + 1
 	jr nc, .asm_78e3f
 	ld b, $f0
 .asm_78e3f
@@ -697,13 +697,13 @@
 	db ROCK_SLIDE
 	dw DoRockSlideSpecialEffects
 
-	db $AA
+	db ANIM_AA
 	dw Func_79041
 
-	db $AB
+	db ANIM_AB
 	dw Func_7904c
 
-	db $AC
+	db ANIM_AC
 	dw Func_7907c
 
 	db TOSS_ANIM
@@ -2855,10 +2855,10 @@
 
 .PokeBallAnimations: ; 79e50 (1e:5e50)
 ; sequence of animations that make up the Poké Ball toss
-	db POOF_ANIM,HIDEPIC_ANIM,$C2,POOF_ANIM,SHOWPIC_ANIM
+	db POOF_ANIM,HIDEPIC_ANIM,SHAKE_ANIM,POOF_ANIM,SHOWPIC_ANIM
 
 .BlockBall ; 5E55
-	ld a,$C1
+	ld a,TOSS_ANIM
 	ld [W_ANIMATIONID],a
 	call PlayAnimation
 	ld a,(SFX_08_43 - SFX_Headers_08) / 3
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -7062,16 +7062,16 @@
 	dec de
 	ld a, [H_WHOSETURN] ; $fff3
 	and a
-	ld b, $c7
+	ld b, ANIM_C7
 	ld hl, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
 	ld a, [de]
 	ld de, W_PLAYERTOXICCOUNTER ; wd06c
 	jr nz, .asm_3f2b0
-	ld b, $a9
+	ld b, ANIM_A9
 	ld hl, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
 	ld de, W_ENEMYTOXICCOUNTER ; wd071
 .asm_3f2b0
-	cp $5c
+	cp TOXIC
 	jr nz, .asm_3f2bd
 	set 0, [hl]
 	xor a
@@ -7173,7 +7173,7 @@
 	ld a, 1 << PAR
 	ld [wEnemyMonStatus], a
 	call Func_3ed27  ;quarter speed of affected monster
-	ld a, $a9
+	ld a, ANIM_A9
 	call Func_3fbb9  ;animation
 	jp PrintMayNotAttackText    ;print paralysis text
 .burn
@@ -7180,7 +7180,7 @@
 	ld a, 1 << BRN
 	ld [wEnemyMonStatus], a
 	call Func_3ed64
-	ld a, $a9
+	ld a, ANIM_A9
 	call Func_3fbb9  ;animation
 	ld hl, BurnedText
 	jp PrintText
@@ -7188,7 +7188,7 @@
 	call Func_3f9cf  ;resets bit 5 of the D063/D068 flags
 	ld a, 1 << FRZ
 	ld [wEnemyMonStatus], a
-	ld a, $a9
+	ld a, ANIM_A9
 	call Func_3fbb9  ;animation
 	ld hl, FrozenText
 	jp PrintText
@@ -7726,7 +7726,7 @@
 	inc a
 	ld [bc], a
 	ld a, [H_WHOSETURN]
-	add $ae
+	add XSTATITEM_ANIM
 	jp Func_3fb96
 
 ThrashPetalDanceEffect: ; 3f717 (f:7717)
@@ -7745,7 +7745,7 @@
 	inc a
 	ld [de], a
 	ld a, [H_WHOSETURN] ; $fff3
-	add $b0
+	add ANIM_B0
 	jp Func_3fb96
 
 SwitchAndTeleportEffect: ; 3f739 (f:7739)
@@ -7941,11 +7941,11 @@
 	ld de, W_PLAYERMOVEEFFECT ; wcfd3
 	ld a, [H_WHOSETURN] ; $fff3
 	and a
-	ld b, $ae
+	ld b, XSTATITEM_ANIM
 	jr z, .asm_3f8a1
 	ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1
 	ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT
-	ld b, $af
+	ld b, ANIM_AF
 .asm_3f8a1
 	set 4, [hl]
 	ld a, [de]
@@ -7953,13 +7953,13 @@
 	cp FLY_EFFECT
 	jr nz, .asm_3f8ad
 	set 6, [hl] ; mon is now invulnerable to typical attacks (fly/dig)
-	ld b, $64
+	ld b, TELEPORT
 .asm_3f8ad
 	ld a, [de]
 	cp DIG
 	jr nz, .asm_3f8b6
 	set 6, [hl] ; mon is now invulnerable to typical attacks (fly/dig)
-	ld b, $c0
+	ld b, ANIM_C0
 .asm_3f8b6
 	xor a
 	ld [wcc5b], a
--- a/engine/trade.asm
+++ b/engine/trade.asm
@@ -203,9 +203,9 @@
 	and a
 	jr nz, .asm_41273
 	call Delay50
-	ld a, $ad
+	ld a, ANIM_AD
 	call Func_41676
-	ld a, $aa
+	ld a, ANIM_AA
 	call Func_41676
 	ld a, [wWhichTrade] ; wWhichTrade
 	call PlayCry
@@ -242,9 +242,9 @@
 	ret
 
 Func_412d2: ; 412d2 (10:52d2)
-	ld a, $ab
+	ld a, ANIM_AB
 	call Func_41676
-	ld c, $a
+	ld c, 10
 	call DelayFrames
 	ld a, $e4
 	ld [rOBP0], a ; $ff48
@@ -295,7 +295,7 @@
 	db $7E,$40,$7E,$60
 
 Func_41336: ; 41336 (10:5336)
-	ld a, $ac
+	ld a, ANIM_AC
 	call Func_41676
 	call Func_415c8
 	hlCoord 4, 10
@@ -308,7 +308,7 @@
 	ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
 	ld a, [wTrainerEngageDistance]
 	call Func_415a4
-	ld a, $ad
+	ld a, ANIM_AD
 	call Func_41676
 	ld a, $1
 	ld [H_AUTOBGTRANSFERENABLED], a ; $ffba