Identify battle bg effects functions and constants (#773)

Identify battle bg effects functions and constants
This commit is contained in:
7Soul 2020-10-06 16:45:09 -03:00 committed by GitHub
parent fc08ff2c38
commit cf26f55985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 406 additions and 367 deletions

View File

@ -219,7 +219,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture
const_def
const BATTLEANIMFUNC_NULL
const BATTLEANIMFUNC_USER_TO_TARGET
const BATTLEANIMFUNC_USER_TO_TARGET_DISSAPPEAR
const BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR
const BATTLEANIMFUNC_MOVE_IN_CIRCLE
const BATTLEANIMFUNC_WAVE_TO_TARGET
const BATTLEANIMFUNC_THROW_TO_TARGET
@ -712,9 +712,9 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture
const ANIM_BG_WHITE_HUES
const ANIM_BG_BLACK_HUES
const ANIM_BG_ALTERNATE_HUES
const ANIM_BG_06
const ANIM_BG_07
const ANIM_BG_08
const ANIM_BG_CYCLE_OBPALS_GRAY_AND_YELLOW
const ANIM_BG_CYCLE_MID_OBPALS_GRAY_AND_YELLOW
const ANIM_BG_CYCLE_BGPALS_INVERTED
const ANIM_BG_HIDE_MON
const ANIM_BG_SHOW_MON
const ANIM_BG_ENTER_MON
@ -728,38 +728,38 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture
const ANIM_BG_DOUBLE_TEAM
const ANIM_BG_ACID_ARMOR
const ANIM_BG_RAPID_FLASH
const ANIM_BG_16
const ANIM_BG_17
const ANIM_BG_18
const ANIM_BG_19
const ANIM_BG_1A
const ANIM_BG_1B
const ANIM_BG_1C
const ANIM_BG_1D
const ANIM_BG_1E
const ANIM_BG_1F
const ANIM_BG_20
const ANIM_BG_FADE_MON_TO_LIGHT
const ANIM_BG_FADE_MON_TO_BLACK
const ANIM_BG_FADE_MON_TO_LIGHT_REPEATING
const ANIM_BG_FADE_MON_TO_BLACK_REPEATING
const ANIM_BG_CYCLE_MON_LIGHT_DARK_REPEATING
const ANIM_BG_FLASH_MON_REPEATING
const ANIM_BG_FADE_MONS_TO_BLACK_REPEATING
const ANIM_BG_FADE_MON_TO_WHITE_WAIT_FADE_BACK
const ANIM_BG_FADE_MON_FROM_WHITE
const ANIM_BG_SHAKE_SCREEN_X
const ANIM_BG_SHAKE_SCREEN_Y
const ANIM_BG_WITHDRAW
const ANIM_BG_BOUNCE_DOWN
const ANIM_BG_DIG
const ANIM_BG_TACKLE
const ANIM_BG_25
const ANIM_BG_26
const ANIM_BG_27
const ANIM_BG_WAVE_DEFORM_USER
const ANIM_BG_PSYCHIC
const ANIM_BG_2A
const ANIM_BG_2B
const ANIM_BG_2C
const ANIM_BG_2D
const ANIM_BG_2E
const ANIM_BG_2F
const ANIM_BG_30
const ANIM_BG_31
const ANIM_BG_32
const ANIM_BG_VIBRATE_MON
const ANIM_BG_BODY_SLAM
const ANIM_BG_WOBBLE_MON
const ANIM_BG_35
const ANIM_BG_REMOVE_MON
const ANIM_BG_WAVE_DEFORM_MON
const ANIM_BG_PSYCHIC
const ANIM_BG_BETA_SEND_OUT_MON1
const ANIM_BG_BETA_SEND_OUT_MON2
const ANIM_BG_FLAIL
const ANIM_BG_BETA_PURSUIT
const ANIM_BG_ROLLOUT
const ANIM_BG_VITAL_THROW
const ANIM_BG_START_WATER
const ANIM_BG_WATER
const ANIM_BG_END_WATER
const ANIM_BG_VIBRATE_MON
const ANIM_BG_WOBBLE_PLAYER
const ANIM_BG_WOBBLE_SCREEN
; AnimObjGFX indexes (see data/battle_anims/object_gfx.asm)
const_def 1
@ -814,6 +814,11 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture
BG_EFFECT_STRUCT_LENGTH EQU const_value
NUM_BG_EFFECTS EQU 5 ; see wActiveBGEffects
;
const_def
const BG_EFFECT_TARGET ; 0
const BG_EFFECT_USER ; 1
; battle palettes
const_def
const PAL_BATTLE_BG_PLAYER ; 0

View File

@ -94,7 +94,7 @@ BattleAnimObjects:
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_54, BATTLEANIMFUNC_WRAP, PAL_BATTLE_OB_GREEN, ANIM_GFX_ROPE ; ANIM_OBJ_BIND2
battleanimobj RELATIVE_X | X_FLIP, $68, BATTLEANIMFRAMESET_56, BATTLEANIMFUNC_LEECH_SEED, PAL_BATTLE_OB_GREEN, ANIM_GFX_PLANT ; ANIM_OBJ_LEECH_SEED
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_59, BATTLEANIMFUNC_SOUND, PAL_BATTLE_OB_GRAY, ANIM_GFX_NOISE ; ANIM_OBJ_SOUND
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_5C, BATTLEANIMFUNC_USER_TO_TARGET_DISSAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_PSYCHIC ; ANIM_OBJ_WAVE
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_5C, BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_PSYCHIC ; ANIM_OBJ_WAVE
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_5D, BATTLEANIMFUNC_CONFUSE_RAY, PAL_BATTLE_OB_YELLOW, ANIM_GFX_SPEED ; ANIM_OBJ_CONFUSE_RAY
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLEANIMFRAMESET_5F, BATTLEANIMFUNC_NULL, PAL_BATTLE_OB_YELLOW, ANIM_GFX_BEAM ; ANIM_OBJ_LEER
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_SHAKE, PAL_BATTLE_OB_YELLOW, ANIM_GFX_BEAM ; ANIM_OBJ_LEER_TIP
@ -118,11 +118,11 @@ BattleAnimObjects:
battleanimobj RELATIVE_X, $48, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_PETAL_DANCE, PAL_BATTLE_OB_RED, ANIM_GFX_FLOWER ; ANIM_OBJ_PETAL_DANCE
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_THROW_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_EGG ; ANIM_OBJ_SLUDGE_BOMB
battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_75, BATTLEANIMFUNC_THIEF_PAYDAY, PAL_BATTLE_OB_BROWN, ANIM_GFX_STATUS ; ANIM_OBJ_PAY_DAY
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_USER_TO_TARGET_DISSAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_WHIP ; ANIM_OBJ_SONICBOOM_JP_UNUSED
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_WHIP ; ANIM_OBJ_SONICBOOM_JP_UNUSED
battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_ABSORB_CIRCLE, PAL_BATTLE_OB_GRAY, ANIM_GFX_SPEED ; ANIM_OBJ_MIMIC
battleanimobj RELATIVE_X, $78, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_POISON_GAS, PAL_BATTLE_OB_RED, ANIM_GFX_OBJECTS ; ANIM_OBJ_ATTRACT
battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_BONEMERANG, PAL_BATTLE_OB_GRAY, ANIM_GFX_MISC ; ANIM_OBJ_BONEMERANG
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_USER_TO_TARGET_DISSAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_MISC ; ANIM_OBJ_BONE_CLUB
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_MISC ; ANIM_OBJ_BONE_CLUB
battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_NULL, PAL_BATTLE_OB_GRAY, ANIM_GFX_MISC ; ANIM_OBJ_BONE_RUSH
battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_USER_TO_TARGET_SPIN, PAL_BATTLE_OB_YELLOW, ANIM_GFX_OBJECTS ; ANIM_OBJ_SWIFT
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_79, BATTLEANIMFUNC_NULL, PAL_BATTLE_OB_GRAY, ANIM_GFX_MISC ; ANIM_OBJ_KINESIS
@ -158,11 +158,11 @@ BattleAnimObjects:
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_97, BATTLEANIMFUNC_SAFEGUARD_PROTECT, PAL_BATTLE_OB_GRAY, ANIM_GFX_MISC ; ANIM_OBJ_SAFEGUARD
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_SAFEGUARD_PROTECT, PAL_BATTLE_OB_YELLOW, ANIM_GFX_OBJECTS ; ANIM_OBJ_PROTECT
battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_THIEF_PAYDAY, PAL_BATTLE_OB_GRAY, ANIM_GFX_STATUS ; ANIM_OBJ_THIEF
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_USER_TO_TARGET_DISSAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_EGG ; ANIM_OBJ_OCTAZOOKA
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, ANIM_GFX_EGG ; ANIM_OBJ_OCTAZOOKA
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_PRESENT_SMOKESCREEN, PAL_BATTLE_OB_RED, ANIM_GFX_STATUS ; ANIM_OBJ_PRESENT
battleanimobj RELATIVE_X | X_FLIP, $70, BATTLEANIMFRAMESET_8B, BATTLEANIMFUNC_SPIKES, PAL_BATTLE_OB_GRAY, ANIM_GFX_MISC ; ANIM_OBJ_SPIKES
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_15, BATTLEANIMFUNC_USER_TO_TARGET_SPIN, PAL_BATTLE_OB_GRAY, ANIM_GFX_ICE ; ANIM_OBJ_POWDER_SNOW
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_USER_TO_TARGET_DISSAPPEAR, PAL_BATTLE_OB_RED, ANIM_GFX_FIRE ; ANIM_OBJ_DRAGONBREATH
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_RED, ANIM_GFX_FIRE ; ANIM_OBJ_DRAGONBREATH
battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_CONVERSION, PAL_BATTLE_OB_GRAY, ANIM_GFX_EXPLOSION ; ANIM_OBJ_CONVERSION
battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_9A, BATTLEANIMFUNC_NULL, PAL_BATTLE_OB_GRAY, ANIM_GFX_WEB ; ANIM_OBJ_SPIDER_WEB
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_9B, BATTLEANIMFUNC_PRESENT_SMOKESCREEN, PAL_BATTLE_OB_RED, ANIM_GFX_OBJECTS ; ANIM_OBJ_CAKE_UNUSED
@ -181,7 +181,7 @@ BattleAnimObjects:
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_A6, BATTLEANIMFUNC_NULL, PAL_BATTLE_OB_GRAY, ANIM_GFX_CUT ; ANIM_OBJ_CROSS_CHOP1
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_A7, BATTLEANIMFUNC_NULL, PAL_BATTLE_OB_GRAY, ANIM_GFX_CUT ; ANIM_OBJ_CROSS_CHOP2
battleanimobj RELATIVE_X | X_FLIP, $00, BATTLEANIMFRAMESET_B4, BATTLEANIMFUNC_RAIN_SANDSTORM, PAL_BATTLE_OB_BROWN, ANIM_GFX_POWDER ; ANIM_OBJ_SANDSTORM
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_A8, BATTLEANIMFUNC_USER_TO_TARGET_DISSAPPEAR, PAL_BATTLE_OB_YELLOW, ANIM_GFX_LIGHTNING ; ANIM_OBJ_ZAP_CANNON
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_A8, BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_YELLOW, ANIM_GFX_LIGHTNING ; ANIM_OBJ_ZAP_CANNON
battleanimobj RELATIVE_X | X_FLIP, $40, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_POWDER, PAL_BATTLE_OB_GRAY, ANIM_GFX_ANGELS ; ANIM_OBJ_SPITE
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLEANIMFRAMESET_A9, BATTLEANIMFUNC_CURSE, PAL_BATTLE_OB_GRAY, ANIM_GFX_OBJECTS ; ANIM_OBJ_CURSE
battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_PERISH_SONG, PAL_BATTLE_OB_GRAY, ANIM_GFX_NOISE ; ANIM_OBJ_PERISH_SONG

File diff suppressed because it is too large Load Diff

View File

@ -112,7 +112,7 @@ RunBattleAnimScript:
cp ROLLOUT
jr nz, .not_rollout
ld a, ANIM_BG_2E
ld a, ANIM_BG_ROLLOUT
ld b, NUM_BG_EFFECTS
ld de, BG_EFFECT_STRUCT_LENGTH
ld hl, wBGEffect1Function

View File

@ -85,9 +85,9 @@ BattleBGEffects:
dw BattleBGEffect_WhiteHues
dw BattleBGEffect_BlackHues
dw BattleBGEffect_AlternateHues
dw BattleBGEffect_06
dw BattleBGEffect_07
dw BattleBGEffect_08
dw BattleBGEffect_CycleOBPalsGrayAndYellow
dw BattleBGEffect_CycleMidOBPalsGrayAndYellow
dw BattleBGEffect_CycleBGPals_Inverted
dw BattleBGEffect_HideMon
dw BattleBGEffect_ShowMon
dw BattleBGEffect_EnterMon
@ -101,38 +101,38 @@ BattleBGEffects:
dw BattleBGEffect_DoubleTeam
dw BattleBGEffect_AcidArmor
dw BattleBGEffect_RapidFlash
dw BattleBGEffect_16
dw BattleBGEffect_17
dw BattleBGEffect_18
dw BattleBGEffect_19
dw BattleBGEffect_1a
dw BattleBGEffect_1b
dw BattleBGEffect_1c
dw BattleBGEffect_1d
dw BattleBGEffect_1e
dw BattleBGEffect_1f
dw BattleBGEffect_20
dw BattleBGEffect_FadeMonToLight
dw BattleBGEffect_FadeMonToBlack
dw BattleBGEffect_FadeMonToLightRepeating
dw BattleBGEffect_FadeMonToBlackRepeating
dw BattleBGEffect_CycleMonLightDarkRepeating
dw BattleBGEffect_FlashMonRepeating
dw BattleBGEffect_FadeMonsToBlackRepeating
dw BattleBGEffect_FadeMonToWhiteWaitFadeBack
dw BattleBGEffect_FadeMonFromWhite
dw BattleBGEffect_ShakeScreenX
dw BattleBGEffect_ShakeScreenY
dw BattleBGEffect_Withdraw
dw BattleBGEffect_BounceDown
dw BattleBGEffect_Dig
dw BattleBGEffect_Tackle
dw BattleBGEffect_25
dw BattleBGEffect_26
dw BattleBGEffect_27
dw BattleBGEffect_28
dw BattleBGEffect_Psychic
dw BattleBGEffect_2a
dw BattleBGEffect_2b
dw BattleBGEffect_2c
dw BattleBGEffect_2d
dw BattleBGEffect_2e
dw BattleBGEffect_2f
dw BattleBGEffect_30
dw BattleBGEffect_31
dw BattleBGEffect_32
dw BattleBGEffect_VibrateMon
dw BattleBGEffect_BodySlam
dw BattleBGEffect_WobbleMon
dw BattleBGEffect_35
dw BattleBGEffect_RemoveMon
dw BattleBGEffect_WaveDeformMon
dw BattleBGEffect_Psychic
dw BattleBGEffect_BetaSendOutMon1
dw BattleBGEffect_BetaSendOutMon2
dw BattleBGEffect_Flail
dw BattleBGEffect_BetaPursuit
dw BattleBGEffect_Rollout
dw BattleBGEffect_VitalThrow
dw BattleBGEffect_StartWater
dw BattleBGEffect_Water
dw BattleBGEffect_EndWater
dw BattleBGEffect_VibrateMon
dw BattleBGEffect_WobblePlayer
dw BattleBGEffect_WobbleScreen
BattleBGEffect_End:
call EndBattleBGEffect
@ -280,7 +280,7 @@ BattleBGEffect_AlternateHues:
dc 2, 1, 0, 0
db -2
BattleBGEffect_06:
BattleBGEffect_CycleOBPalsGrayAndYellow:
call BattleBGEffects_CheckSGB
jr nz, .sgb
ld de, .PalsCGB
@ -303,7 +303,7 @@ BattleBGEffect_06:
dc 3, 0, 0, 0
db -2
BattleBGEffect_07:
BattleBGEffect_CycleMidOBPalsGrayAndYellow:
call BattleBGEffects_CheckSGB
jr nz, .sgb
ld de, .PalsCGB
@ -326,7 +326,7 @@ BattleBGEffect_07:
dc 3, 0, 3, 0
db -2
BattleBGEffect_08:
BattleBGEffect_CycleBGPals_Inverted:
ld de, .Pals
call BattleBGEffect_GetNthDMGPal
ld [wBGP], a
@ -541,7 +541,8 @@ _QueueBattleAnimation:
callfar QueueBattleAnimation
ret
BattleBGEffect_27:
BattleBGEffect_RemoveMon:
; Slides mon out of screen
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -985,7 +986,7 @@ BattleBGEffect_Whirlpool:
ld a, $5e
ldh [hLYOverrideEnd], a
lb de, 2, 2
call Functionc8f2e
call DeformScreen
ret
.one
@ -996,14 +997,15 @@ BattleBGEffect_Whirlpool:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_30:
BattleBGEffect_StartWater:
call BattleBGEffects_ClearLYOverrides
ld a, LOW(rSCY)
call BattleBGEffect_SetLCDStatCustoms1
call EndBattleBGEffect
ret
BattleBGEffect_31:
BattleBGEffect_Water:
; BG_EFFECT_STRUCT_JT_INDEX: defines Y position of deformation
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@ -1029,7 +1031,7 @@ BattleBGEffect_31:
jr nc, .done
inc [hl]
inc [hl]
call Functionc8f9a
call DeformWater
ret
.done
@ -1037,11 +1039,12 @@ BattleBGEffect_31:
call EndBattleBGEffect
ret
BattleBGEffect_32:
BattleBGEffect_EndWater:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_Psychic:
; Hardcoded to always affect opponent
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -1058,7 +1061,7 @@ BattleBGEffect_Psychic:
ld a, $5f
ldh [hLYOverrideEnd], a
lb de, 6, 5
call Functionc8f2e
call DeformScreen
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld [hl], $0
@ -1091,7 +1094,7 @@ BattleBGEffect_Teleport:
ld a, LOW(rSCX)
call BattleBGEffect_SetLCDStatCustoms1
lb de, 6, 5
call Functionc8f2e
call DeformScreen
ret
.one
@ -1118,7 +1121,7 @@ BattleBGEffect_NightShade:
add hl, bc
ld e, [hl]
ld d, 2
call Functionc8f2e
call DeformScreen
ret
.one
@ -1239,7 +1242,7 @@ BattleBGEffect_AcidArmor:
add hl, bc
ld e, [hl]
ld d, 2
call Functionc8f2e
call DeformScreen
ld h, HIGH(wLYOverridesBackup)
ldh a, [hLYOverrideEnd]
ld l, a
@ -1403,11 +1406,14 @@ BattleBGEffect_Tackle:
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
dw Tackle_BGEffect25_2d_one
dw Tackle_BGEffect25_2d_two
dw Tackle_MoveForward
dw Tackle_ReturnMove
dw .three
.zero
; Prepares mon to move forward (player moves right, enemy moves left)
; BG_EFFECT_STRUCT_03 will keep track of distance moved, so it's reset to 0 here
; BG_EFFECT_STRUCT_BATTLE_TURN is set to 2 or -2 depending on target
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, LOW(rSCX)
@ -1433,15 +1439,18 @@ BattleBGEffect_Tackle:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_25:
BattleBGEffect_BodySlam:
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
dw Tackle_BGEffect25_2d_one
dw Tackle_BGEffect25_2d_two
dw Tackle_MoveForward
dw Tackle_ReturnMove
dw .three
.zero
; Prepares mon to move forward (player moves right, enemy moves left)
; BG_EFFECT_STRUCT_03 will keep track of distance moved, so it's reset to 0 here
; BG_EFFECT_STRUCT_BATTLE_TURN is set to 2 or -2 depending on target
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, LOW(rSCX)
@ -1467,7 +1476,10 @@ BattleBGEffect_25:
call BattleAnim_ResetLCDStatCustom
ret
Tackle_BGEffect25_2d_one:
Tackle_MoveForward:
; Moves user horizontally in a direction that can be positive or negative. When the limit is reached (8 pixels) we move to the next function in the jumptable (Tackle_ReturnMove)
; BG_EFFECT_STRUCT_BATTLE_TURN: speed and direction
; BG_EFFECT_STRUCT_03: keeps track of distance moved
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@ -1488,14 +1500,17 @@ Tackle_BGEffect25_2d_one:
ld [hl], a
ret
Tackle_BGEffect25_2d_two:
Tackle_ReturnMove:
; Move user horizontally back to initial position. When we back to position 0, we move to the next function in the jumptable
; BG_EFFECT_STRUCT_BATTLE_TURN: is turned into a negative number (this number is not saved to preserve the initial number)
; BG_EFFECT_STRUCT_03: keeps track of distance moved
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
and a
jr nz, .asm_c8893
jr nz, .move_back
call BattleBGEffects_IncrementJumptable
.asm_c8893
.move_back
call Functionc88a5
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
@ -1560,19 +1575,21 @@ Functionc88a5:
jr nz, .loop
ret
BattleBGEffect_2d:
BattleBGEffect_BetaPursuit: ; unused
call BattleBGEffects_AnonJumptable
.anon_dw
dw BGEffect2d_2f_zero
dw Tackle_BGEffect25_2d_one
dw Tackle_BGEffect25_2d_two
dw VitalThrow_MoveBackwards
dw Tackle_MoveForward
dw Tackle_ReturnMove
dw .three
.three
call BattleAnim_ResetLCDStatCustom
ret
BGEffect2d_2f_zero:
VitalThrow_MoveBackwards:
; Prepares mon to move back back (player moves left, enemy moves right)
; BG_EFFECT_STRUCT_03: keeps track of distance moved, so it's reset to 0 here
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, LOW(rSCX)
@ -1594,13 +1611,13 @@ BGEffect2d_2f_zero:
ld [hl], a
ret
BattleBGEffect_2f:
BattleBGEffect_VitalThrow:
call BattleBGEffects_AnonJumptable
.anon_dw
dw BGEffect2d_2f_zero
dw Tackle_BGEffect25_2d_one
dw VitalThrow_MoveBackwards
dw Tackle_MoveForward
dw .two
dw Tackle_BGEffect25_2d_two
dw Tackle_ReturnMove
dw .four
.four
@ -1608,7 +1625,8 @@ BattleBGEffect_2f:
.two
ret
BattleBGEffect_26:
BattleBGEffect_WobbleMon:
; Similar to BattleBGEffect_WobblePlayer, except it can affect either side and the sine movement has a radius of 8 instead of 6 and it moves at twice the rate
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -1646,7 +1664,7 @@ BattleBGEffect_26:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_2c:
BattleBGEffect_Flail:
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -1700,7 +1718,7 @@ BattleBGEffect_2c:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_28:
BattleBGEffect_WaveDeformMon:
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -1723,7 +1741,7 @@ BattleBGEffect_28:
inc [hl]
ld d, a
ld e, 4
call Functionc8f2e
call DeformScreen
ret
.two
@ -1735,7 +1753,7 @@ BattleBGEffect_28:
dec [hl]
ld d, a
ld e, 4
call Functionc8f2e
call DeformScreen
ret
.reset
@ -1792,7 +1810,7 @@ BattleBGEffect_BounceDown:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_2a:
BattleBGEffect_BetaSendOutMon1: ; unused
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -1900,7 +1918,7 @@ BattleBGEffect_2a:
db $00, $40, $90, $e4
db -1
BattleBGEffect_2b:
BattleBGEffect_BetaSendOutMon2: ; unused
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -1929,14 +1947,14 @@ BattleBGEffect_2b:
and $f
ld d, a
ld e, a
call Functionc8f2e
call DeformScreen
ret
.done
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_1c:
BattleBGEffect_FadeMonsToBlackRepeating:
ldh a, [hCGB]
and a
jr nz, .cgb
@ -2094,7 +2112,7 @@ BattleBGEffect_1c:
db $40, $fc
db $90, $f8
BattleBGEffect_RapidFlash:
BattleBGEffect_RapidFlash: ; unused
ld de, .FlashPals
call BGEffect_RapidCyclePals
ret
@ -2102,7 +2120,8 @@ BattleBGEffect_RapidFlash:
.FlashPals:
db $e4, $6c, $fe
BattleBGEffect_16:
BattleBGEffect_FadeMonToLight:
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2110,7 +2129,8 @@ BattleBGEffect_16:
.Pals:
db $e4, $90, $40, $ff
BattleBGEffect_17:
BattleBGEffect_FadeMonToBlack:
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2118,7 +2138,8 @@ BattleBGEffect_17:
.Pals:
db $e4, $f8, $fc, $ff
BattleBGEffect_18:
BattleBGEffect_FadeMonToLightRepeating:
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2126,7 +2147,8 @@ BattleBGEffect_18:
.Pals:
db $e4, $90, $40, $90, $fe
BattleBGEffect_19:
BattleBGEffect_FadeMonToBlackRepeating:
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2134,7 +2156,8 @@ BattleBGEffect_19:
.Pals:
db $e4, $f8, $fc, $f8, $fe
BattleBGEffect_1a:
BattleBGEffect_CycleMonLightDarkRepeating:
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2142,7 +2165,8 @@ BattleBGEffect_1a:
.Pals:
db $e4, $f8, $fc, $f8, $e4, $90, $40, $90, $fe
BattleBGEffect_1b:
BattleBGEffect_FlashMonRepeating: ; unused
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2150,7 +2174,8 @@ BattleBGEffect_1b:
.Pals:
db $e4, $fc, $e4, $00, $fe
BattleBGEffect_1d:
BattleBGEffect_FadeMonToWhiteWaitFadeBack:
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2158,7 +2183,8 @@ BattleBGEffect_1d:
.Pals:
db $e4, $90, $40, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $40, $90, $e4, $ff
BattleBGEffect_1e:
BattleBGEffect_FadeMonFromWhite: ; unused
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
ld de, .Pals
call BGEffect_RapidCyclePals
ret
@ -2167,6 +2193,8 @@ BattleBGEffect_1e:
db $00, $40, $90, $e4, $ff
BattleBGEffect_VibrateMon:
; Moves mon back and forth sideways for $20 frames
; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -2210,7 +2238,8 @@ BattleBGEffect_VibrateMon:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_WobbleMon:
BattleBGEffect_WobblePlayer:
; Always affects the player
call BattleBGEffects_AnonJumptable
.anon_dw
dw .zero
@ -2251,7 +2280,7 @@ BattleBGEffect_WobbleMon:
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_2e:
BattleBGEffect_Rollout:
call Functionc8d0b
jr c, .xor_a
bit 7, a
@ -2268,7 +2297,7 @@ BattleBGEffect_2e:
ld [wAnimObject01YOffset], a
ret
BattleBGEffect_1f:
BattleBGEffect_ShakeScreenX:
call Functionc8d0b
jr nc, .skip
xor a
@ -2276,7 +2305,7 @@ BattleBGEffect_1f:
ldh [hSCX], a
ret
BattleBGEffect_20:
BattleBGEffect_ShakeScreenY:
call Functionc8d0b
jr nc, .skip
xor a
@ -2322,7 +2351,7 @@ Functionc8d0b:
and a
ret
BattleBGEffect_35:
BattleBGEffect_WobbleScreen:
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@ -2367,6 +2396,7 @@ BattleBGEffect_GetNthDMGPal:
ret
BGEffect_RapidCyclePals:
; Last index in DE: $fe signals a loop, $ff signals end
ldh a, [hCGB]
and a
jr nz, .cgb
@ -2674,7 +2704,11 @@ BattleBGEffects_ResetVideoHRAM:
call BattleBGEffects_ClearLYOverrides
ret
Functionc8f2e:
DeformScreen:
; wBattleAnimTemp0: Progress of the sine wave
; wBattleAnimTemp1 (e): Distance to skip
; wBattleAnimTemp2 (d): Size of wave
; wBattleAnimTemp3: Timer
push bc
xor a
ld [wBattleAnimTemp0], a
@ -2737,7 +2771,7 @@ InitSurfWaves:
pop bc
ret
Functionc8f9a:
DeformWater:
push bc
ld [wBattleAnimTemp3], a
ld a, e