shithub: pokered

Download patch

ref: a957bb154046427966d6e00de526adab13388938
parent: 8a80f2c85223eb4f9bba9e9ee103dac348a8b107
author: YamaArashi <shadow962@live.com>
date: Sun Jul 12 11:51:04 EDT 2015

some battle animation stuff

--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -1292,12 +1292,12 @@
 	ld c, $7
 	ld a, [H_WHOSETURN]
 	and a
-	ld hl, wTileMap + $79
-	ld de, wTileMap + $65
+	hlCoord 1, 6
+	deCoord 1, 5
 	ld a, $30
 	jr z, .asm_79291
-	ld hl, wTileMap + $20
-	ld de, wTileMap + $c
+	hlCoord 12, 1
+	deCoord 12, 0
 	ld a, $ff
 .asm_79291
 	ld [wd09f], a
@@ -1345,7 +1345,7 @@
 	call CopyData
 	pop de
 	pop hl
-	ld bc, $0028
+	ld bc, SCREEN_WIDTH * 2
 	add hl, bc
 	pop bc
 	dec b
@@ -1352,9 +1352,9 @@
 	jr nz, .asm_792c4
 	ld a, [H_WHOSETURN]
 	and a
-	ld hl, wTileMap + $dd
+	hlCoord 1, 11
 	jr z, .asm_792e2
-	ld hl, wTileMap + $84
+	hlCoord 12, 6
 .asm_792e2
 	ld a, [wd09f]
 	inc a
@@ -1513,11 +1513,11 @@
 ; The mon's sprite disappears after this animation.
 	ld a, [H_WHOSETURN]
 	and a
-	ld hl, wTileMap + $64
-	ld de, wTileMap + $66
+	hlCoord 0, 5
+	deCoord 2, 5
 	jr z, .asm_793c2
-	ld hl, wTileMap + $b
-	ld de, wTileMap + $d
+	hlCoord 11, 0
+	deCoord 13, 0
 
 .asm_793c2
 	xor a
@@ -2061,23 +2061,24 @@
 	ld a, BANK(SlowbroSprite)
 	jp FarCopyData2
 
-Func_79747: ; 79747 (1e:5747)
+HideSubstituteShowMonAnim: ; 79747 (1e:5747)
 	ld a, [H_WHOSETURN]
 	and a
-	ld hl, wccf7
+	ld hl, wPlayerMonMinimized
 	ld a, [W_PLAYERBATTSTATUS2]
-	jr z, .asm_79758
-	ld hl, wccf3
+	jr z, .next1
+	ld hl, wEnemyMonMinimized
 	ld a, [W_ENEMYBATTSTATUS2]
-.asm_79758
+.next1
 	push hl
-	bit 4, a
-	jr nz, .asm_79762
+; if the substitute broke, slide it down, else slide it offscreen horizontally
+	bit HasSubstituteUp, a
+	jr nz, .substituteStillUp
 	call AnimationSlideMonDown
-	jr .asm_79765
-.asm_79762
+	jr .next2
+.substituteStillUp
 	call AnimationSlideMonOut
-.asm_79765
+.next2
 	pop hl
 	ld a, [hl]
 	and a
@@ -2085,7 +2086,7 @@
 	call AnimationFlashMonPic
 	jp AnimationShowMonPic
 
-Func_79771: ; 79771 (1e:5771)
+ReshowSubstituteAnim: ; 79771 (1e:5771)
 	call AnimationSlideMonOut
 	call AnimationSubstitute
 	jp AnimationShowMonPic
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -848,7 +848,7 @@
 	ld [hl], a
 	ld [W_ENEMYDISABLEDMOVE], a
 	ld [wEnemyDisabledMoveNumber], a
-	ld [wccf3], a
+	ld [wEnemyMonMinimized], a
 	ld hl, wPlayerUsedMove
 	ld [hli], a
 	ld [hl], a
@@ -1376,7 +1376,7 @@
 	ld [hl],a
 	ld [W_ENEMYDISABLEDMOVE],a
 	ld [wEnemyDisabledMoveNumber],a
-	ld [wccf3],a
+	ld [wEnemyMonMinimized],a
 	ld hl,wPlayerUsedMove
 	ld [hli],a
 	ld [hl],a
@@ -1826,7 +1826,7 @@
 	ld [hl], a
 	ld [W_PLAYERDISABLEDMOVE], a
 	ld [wPlayerDisabledMoveNumber], a
-	ld [wccf7], a
+	ld [wPlayerMonMinimized], a
 	ld b, $1
 	call GoPAL_SET
 	ld hl, W_ENEMYBATTSTATUS1
@@ -2448,7 +2448,7 @@
 	ld hl, AnimationSubstitute
 	jr nz, .doEnemyMonAnimation
 ; enemy mon doesn't have substitute
-	ld a, [wccf3]
+	ld a, [wEnemyMonMinimized]
 	and a ; has the enemy mon used Minimise?
 	ld hl, AnimationMinimizeMon
 	jr nz, .doEnemyMonAnimation
@@ -3215,9 +3215,9 @@
 playPlayerMoveAnimation
 	push af
 	ld a,[W_PLAYERBATTSTATUS2]
-	bit 4,a
-	ld hl,Func_79747
-	ld b,BANK(Func_79747)
+	bit HasSubstituteUp,a
+	ld hl,HideSubstituteShowMonAnim
+	ld b,BANK(HideSubstituteShowMonAnim)
 	call nz,Bankswitch
 	pop af
 	ld [wAnimationType],a
