aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle/battle_transitions.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
committerdannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
commita02a98ee7ada1a658e28698484058be2796dc0df (patch)
tree945986054565bd8b5212fc755415096050d1d3a8 /engine/battle/battle_transitions.asm
parentUse long option flags for rgbgfx, same as tools/gfx (diff)
parentUse `const_skip` (diff)
downloadpokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.gz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.xz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/battle/battle_transitions.asm')
-rw-r--r--engine/battle/battle_transitions.asm24
1 files changed, 16 insertions, 8 deletions
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index 77f2ba89..69cc1203 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -11,7 +11,7 @@ BattleTransition:
; Determine which OAM block is being used by the enemy trainer sprite (if there
; is one).
ld hl, wSpritePlayerStateData1ImageIndex
- ldh a, [hSpriteIndexOrTextID] ; enemy trainer sprite index (0 if wild battle)
+ ldh a, [hSpriteIndex] ; enemy trainer sprite index (0 if wild battle)
ld c, a
ld b, 0
ld de, $10
@@ -64,6 +64,12 @@ BattleTransition:
ld l, a
jp hl
+ const_def
+ const BIT_TRAINER_BATTLE_TRANSITION ; 0
+ const BIT_STRONGER_BATTLE_TRANSITION ; 1
+ const BIT_DUNGEON_BATTLE_TRANSITION ; 2
+DEF NUM_BATTLE_TRANSITION_BITS EQU const_value
+
; the three GetBattleTransitionID functions set the first
; three bits of c, which determines what transition animation
; to play at the beginning of a battle
@@ -71,6 +77,7 @@ BattleTransition:
; bit 1: set if enemy is at least 3 levels higher than player
; bit 2: set if dungeon map
BattleTransitions:
+ table_width 2, BattleTransitions
dw BattleTransition_DoubleCircle ; %000
dw BattleTransition_Spiral ; %001
dw BattleTransition_Circle ; %010
@@ -79,15 +86,16 @@ BattleTransitions:
dw BattleTransition_Shrink ; %101
dw BattleTransition_VerticalStripes ; %110
dw BattleTransition_Split ; %111
+ assert_table_length 1 << NUM_BATTLE_TRANSITION_BITS
GetBattleTransitionID_WildOrTrainer:
ld a, [wCurOpponent]
cp OPP_ID_OFFSET
jr nc, .trainer
- res 0, c
+ res BIT_TRAINER_BATTLE_TRANSITION, c
ret
.trainer
- set 0, c
+ set BIT_TRAINER_BATTLE_TRANSITION, c
ret
GetBattleTransitionID_CompareLevels:
@@ -105,15 +113,15 @@ GetBattleTransitionID_CompareLevels:
ld a, [hl]
add $3
ld e, a
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
sub e
jr nc, .highLevelEnemy
- res 1, c
+ res BIT_STRONGER_BATTLE_TRANSITION, c
ld a, 1
ld [wBattleTransitionSpiralDirection], a
ret
.highLevelEnemy
- set 1, c
+ set BIT_STRONGER_BATTLE_TRANSITION, c
xor a
ld [wBattleTransitionSpiralDirection], a
ret
@@ -129,7 +137,7 @@ GetBattleTransitionID_IsDungeonMap:
cp e
jr nz, .loop1
.match
- set 2, c
+ set BIT_DUNGEON_BATTLE_TRANSITION, c
ret
.noMatch1
ld hl, DungeonMaps2
@@ -145,7 +153,7 @@ GetBattleTransitionID_IsDungeonMap:
cp d
jr nc, .match
.noMatch2
- res 2, c
+ res BIT_DUNGEON_BATTLE_TRANSITION, c
ret
INCLUDE "data/maps/dungeon_maps.asm"