2015-12-24 10:33:54 -08:00
|
|
|
const_def
|
|
|
|
const BGSQUARE_SIX
|
|
|
|
const BGSQUARE_FOUR
|
|
|
|
const BGSQUARE_TWO
|
|
|
|
const BGSQUARE_SEVEN
|
|
|
|
const BGSQUARE_FIVE
|
|
|
|
const BGSQUARE_THREE
|
|
|
|
|
2013-12-17 20:54:25 -08:00
|
|
|
; BG effects for use in battle animations.
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
ExecuteBGEffects:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wActiveBGEffects
|
2019-02-15 16:33:40 -08:00
|
|
|
ld e, NUM_BG_EFFECTS
|
2015-12-04 11:33:29 -08:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-04 11:33:29 -08:00
|
|
|
jr z, .next
|
2013-12-17 20:54:25 -08:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
push hl
|
|
|
|
push de
|
2015-12-23 17:46:23 -08:00
|
|
|
call DoBattleBGEffectFunction
|
2013-12-17 20:54:25 -08:00
|
|
|
pop de
|
|
|
|
pop hl
|
2015-12-04 11:33:29 -08:00
|
|
|
.next
|
2019-02-15 16:33:40 -08:00
|
|
|
ld bc, BG_EFFECT_STRUCT_LENGTH
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
dec e
|
2015-12-04 11:33:29 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
QueueBGEffect:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wActiveBGEffects
|
2019-02-15 16:33:40 -08:00
|
|
|
ld e, NUM_BG_EFFECTS
|
2015-12-04 11:33:29 -08:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-04 11:33:29 -08:00
|
|
|
jr z, .load
|
2019-02-15 16:33:40 -08:00
|
|
|
ld bc, BG_EFFECT_STRUCT_LENGTH
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
dec e
|
2015-12-04 11:33:29 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
scf
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
|
|
|
.load
|
2013-12-17 20:54:25 -08:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_FUNCTION
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp0]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp3]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
EndBattleBGEffect:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_FUNCTION
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], 0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
DoBattleBGEffectFunction:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_FUNCTION
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
ld d, 0
|
|
|
|
ld hl, BattleBGEffects
|
|
|
|
add hl, de
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, de
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects:
|
2017-12-26 14:47:05 -08:00
|
|
|
; entries correspond to ANIM_BG_* constants
|
2015-12-04 11:33:29 -08:00
|
|
|
dw BattleBGEffect_End
|
|
|
|
dw BattleBGEffect_FlashInverted
|
|
|
|
dw BattleBGEffect_FlashWhite
|
|
|
|
dw BattleBGEffect_WhiteHues
|
|
|
|
dw BattleBGEffect_BlackHues
|
|
|
|
dw BattleBGEffect_AlternateHues
|
|
|
|
dw BattleBGEffect_06
|
|
|
|
dw BattleBGEffect_07
|
|
|
|
dw BattleBGEffect_08
|
|
|
|
dw BattleBGEffect_HideMon
|
|
|
|
dw BattleBGEffect_ShowMon
|
|
|
|
dw BattleBGEffect_EnterMon
|
|
|
|
dw BattleBGEffect_ReturnMon
|
|
|
|
dw BattleBGEffect_Surf
|
|
|
|
dw BattleBGEffect_Whirlpool
|
|
|
|
dw BattleBGEffect_Teleport
|
|
|
|
dw BattleBGEffect_NightShade
|
2018-11-25 14:57:38 -08:00
|
|
|
dw BattleBGEffect_BattlerObj_1Row
|
|
|
|
dw BattleBGEffect_BattlerObj_2Row
|
2015-12-04 11:33:29 -08:00
|
|
|
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
|
2016-05-05 12:07:37 -07:00
|
|
|
dw BattleBGEffect_Withdraw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw BattleBGEffect_BounceDown
|
|
|
|
dw BattleBGEffect_Dig
|
2015-12-04 11:33:29 -08:00
|
|
|
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_WobbleMon
|
|
|
|
dw BattleBGEffect_35
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_End:
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BatttleBGEffects_GetNamedJumptablePointer:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld l, [hl]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld h, 0
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, hl
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_AnonJumptable:
|
2013-12-17 20:54:25 -08:00
|
|
|
pop de
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld l, [hl]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld h, 0
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, hl
|
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_IncrementJumptable:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_FlashInverted:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld de, .inverted
|
2015-12-23 17:46:23 -08:00
|
|
|
jp BattleBGEffect_FlashContinue
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2013-12-17 20:54:25 -08:00
|
|
|
.inverted
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 0, 1, 2, 3
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_FlashWhite:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld de, .white
|
2015-12-23 17:46:23 -08:00
|
|
|
jp BattleBGEffect_FlashContinue
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2013-12-17 20:54:25 -08:00
|
|
|
.white
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 0, 0, 0, 0
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_FlashContinue:
|
2015-12-23 17:46:23 -08:00
|
|
|
; current timer, flash duration, number of flashes
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $1
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-23 17:46:23 -08:00
|
|
|
jr z, .init
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-23 17:46:23 -08:00
|
|
|
.init
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-23 17:46:23 -08:00
|
|
|
jr nz, .apply_pal
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2015-12-23 17:46:23 -08:00
|
|
|
.apply_pal
|
2013-12-17 20:54:25 -08:00
|
|
|
dec a
|
|
|
|
ld [hl], a
|
|
|
|
and 1
|
|
|
|
ld l, a
|
|
|
|
ld h, 0
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wBGP], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_WhiteHues:
|
2015-12-26 18:59:03 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BattleBGEffect_GetNthDMGPal
|
|
|
|
jr c, .quit
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wBGP], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
.quit
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 3, 2, 0, 0
|
|
|
|
dc 3, 1, 0, 0
|
2015-12-26 18:59:03 -08:00
|
|
|
db -1
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_BlackHues:
|
2015-12-26 18:59:03 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BattleBGEffect_GetNthDMGPal
|
|
|
|
jr c, .quit
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wBGP], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
.quit
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 3, 3, 1, 0
|
|
|
|
dc 3, 3, 2, 0
|
2015-12-26 18:59:03 -08:00
|
|
|
db -1
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_AlternateHues:
|
2015-12-26 18:59:03 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BattleBGEffect_GetNthDMGPal
|
|
|
|
jr c, .quit
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wBGP], a
|
|
|
|
ld [wOBP1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
.quit
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 3, 3, 2, 0
|
|
|
|
dc 3, 3, 3, 0
|
|
|
|
dc 3, 3, 2, 0
|
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 2, 1, 0, 0
|
|
|
|
dc 1, 0, 0, 0
|
|
|
|
dc 2, 1, 0, 0
|
2015-12-26 18:59:03 -08:00
|
|
|
db -2
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_06:
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_CheckSGB
|
|
|
|
jr nz, .sgb
|
|
|
|
ld de, .PalsCGB
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.sgb
|
|
|
|
ld de, .PalsSGB
|
|
|
|
.okay
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetNthDMGPal
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wOBP0], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PalsCGB:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 2, 1, 0, 0
|
2015-12-26 18:59:03 -08:00
|
|
|
db -2
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PalsSGB:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 3, 0, 0
|
|
|
|
dc 3, 0, 0, 0
|
2015-12-26 18:59:03 -08:00
|
|
|
db -2
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_07:
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_CheckSGB
|
|
|
|
jr nz, .sgb
|
|
|
|
ld de, .PalsCGB
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.sgb
|
|
|
|
ld de, .PalsSGB
|
|
|
|
.okay
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetNthDMGPal
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wOBP0], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PalsCGB:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 2, 1, 0
|
|
|
|
dc 3, 1, 2, 0
|
2015-12-26 18:59:03 -08:00
|
|
|
db -2
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PalsSGB:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 3, 3, 0, 0
|
|
|
|
dc 3, 0, 3, 0
|
2015-12-26 18:59:03 -08:00
|
|
|
db -2
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_08:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld de, .Pals
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetNthDMGPal
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wBGP], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2018-09-09 15:15:54 -07:00
|
|
|
dc 0, 1, 2, 3
|
|
|
|
dc 1, 2, 0, 3
|
|
|
|
dc 2, 0, 1, 3
|
2015-12-26 18:59:03 -08:00
|
|
|
db -2
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_HideMon:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
2015-12-23 17:46:23 -08:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .four
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 12, 0
|
2015-12-04 11:33:29 -08:00
|
|
|
lb bc, 7, 7
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .got_pointer
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.player_side
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 2, 6
|
2015-11-01 06:38:48 -08:00
|
|
|
lb bc, 6, 6
|
2015-12-24 10:33:54 -08:00
|
|
|
.got_pointer
|
2013-12-17 20:54:25 -08:00
|
|
|
call ClearBox
|
|
|
|
pop bc
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapThird], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.four
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_ShowMon:
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckFlyDigStatus
|
|
|
|
jr z, .not_flying
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.not_flying
|
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
|
|
|
ld de, .EnemyData
|
|
|
|
jr .got_pointer
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.player_side
|
|
|
|
ld de, .PlayerData
|
|
|
|
.got_pointer
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffect_RunPicResizeScript
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PlayerData:
|
2015-12-24 10:33:54 -08:00
|
|
|
db 0, $31, 0
|
|
|
|
db -1
|
2016-04-10 11:42:14 -07:00
|
|
|
.EnemyData:
|
2015-12-24 10:33:54 -08:00
|
|
|
db 3, $00, 3
|
|
|
|
db -1
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-11-25 14:57:38 -08:00
|
|
|
BattleBGEffect_BattlerObj_1Row:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2015-12-23 17:46:23 -08:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .five
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
|
|
|
call BGEffect_CheckFlyDigStatus
|
|
|
|
jr z, .not_flying_digging
|
2019-02-15 08:21:51 -08:00
|
|
|
ld hl, wLastAnimObjectIndex
|
2013-12-17 20:54:25 -08:00
|
|
|
inc [hl]
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.not_flying_digging
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2018-11-25 14:57:38 -08:00
|
|
|
jr nz, .player_side
|
|
|
|
ld a, ANIM_OBJ_ENEMYFEET_1ROW
|
2018-11-22 03:32:24 -08:00
|
|
|
ld [wBattleObjectTempID], a
|
|
|
|
ld a, 16 * TILE_WIDTH + 4
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .okay
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2018-11-25 14:57:38 -08:00
|
|
|
.player_side
|
|
|
|
ld a, ANIM_OBJ_PLAYERHEAD_1ROW
|
2018-11-22 03:32:24 -08:00
|
|
|
ld [wBattleObjectTempID], a
|
|
|
|
ld a, 6 * TILE_WIDTH
|
2015-12-24 10:33:54 -08:00
|
|
|
.okay
|
2018-11-22 03:32:24 -08:00
|
|
|
ld [wBattleObjectTempXCoord], a
|
|
|
|
ld a, 8 * TILE_WIDTH
|
|
|
|
ld [wBattleObjectTempYCoord], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2019-02-05 23:07:11 -08:00
|
|
|
ld [wBattleObjectTempParam], a
|
2015-12-04 11:33:29 -08:00
|
|
|
call _QueueBattleAnimation
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2018-11-25 14:57:38 -08:00
|
|
|
jr nz, .player_side_2
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 12, 6
|
2015-12-24 10:33:54 -08:00
|
|
|
lb bc, 1, 7
|
|
|
|
jr .okay2
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2018-11-25 14:57:38 -08:00
|
|
|
.player_side_2
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 2, 6
|
2015-11-01 06:38:48 -08:00
|
|
|
lb bc, 1, 6
|
2015-12-24 10:33:54 -08:00
|
|
|
.okay2
|
2013-12-17 20:54:25 -08:00
|
|
|
call ClearBox
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.five
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-11-25 14:57:38 -08:00
|
|
|
BattleBGEffect_BattlerObj_2Row:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2015-12-23 17:46:23 -08:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .five
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
|
|
|
call BGEffect_CheckFlyDigStatus
|
|
|
|
jr z, .not_flying_digging
|
2019-02-15 08:21:51 -08:00
|
|
|
ld hl, wLastAnimObjectIndex
|
2013-12-17 20:54:25 -08:00
|
|
|
inc [hl]
|
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.not_flying_digging
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2018-11-25 14:57:38 -08:00
|
|
|
jr nz, .player_side
|
|
|
|
ld a, ANIM_OBJ_ENEMYFEET_2ROW
|
2018-11-22 03:32:24 -08:00
|
|
|
ld [wBattleObjectTempID], a
|
|
|
|
ld a, 16 * TILE_WIDTH + 4
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .okay
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2018-11-25 14:57:38 -08:00
|
|
|
.player_side
|
|
|
|
ld a, ANIM_OBJ_PLAYERHEAD_2ROW
|
2018-11-22 03:32:24 -08:00
|
|
|
ld [wBattleObjectTempID], a
|
|
|
|
ld a, 6 * TILE_WIDTH
|
2015-12-24 10:33:54 -08:00
|
|
|
.okay
|
2018-11-22 03:32:24 -08:00
|
|
|
ld [wBattleObjectTempXCoord], a
|
|
|
|
ld a, 8 * TILE_WIDTH
|
|
|
|
ld [wBattleObjectTempYCoord], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2019-02-05 23:07:11 -08:00
|
|
|
ld [wBattleObjectTempParam], a
|
2015-12-04 11:33:29 -08:00
|
|
|
call _QueueBattleAnimation
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2018-11-25 14:57:38 -08:00
|
|
|
jr nz, .player_side_2
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 12, 5
|
2015-12-24 10:33:54 -08:00
|
|
|
lb bc, 2, 7
|
|
|
|
jr .okay2
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2018-11-25 14:57:38 -08:00
|
|
|
.player_side_2
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 2, 6
|
2015-11-01 06:38:48 -08:00
|
|
|
lb bc, 2, 6
|
2015-12-24 10:33:54 -08:00
|
|
|
.okay2
|
2013-12-17 20:54:25 -08:00
|
|
|
call ClearBox
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.five
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
_QueueBattleAnimation:
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar QueueBattleAnimation
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_27:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2015-12-23 17:46:23 -08:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .four
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .user
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $9
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .okay
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.user
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $8
|
2015-12-24 10:33:54 -08:00
|
|
|
.okay
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .user_2
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 0, 6
|
2015-12-24 10:33:54 -08:00
|
|
|
lb de, 8, 6
|
|
|
|
.row1
|
2013-12-17 20:54:25 -08:00
|
|
|
push de
|
|
|
|
push hl
|
2015-12-24 10:33:54 -08:00
|
|
|
.col1
|
2013-12-17 20:54:25 -08:00
|
|
|
inc hl
|
|
|
|
ld a, [hld]
|
|
|
|
ld [hli], a
|
|
|
|
dec d
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .col1
|
2013-12-17 20:54:25 -08:00
|
|
|
pop hl
|
2015-12-24 10:33:54 -08:00
|
|
|
ld de, SCREEN_WIDTH
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
|
|
|
pop de
|
|
|
|
dec e
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .row1
|
|
|
|
jr .okay2
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.user_2
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 19, 0
|
2015-12-24 10:33:54 -08:00
|
|
|
lb de, 8, 7
|
|
|
|
.row2
|
2013-12-17 20:54:25 -08:00
|
|
|
push de
|
|
|
|
push hl
|
2015-12-24 10:33:54 -08:00
|
|
|
.col2
|
2013-12-17 20:54:25 -08:00
|
|
|
dec hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld [hld], a
|
|
|
|
dec d
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .col2
|
2013-12-17 20:54:25 -08:00
|
|
|
pop hl
|
2015-12-24 10:33:54 -08:00
|
|
|
ld de, SCREEN_WIDTH
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
|
|
|
pop de
|
|
|
|
dec e
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .row2
|
|
|
|
.okay2
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapThird], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.four
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .done
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.done
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_EnterMon:
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld de, .EnemyData
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_turn
|
|
|
|
ld de, .PlayerData
|
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffect_RunPicResizeScript
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PlayerData:
|
2015-12-24 10:33:54 -08:00
|
|
|
db 2, $31, 2
|
|
|
|
db 1, $31, 1
|
|
|
|
db 0, $31, 0
|
|
|
|
db -1
|
2016-04-10 11:42:14 -07:00
|
|
|
.EnemyData:
|
2015-12-24 10:33:54 -08:00
|
|
|
db 5, $00, 5
|
|
|
|
db 4, $00, 4
|
|
|
|
db 3, $00, 3
|
|
|
|
db -1
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_ReturnMon:
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld de, .EnemyData
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_turn
|
|
|
|
ld de, .PlayerData
|
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffect_RunPicResizeScript
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PlayerData:
|
2015-12-24 10:33:54 -08:00
|
|
|
db 0, $31, 0
|
|
|
|
db -2, $66, 0
|
|
|
|
db 1, $31, 1
|
|
|
|
db -2, $44, 1
|
|
|
|
db 2, $31, 2
|
|
|
|
db -2, $22, 2
|
|
|
|
db -3, $00, 0
|
|
|
|
db -1
|
2016-04-10 11:42:14 -07:00
|
|
|
.EnemyData:
|
2015-12-24 10:33:54 -08:00
|
|
|
db 3, $00, 3
|
|
|
|
db -2, $77, 3
|
|
|
|
db 4, $00, 4
|
|
|
|
db -2, $55, 4
|
|
|
|
db 5, $00, 5
|
|
|
|
db -2, $33, 5
|
|
|
|
db -3, $00, 0
|
|
|
|
db -1
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_RunPicResizeScript:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
2015-12-23 17:46:23 -08:00
|
|
|
dw BattleBGEffects_IncrementJumptable
|
|
|
|
dw BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .restart
|
|
|
|
dw .end
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
ld d, $0
|
|
|
|
inc [hl]
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld h, a
|
|
|
|
add hl, de
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
cp -1
|
|
|
|
jr z, .end
|
|
|
|
cp -2
|
|
|
|
jr z, .clear
|
|
|
|
cp -3
|
|
|
|
jr z, .skip
|
2016-01-12 09:46:18 -08:00
|
|
|
call .PlaceGraphic
|
2015-12-24 10:33:54 -08:00
|
|
|
.skip
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.clear
|
|
|
|
call .ClearBox
|
|
|
|
jr .zero
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.restart
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.end
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.ClearBox:
|
2015-12-24 10:33:54 -08:00
|
|
|
; get dims
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
ld a, b
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
ld b, a
|
2015-12-24 10:33:54 -08:00
|
|
|
; get coords
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, [hl]
|
2014-05-05 12:15:56 -07:00
|
|
|
ld d, 0
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, .Coords
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, de
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
call ClearBox
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PlaceGraphic:
|
2015-12-24 10:33:54 -08:00
|
|
|
; get dims
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld e, [hl]
|
2014-05-05 12:15:56 -07:00
|
|
|
ld d, 0
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, .BGSquares
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
ld a, b
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
ld b, a
|
2015-12-24 10:33:54 -08:00
|
|
|
; store pointer
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
; get byte
|
2013-12-17 20:54:25 -08:00
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 10:33:54 -08:00
|
|
|
; get coord
|
2013-12-17 20:54:25 -08:00
|
|
|
push de
|
|
|
|
ld e, [hl]
|
2014-05-05 12:15:56 -07:00
|
|
|
ld d, 0
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, .Coords
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, de
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
pop de
|
2015-12-24 10:33:54 -08:00
|
|
|
; fill box
|
|
|
|
.row
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp0]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld b, a
|
2015-12-24 10:33:54 -08:00
|
|
|
.col
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [de]
|
|
|
|
add b
|
|
|
|
ld [hli], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .col
|
2013-12-17 20:54:25 -08:00
|
|
|
pop hl
|
2015-12-24 10:33:54 -08:00
|
|
|
ld bc, SCREEN_WIDTH
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .row
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Coords:
|
2015-02-07 23:06:52 -08:00
|
|
|
dwcoord 2, 6
|
|
|
|
dwcoord 3, 8
|
|
|
|
dwcoord 4, 10
|
|
|
|
dwcoord 12, 0
|
|
|
|
dwcoord 13, 2
|
|
|
|
dwcoord 14, 4
|
2015-12-24 10:33:54 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.BGSquares:
|
2015-12-24 10:33:54 -08:00
|
|
|
bgsquare: MACRO
|
2017-12-09 21:06:20 -08:00
|
|
|
dn \1, \2
|
2015-12-24 10:33:54 -08:00
|
|
|
dw \3
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-12-24 10:33:54 -08:00
|
|
|
|
|
|
|
bgsquare 6, 6, .SixBySix
|
|
|
|
bgsquare 4, 4, .FourByFour
|
|
|
|
bgsquare 2, 2, .TwoByTwo
|
|
|
|
bgsquare 7, 7, .SevenBySeven
|
|
|
|
bgsquare 5, 5, .FiveByFive
|
|
|
|
bgsquare 3, 3, .ThreeByThree
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.SixBySix:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $00, $06, $0c, $12, $18, $1e
|
|
|
|
db $01, $07, $0d, $13, $19, $1f
|
|
|
|
db $02, $08, $0e, $14, $1a, $20
|
|
|
|
db $03, $09, $0f, $15, $1b, $21
|
|
|
|
db $04, $0a, $10, $16, $1c, $22
|
|
|
|
db $05, $0b, $11, $17, $1d, $23
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.FourByFour:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $00, $0c, $12, $1e
|
|
|
|
db $02, $0e, $14, $20
|
|
|
|
db $03, $0f, $15, $21
|
|
|
|
db $05, $11, $17, $23
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.TwoByTwo:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $00, $1e
|
|
|
|
db $05, $23
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.SevenBySeven:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $00, $07, $0e, $15, $1c, $23, $2a
|
|
|
|
db $01, $08, $0f, $16, $1d, $24, $2b
|
|
|
|
db $02, $09, $10, $17, $1e, $25, $2c
|
|
|
|
db $03, $0a, $11, $18, $1f, $26, $2d
|
|
|
|
db $04, $0b, $12, $19, $20, $27, $2e
|
|
|
|
db $05, $0c, $13, $1a, $21, $28, $2f
|
|
|
|
db $06, $0d, $14, $1b, $22, $29, $30
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.FiveByFive:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $00, $07, $15, $23, $2a
|
|
|
|
db $01, $08, $16, $24, $2b
|
|
|
|
db $03, $0a, $18, $26, $2d
|
|
|
|
db $05, $0c, $1a, $28, $2f
|
|
|
|
db $06, $0d, $1b, $29, $30
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.ThreeByThree:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $00, $15, $2a
|
|
|
|
db $03, $18, $2d
|
|
|
|
db $06, $1b, $30
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_Surf:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-23 19:51:50 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-23 19:51:50 -08:00
|
|
|
lb de, 2, 2
|
|
|
|
call InitSurfWaves
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLCDCPointer]
|
2013-12-17 20:54:25 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
push bc
|
2015-12-23 19:51:50 -08:00
|
|
|
call .RotatewSurfWaveBGEffect
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.RotatewSurfWaveBGEffect:
|
2015-12-23 19:51:50 -08:00
|
|
|
ld hl, wSurfWaveBGEffect
|
|
|
|
ld de, wSurfWaveBGEffect + 1
|
|
|
|
ld c, wSurfWaveBGEffectEnd - wSurfWaveBGEffect - 1
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
2015-12-23 19:51:50 -08:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-23 19:51:50 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
|
|
|
ld [hl], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wLYOverridesBackup
|
2015-12-23 19:51:50 -08:00
|
|
|
ld hl, wSurfWaveBGEffect
|
2013-12-17 20:54:25 -08:00
|
|
|
ld bc, $0
|
2015-12-23 19:51:50 -08:00
|
|
|
.loop2
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
cp e
|
2015-12-23 19:51:50 -08:00
|
|
|
jr nc, .load_zero
|
2013-12-17 20:54:25 -08:00
|
|
|
push hl
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
pop hl
|
2015-12-23 19:51:50 -08:00
|
|
|
jr .okay
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-23 19:51:50 -08:00
|
|
|
.load_zero
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2015-12-23 19:51:50 -08:00
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [de], a
|
|
|
|
ld a, c
|
|
|
|
inc a
|
|
|
|
and $3f
|
|
|
|
ld c, a
|
|
|
|
inc de
|
|
|
|
ld a, e
|
|
|
|
cp $5f
|
2015-12-23 19:51:50 -08:00
|
|
|
jr c, .loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_Whirlpool:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCY)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $5e
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
lb de, 2, 2
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_30:
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCY)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_31:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld e, a
|
|
|
|
add $4
|
|
|
|
ld [hl], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f0
|
|
|
|
swap a
|
|
|
|
xor $ff
|
|
|
|
add $4
|
|
|
|
ld d, a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp0], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $20
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nc, .done
|
2013-12-17 20:54:25 -08:00
|
|
|
inc [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
inc [hl]
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f9a
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.done
|
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_32:
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_Psychic:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $5f
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
lb de, 6, 5
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f2e
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
and $3
|
|
|
|
ret nz
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_Teleport:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2015-12-24 10:33:54 -08:00
|
|
|
lb de, 6, 5
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_NightShade:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCY)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
ld d, 2
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
|
|
|
call BattleBGEffect_WavyScreenFX
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_DoubleTeam:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
|
|
|
dw .four
|
|
|
|
dw .five
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $10
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nc, .next
|
2013-12-17 20:54:25 -08:00
|
|
|
inc [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
call .UpdateLYOverrides
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.three
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .next
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
call .UpdateLYOverrides
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.next
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $2
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Sine
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
call .UpdateLYOverrides
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $4
|
|
|
|
ld [hl], a
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.four
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.UpdateLYOverrides:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
|
|
|
xor $ff
|
|
|
|
inc a
|
|
|
|
ld d, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub l
|
|
|
|
srl a
|
|
|
|
push af
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
inc hl
|
|
|
|
dec a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
|
|
|
ret nc
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.five
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_AcidArmor:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCY)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
ld d, 2
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f2e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
|
|
|
ld [hl], $0
|
|
|
|
dec l
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
dec de
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [de]
|
|
|
|
dec de
|
|
|
|
ld [hld], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
cp l
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], $90
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
|
|
|
ld a, [hl]
|
|
|
|
cp $1
|
2015-12-24 10:33:54 -08:00
|
|
|
jr c, .okay
|
2013-12-17 20:54:25 -08:00
|
|
|
cp $90
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], $0
|
2015-12-24 10:33:54 -08:00
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
dec l
|
|
|
|
ld a, [hl]
|
|
|
|
cp $2
|
|
|
|
ret c
|
|
|
|
cp $90
|
|
|
|
ret z
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_Withdraw:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCY)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $3f
|
|
|
|
ld d, a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp d
|
|
|
|
ret nc
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_DisplaceLYOverridesBackup
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
rlca
|
|
|
|
rlca
|
|
|
|
and $3
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_Dig:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCY)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $2
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .next
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.next
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], $10
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub l
|
|
|
|
dec a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
cp [hl]
|
|
|
|
ret c
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
and $7
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .skip
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
.skip
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_DisplaceLYOverridesBackup
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
inc [hl]
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.three
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_Tackle:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .three
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
2019-04-08 05:15:10 -07:00
|
|
|
ld [hl], 0
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
|
|
|
ld a, 2
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_side
|
|
|
|
ld a, -2
|
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.three
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_25:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .three
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms2
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
2019-04-08 05:15:10 -07:00
|
|
|
ld [hl], 0
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_side
|
2019-04-08 05:15:10 -07:00
|
|
|
ld a, 2
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_side
|
|
|
|
ld a, -2
|
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.three
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
Tackle_BGEffect25_2d_one:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
cp -8
|
|
|
|
jr z, .reached_limit
|
2019-04-08 05:15:10 -07:00
|
|
|
cp 8
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .finish
|
|
|
|
.reached_limit
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
.finish
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc88a5
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
Tackle_BGEffect25_2d_two:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_c8893
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
.asm_c8893
|
|
|
|
call Functionc88a5
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $ff
|
|
|
|
inc a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Functionc88a5:
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wFXAnimID + 1] ; FXAnimID + 1
|
2013-12-17 20:54:25 -08:00
|
|
|
or a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .not_rollout
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wFXAnimID] ; FXAnimID
|
2014-05-05 12:15:56 -07:00
|
|
|
cp ROLLOUT
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .rollout
|
|
|
|
.not_rollout
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
2016-05-05 12:07:37 -07:00
|
|
|
jp BGEffect_FillLYOverridesBackup
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.rollout
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub d
|
|
|
|
ld d, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSCY]
|
2013-12-17 20:54:25 -08:00
|
|
|
or a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .skip1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
or a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .skip2
|
2013-12-17 20:54:25 -08:00
|
|
|
dec a
|
|
|
|
ld l, a
|
|
|
|
ld [hl], $0
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .skip2
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.skip1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
dec a
|
|
|
|
ld l, a
|
|
|
|
ld [hl], $0
|
2015-12-24 10:33:54 -08:00
|
|
|
.skip2
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSCY]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub l
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nc, .skip3
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
|
|
|
dec d
|
2015-12-24 10:33:54 -08:00
|
|
|
.skip3
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
|
|
|
pop af
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec d
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_2d:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw BGEffect2d_2f_zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .three
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.three
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
BGEffect2d_2f_zero:
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
|
|
|
jr nz, .player_turn
|
|
|
|
ld a, -2
|
|
|
|
jr .okay
|
|
|
|
|
|
|
|
.player_turn
|
|
|
|
ld a, 2
|
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_2f:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw BGEffect2d_2f_zero
|
|
|
|
dw Tackle_BGEffect25_2d_one
|
|
|
|
dw .two
|
|
|
|
dw Tackle_BGEffect25_2d_two
|
|
|
|
dw .four
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.four
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_26:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $8
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Sine
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_FillLYOverridesBackup
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $4
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_2c:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $6
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $2
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
|
|
|
pop af
|
|
|
|
add e
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_FillLYOverridesBackup
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $8
|
|
|
|
ld [hl], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $2
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_28:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $20
|
|
|
|
ret nc
|
|
|
|
inc [hl]
|
|
|
|
ld d, a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld e, 4
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.two
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .reset
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
ld d, a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld e, 4
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.reset
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_BounceDown:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCY)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms2
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $20
|
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $38
|
|
|
|
ret nc
|
|
|
|
push af
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld d, $10
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Cosine
|
2013-12-17 20:54:25 -08:00
|
|
|
add $10
|
|
|
|
ld d, a
|
|
|
|
pop af
|
|
|
|
add d
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_DisplaceLYOverridesBackup
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
inc [hl]
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_2a:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 10:33:54 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
|
|
|
dw .four
|
|
|
|
dw .five
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $e4
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_SetLYOverrides
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $47
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
cp l
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .done
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .loop
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.done
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-24 10:33:54 -08:00
|
|
|
.one
|
|
|
|
.four
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.two
|
|
|
|
call .GetLYOverride
|
|
|
|
jr nc, .next
|
|
|
|
call .SetLYOverridesBackup
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.next
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.three
|
|
|
|
call .GetLYOverride
|
|
|
|
jr nc, .finish
|
|
|
|
call .SetLYOverridesBackup
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
dec a
|
|
|
|
ld l, a
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.finish
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.SetLYOverridesBackup:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub l
|
|
|
|
srl a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
2015-12-26 18:59:03 -08:00
|
|
|
inc hl
|
2013-12-17 20:54:25 -08:00
|
|
|
dec a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.five
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffects_ResetVideoHRAM
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.GetLYOverride:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
ld e, a
|
2014-05-05 12:15:56 -07:00
|
|
|
ld d, 0
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, .data
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.data
|
|
|
|
db $00, $40, $90, $e4
|
|
|
|
db -1
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_2b:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $40
|
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.one
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-26 18:59:03 -08:00
|
|
|
jr z, .done
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
and $f
|
|
|
|
ld d, a
|
|
|
|
ld e, a
|
|
|
|
call Functionc8f2e
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
.done
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_1c:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hCGB]
|
2013-12-17 20:54:25 -08:00
|
|
|
and a
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .cgb
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $e4
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_SetLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rBGP)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $60
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
ld e, a
|
|
|
|
and $7
|
|
|
|
ret nz
|
|
|
|
ld a, e
|
|
|
|
and $18
|
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
sla a
|
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
|
|
|
push bc
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .player
|
|
|
|
ld hl, .CGB_DMGEnemyData
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wOBP1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, a
|
|
|
|
ld e, [hl]
|
2015-12-24 11:07:33 -08:00
|
|
|
lb bc, $2f, $30
|
|
|
|
jr .okay
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.player
|
|
|
|
ld hl, .DMG_PlayerData
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
|
|
|
ld d, [hl]
|
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wOBP1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
2015-12-24 11:07:33 -08:00
|
|
|
lb bc, $37, $28
|
|
|
|
.okay
|
|
|
|
call .DMG_LYOverrideLoads
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.two
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffects_ResetVideoHRAM
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $e4
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wBGP], a
|
|
|
|
ld [wOBP1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.DMG_LYOverrideLoads:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wLYOverridesBackup
|
2015-12-24 11:07:33 -08:00
|
|
|
.loop1
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], d
|
|
|
|
inc hl
|
|
|
|
dec b
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .loop1
|
|
|
|
.loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
dec c
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.cgb
|
|
|
|
ld de, .Jumptable
|
2015-12-23 17:46:23 -08:00
|
|
|
call BatttleBGEffects_GetNamedJumptablePointer
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Jumptable:
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .cgb_zero
|
|
|
|
dw .cgb_one
|
|
|
|
dw .cgb_two
|
2017-12-29 04:52:42 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.cgb_zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2014-05-05 12:15:56 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.cgb_one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2014-05-05 12:15:56 -07:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
|
|
|
ld e, a
|
|
|
|
and $7
|
|
|
|
ret nz
|
|
|
|
ld a, e
|
|
|
|
and $18
|
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
sla a
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .player_2
|
|
|
|
ld hl, .CGB_DMGEnemyData
|
2014-05-05 12:15:56 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal1_OBPal0
|
2014-05-05 12:15:56 -07:00
|
|
|
pop hl
|
|
|
|
ld a, [hl]
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal0_OBPal1
|
2014-05-05 12:15:56 -07:00
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.player_2
|
|
|
|
ld hl, .CGB_DMGEnemyData
|
2014-05-05 12:15:56 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal0_OBPal1
|
2014-05-05 12:15:56 -07:00
|
|
|
pop hl
|
|
|
|
ld a, [hl]
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal1_OBPal0
|
2014-05-05 12:15:56 -07:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.cgb_two
|
2014-05-05 12:15:56 -07:00
|
|
|
ld a, $e4
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal0_OBPal1
|
2014-05-05 12:15:56 -07:00
|
|
|
ld a, $e4
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal1_OBPal0
|
2014-05-05 12:15:56 -07:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.CGB_DMGEnemyData:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $e4
|
|
|
|
db $f8, $90
|
|
|
|
db $fc, $40
|
|
|
|
db $f8, $90
|
2016-04-10 11:42:14 -07:00
|
|
|
.DMG_PlayerData:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $e4
|
|
|
|
db $90, $f8
|
|
|
|
db $40, $fc
|
|
|
|
db $90, $f8
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_RapidFlash:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .FlashPals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.FlashPals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $6c, $fe
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_16:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $90, $40, $ff
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_17:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $f8, $fc, $ff
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_18:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $90, $40, $90, $fe
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_19:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $f8, $fc, $f8, $fe
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_1a:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $f8, $fc, $f8, $e4, $90, $40, $90, $fe
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_1b:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $fc, $e4, $00, $fe
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_1d:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $e4, $90, $40, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $40, $90, $e4, $ff
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_1e:
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Pals
|
|
|
|
call BGEffect_RapidCyclePals
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Pals:
|
2014-05-05 12:15:56 -07:00
|
|
|
db $00, $40, $90, $e4, $ff
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_VibrateMon:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $20
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .finish
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
and $1
|
|
|
|
ret nz
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $ff
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_FillLYOverridesBackup
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.finish
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_WobbleMon:
|
2015-12-04 11:33:29 -08:00
|
|
|
call BattleBGEffects_AnonJumptable
|
2015-12-26 18:59:03 -08:00
|
|
|
.anon_dw
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.zero
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2018-08-25 11:34:25 -07:00
|
|
|
ld a, LOW(rSCX)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $37
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.one
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $40
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nc, .two
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, $6
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Sine
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_FillLYOverridesBackup
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $2
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.two
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleAnim_ResetLCDStatCustom
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_2e:
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8d0b
|
2015-12-24 11:07:33 -08:00
|
|
|
jr c, .xor_a
|
2013-12-17 20:54:25 -08:00
|
|
|
bit 7, a
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .okay
|
|
|
|
.xor_a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
|
|
|
call DelayFrame
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hSCY], a
|
2013-12-17 20:54:25 -08:00
|
|
|
xor $ff
|
|
|
|
inc a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wAnimObject01YOffset], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_1f:
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8d0b
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nc, .skip
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2015-12-24 11:07:33 -08:00
|
|
|
.skip
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hSCX], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_20:
|
2013-12-17 20:54:25 -08:00
|
|
|
call Functionc8d0b
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nc, .skip
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2015-12-24 11:07:33 -08:00
|
|
|
.skip
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hSCY], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Functionc8d0b:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .okay
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
scf
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .every_16_frames
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.every_16_frames
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
xor $ff
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_35:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $40
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nc, .finish
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, $6
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Sine
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hSCX], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
add $2
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.finish
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hSCX], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_GetNthDMGPal:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .zero
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetNextDMGPal
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.zero
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_JT_INDEX
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetFirstDMGPal
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BGEffect_RapidCyclePals:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hCGB]
|
2013-12-17 20:54:25 -08:00
|
|
|
and a
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
push de
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Jumptable_DMG
|
2015-12-23 17:46:23 -08:00
|
|
|
call BatttleBGEffects_GetNamedJumptablePointer
|
2013-12-17 20:54:25 -08:00
|
|
|
pop de
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Jumptable_DMG:
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero_dmg
|
|
|
|
dw .one_dmg
|
|
|
|
dw .two_dmg
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.zero_dmg
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $e4
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_SetLYOverrides
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $47
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_SetLCDStatCustoms1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
inc a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld [hl], $0
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.one_dmg
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .okay_1_dmg
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay_1_dmg
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetFirstDMGPal
|
2015-12-24 11:07:33 -08:00
|
|
|
jr c, .okay_2_dmg
|
2016-05-05 12:07:37 -07:00
|
|
|
call BGEffect_FillLYOverridesBackup
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay_2_dmg
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.two_dmg
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffects_ResetVideoHRAM
|
|
|
|
ld a, %11100100
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rBGP], a
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
push de
|
2015-12-24 11:07:33 -08:00
|
|
|
ld de, .Jumptable_CGB
|
2015-12-23 17:46:23 -08:00
|
|
|
call BatttleBGEffects_GetNamedJumptablePointer
|
2013-12-17 20:54:25 -08:00
|
|
|
pop de
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.Jumptable_CGB:
|
2015-12-24 11:07:33 -08:00
|
|
|
dw .zero_cgb
|
|
|
|
dw .one_cgb
|
|
|
|
dw .two_cgb
|
|
|
|
dw .three_cgb
|
|
|
|
dw .four_cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.zero_cgb
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2015-12-24 11:07:33 -08:00
|
|
|
jr nz, .player_turn_cgb
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
call BattleBGEffects_IncrementJumptable
|
2015-12-24 11:07:33 -08:00
|
|
|
.player_turn_cgb
|
2015-12-23 17:46:23 -08:00
|
|
|
call BattleBGEffects_IncrementJumptable
|
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld [hl], $0
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.one_cgb
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .okay_1_cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay_1_cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetFirstDMGPal
|
2015-12-24 11:07:33 -08:00
|
|
|
jr c, .okay_2_cgb
|
|
|
|
call BGEffects_LoadBGPal0_OBPal1
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay_2_cgb
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.two_cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $e4
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal0_OBPal1
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.three_cgb
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
2015-12-24 11:07:33 -08:00
|
|
|
jr z, .okay_3_cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay_3_cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
2015-12-26 18:59:03 -08:00
|
|
|
call BattleBGEffect_GetFirstDMGPal
|
2015-12-24 11:07:33 -08:00
|
|
|
jr c, .okay_4_cgb
|
|
|
|
call BGEffects_LoadBGPal1_OBPal0
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 11:07:33 -08:00
|
|
|
.okay_4_cgb
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.four_cgb
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $e4
|
2015-12-24 11:07:33 -08:00
|
|
|
call BGEffects_LoadBGPal1_OBPal0
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BGEffects_LoadBGPal0_OBPal1:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld h, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, h
|
|
|
|
push bc
|
|
|
|
push af
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wBGPals2
|
|
|
|
ld de, wBGPals1
|
2013-12-17 20:54:25 -08:00
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wOBPals2 palette 1
|
|
|
|
ld de, wOBPals1 palette 1
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
|
|
|
pop bc
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hCGBPalUpdate], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BGEffects_LoadBGPal1_OBPal0:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld h, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, h
|
|
|
|
push bc
|
|
|
|
push af
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wBGPals2 palette 1
|
|
|
|
ld de, wBGPals1 palette 1
|
2013-12-17 20:54:25 -08:00
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wOBPals2
|
|
|
|
ld de, wOBPals1
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
|
|
|
ld b, a
|
|
|
|
ld c, $1
|
|
|
|
call CopyPals
|
|
|
|
pop bc
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hCGBPalUpdate], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_GetFirstDMGPal:
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_GetNextDMGPal:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
cp -1
|
|
|
|
jr z, .quit
|
|
|
|
cp -2
|
|
|
|
jr nz, .repeat
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [de]
|
2015-12-23 17:46:23 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_03
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-26 18:59:03 -08:00
|
|
|
.repeat
|
2013-12-17 20:54:25 -08:00
|
|
|
and a
|
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
.quit
|
2013-12-17 20:54:25 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_ClearLYOverrides:
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_SetLYOverrides:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wLYOverrides ; wListPointer
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, $99
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop1
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec e
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop1
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wLYOverridesBackup
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, $91
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec e
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_SetLCDStatCustoms1:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2015-12-26 18:59:03 -08:00
|
|
|
jr nz, .player_turn
|
|
|
|
lb de, $00, $36
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .okay
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
.player_turn
|
|
|
|
lb de, $2f, $5e
|
2015-12-24 10:33:54 -08:00
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_SetLCDStatCustoms2:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call BGEffect_CheckBattleTurn
|
2015-12-26 18:59:03 -08:00
|
|
|
jr nz, .player_turn
|
|
|
|
lb de, $00, $36
|
|
|
|
jr .okay
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
.player_turn
|
|
|
|
lb de, $2d, $5e
|
|
|
|
.okay
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideEnd], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleAnim_ResetLCDStatCustom:
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2013-12-17 20:54:25 -08:00
|
|
|
call EndBattleBGEffect
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_ResetVideoHRAM:
|
2013-12-17 20:54:25 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLCDCPointer], a
|
2015-12-26 18:59:03 -08:00
|
|
|
ld a, %11100100
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rBGP], a
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wBGP], a
|
|
|
|
ld [wOBP1], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hLYOverrideStart], a
|
|
|
|
ldh [hLYOverrideEnd], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call BattleBGEffects_ClearLYOverrides
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Functionc8f2e:
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
|
|
|
xor a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp0], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp2], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $80
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp3], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wLYOverridesBackup
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
cp c
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nc, .next
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
cp c
|
2015-12-24 10:33:54 -08:00
|
|
|
jr c, .next
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp0]
|
|
|
|
call BattleBGEffects_Sine
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [bc], a
|
2015-12-24 10:33:54 -08:00
|
|
|
.next
|
2013-12-17 20:54:25 -08:00
|
|
|
inc bc
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp1]
|
|
|
|
ld hl, wBattleAnimTemp0
|
2013-12-17 20:54:25 -08:00
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld hl, wBattleAnimTemp3
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
InitSurfWaves:
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
|
|
|
xor a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp0], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp2], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, $40
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp3], a
|
|
|
|
ld bc, wSurfWaveBGEffect
|
|
|
|
.loop
|
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp0]
|
|
|
|
call BattleBGEffects_Sine
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [bc], a
|
|
|
|
inc bc
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp1]
|
|
|
|
ld hl, wBattleAnimTemp0
|
2013-12-17 20:54:25 -08:00
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld hl, wBattleAnimTemp3
|
2013-12-17 20:54:25 -08:00
|
|
|
dec [hl]
|
2015-12-23 19:51:50 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Functionc8f9a:
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp3], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, d
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp2], a
|
2015-12-24 10:33:54 -08:00
|
|
|
call .GetLYOverrideBackupAddrOffset
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wLYOverridesBackup
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, de
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp3]
|
2013-12-17 20:54:25 -08:00
|
|
|
and a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .done
|
2013-12-17 20:54:25 -08:00
|
|
|
dec a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp3], a
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp2]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-17 20:54:25 -08:00
|
|
|
push hl
|
2015-12-23 19:51:50 -08:00
|
|
|
call BattleBGEffects_Sine
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
|
|
|
pop hl
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
cp c
|
2015-12-24 10:33:54 -08:00
|
|
|
jr c, .skip1
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
|
|
|
ld [bc], a
|
|
|
|
inc bc
|
2015-12-24 10:33:54 -08:00
|
|
|
.skip1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
cp l
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nc, .skip2
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hl], e
|
|
|
|
dec hl
|
2015-12-24 10:33:54 -08:00
|
|
|
.skip2
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp1]
|
2013-12-17 20:54:25 -08:00
|
|
|
add $4
|
2015-12-23 19:51:50 -08:00
|
|
|
ld [wBattleAnimTemp1], a
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
2015-12-24 10:33:54 -08:00
|
|
|
jr .loop
|
2015-12-23 17:46:23 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.done
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.GetLYOverrideBackupAddrOffset:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
2015-12-23 19:51:50 -08:00
|
|
|
ld a, [wBattleAnimTemp0]
|
2013-12-17 20:54:25 -08:00
|
|
|
add e
|
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffect_WavyScreenFX:
|
2013-12-17 20:54:25 -08:00
|
|
|
push bc
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
|
|
|
inc a
|
|
|
|
ld e, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2013-12-17 20:54:25 -08:00
|
|
|
ld d, h
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub l
|
|
|
|
and a
|
2015-12-24 10:33:54 -08:00
|
|
|
jr z, .done
|
2013-12-17 20:54:25 -08:00
|
|
|
ld c, a
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
2015-12-24 10:33:54 -08:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
|
|
|
ld [hl], a
|
2015-12-24 10:33:54 -08:00
|
|
|
.done
|
2013-12-17 20:54:25 -08:00
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BGEffect_FillLYOverridesBackup:
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub l
|
|
|
|
ld d, a
|
|
|
|
pop af
|
2016-05-05 12:07:37 -07:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec d
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BGEffect_DisplaceLYOverridesBackup:
|
2016-05-05 12:07:37 -07:00
|
|
|
; e = a; d = [hLYOverrideEnd] - [hLYOverrideStart] - a
|
2013-12-17 20:54:25 -08:00
|
|
|
push af
|
|
|
|
ld e, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideEnd]
|
2013-12-17 20:54:25 -08:00
|
|
|
sub l
|
|
|
|
sub e
|
|
|
|
ld d, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld h, HIGH(wLYOverridesBackup)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hLYOverrideStart]
|
2013-12-17 20:54:25 -08:00
|
|
|
ld l, a
|
|
|
|
ld a, $90
|
2016-05-05 12:07:37 -07:00
|
|
|
.loop
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec e
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nz, .loop
|
2013-12-17 20:54:25 -08:00
|
|
|
pop af
|
|
|
|
xor $ff
|
2016-05-05 12:07:37 -07:00
|
|
|
.loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec d
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nz, .loop2
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BGEffect_CheckBattleTurn:
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBattleTurn]
|
2013-12-17 20:54:25 -08:00
|
|
|
and $1
|
|
|
|
xor [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BGEffect_CheckFlyDigStatus:
|
2015-12-24 10:33:54 -08:00
|
|
|
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
|
2013-12-17 20:54:25 -08:00
|
|
|
add hl, bc
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBattleTurn]
|
2013-12-17 20:54:25 -08:00
|
|
|
and $1
|
|
|
|
xor [hl]
|
2015-12-24 10:33:54 -08:00
|
|
|
jr nz, .player
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wEnemySubStatus3] ; EnemySubStatus3
|
2014-05-05 12:15:56 -07:00
|
|
|
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
2015-12-04 11:33:29 -08:00
|
|
|
|
2015-12-24 10:33:54 -08:00
|
|
|
.player
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPlayerSubStatus3] ; PlayerSubStatus3
|
2014-05-05 12:15:56 -07:00
|
|
|
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
|
2013-12-17 20:54:25 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_CheckSGB:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSGB]
|
2013-12-17 20:54:25 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_Sine:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar BattleAnim_Sine_e
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleBGEffects_Cosine:
|
2013-12-17 20:54:25 -08:00
|
|
|
ld e, a
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar BattleAnim_Cosine_e
|
2013-12-17 20:54:25 -08:00
|
|
|
ld a, e
|
|
|
|
ret
|