@@ -3226,9 +3226,9 @@
 	call HandleExplodingAnimation
 	call DrawPlayerHUDAndHPBar
 	ld a,[W_PLAYERBATTSTATUS2]
-	bit 4,a
-	ld hl,Func_79771
-	ld b,BANK(Func_79771)
+	bit HasSubstituteUp,a
+	ld hl,ReshowSubstituteAnim
+	ld b,BANK(ReshowSubstituteAnim)
 	call nz,Bankswitch
 	jr MirrorMoveCheck
 playerCheckIfFlyOrChargeEffect
@@ -5089,7 +5089,7 @@
 	ld a,[H_WHOSETURN]
 	xor a,$01
 	ld [H_WHOSETURN],a
-	callab Func_79747 ; animate the substitute breaking
+	callab HideSubstituteShowMonAnim ; animate the substitute breaking
 ; flip the turn back to the way it was
 	ld a,[H_WHOSETURN]
 	xor a,$01
@@ -5767,8 +5767,8 @@
 	push af
 	ld a, [W_ENEMYBATTSTATUS2]
 	bit HasSubstituteUp, a ; does mon have a substitute?
-	ld hl, Func_79747
-	ld b, BANK(Func_79747)
+	ld hl, HideSubstituteShowMonAnim
+	ld b, BANK(HideSubstituteShowMonAnim)
 	call nz, Bankswitch
 	pop af
 	ld [wAnimationType], a
@@ -5778,8 +5778,8 @@
 	call DrawEnemyHUDAndHPBar
 	ld a, [W_ENEMYBATTSTATUS2]
 	bit HasSubstituteUp, a ; does mon have a substitute?
-	ld hl, Func_79771
-	ld b, BANK(Func_79771)
+	ld hl, ReshowSubstituteAnim
+	ld b, BANK(ReshowSubstituteAnim)
 	call nz, Bankswitch ; slide the substitute's sprite out
 	jr EnemyCheckIfMirrorMoveEffect
 
@@ -7657,24 +7657,26 @@
 	call PrintStatText
 	ld hl, W_PLAYERBATTSTATUS2
 	ld de, W_PLAYERMOVENUM
-	ld bc, wccf7
+	ld bc, wPlayerMonMinimized
 	ld a, [H_WHOSETURN]
 	and a
 	jr z, .asm_3f4e6
 	ld hl, W_ENEMYBATTSTATUS2
 	ld de, W_ENEMYMOVENUM
-	ld bc, wccf3
+	ld bc, wEnemyMonMinimized
 .asm_3f4e6
 	ld a, [de]
 	cp MINIMIZE
 	jr nz, .asm_3f4f9
-	bit HasSubstituteUp, [hl] ; substitute
+ ; if a substitute is up, slide off the substitute and show the mon pic before
+ ; playing the minimize animation
+	bit HasSubstituteUp, [hl]
 	push af
 	push bc
-	ld hl, Func_79747
-	ld b, BANK(Func_79747)
+	ld hl, HideSubstituteShowMonAnim
+	ld b, BANK(HideSubstituteShowMonAnim)
 	push de
-	call nz, Bankswitch ; play Minimize animation unless there's Substitute involved
+	call nz, Bankswitch
 	pop de
 .asm_3f4f9
 	call PlayCurrentMoveAnimation
@@ -7684,8 +7686,8 @@
 	pop bc
 	ld a, $1
 	ld [bc], a
-	ld hl, Func_79771
-	ld b, BANK(Func_79771)
+	ld hl, ReshowSubstituteAnim
+	ld b, BANK(ReshowSubstituteAnim)
 	pop af
 	call nz, Bankswitch
 .applyBadgeBoostsAndStatusPenalties
--- a/engine/battle/moveEffects/transform_effect.asm
+++ b/engine/battle/moveEffects/transform_effect.asm
@@ -26,8 +26,8 @@
 ; animation(s) played are different if target has Substitute up
 	bit HasSubstituteUp, [hl]
 	push af
-	ld hl, Func_79747
-	ld b, BANK(Func_79747)
+	ld hl, HideSubstituteShowMonAnim
+	ld b, BANK(HideSubstituteShowMonAnim)
 	call nz, Bankswitch
 	ld a, [W_OPTIONS]
 	add a
@@ -38,8 +38,8 @@
 	ld b, BANK(AnimationTransformMon)
 .gotAnimToPlay
 	call Bankswitch
-	ld hl, Func_79771
-	ld b, BANK(Func_79771)
+	ld hl, ReshowSubstituteAnim
+	ld b, BANK(ReshowSubstituteAnim)
 	pop af
 	call nz, Bankswitch
 	pop bc
--- a/wram.asm
+++ b/wram.asm
@@ -445,7 +445,7 @@
 wPlayerUsedMove:: ds 1 ; ccf1
 wEnemyUsedMove:: ds 1 ; ccf2
 
-wccf3:: ds 1 ; used with the move minimize
+wEnemyMonMinimized:: ds 1 ; ccf3
 
 wMoveDidntMiss:: ds 1 ; ccf4
 
@@ -454,7 +454,9 @@
 	flag_array 6
 
 wccf6:: ds 1 ; used in some hp bar thing
-wccf7:: ds 14 ; used with substitute move sliding thing? (not sure)
+wPlayerMonMinimized:: ds 1 ; ccf7
+
+ds 13
 
 wUnknownSlotVar:: ; cd05