2016-06-12 00:24:04 +00:00
|
|
|
ReflectLightScreenEffect_:
|
2015-08-31 02:38:41 +00:00
|
|
|
ld hl, wPlayerBattleStatus3
|
|
|
|
ld de, wPlayerMoveEffect
|
2015-04-01 14:51:04 +00:00
|
|
|
ld a, [H_WHOSETURN]
|
|
|
|
and a
|
2015-04-08 10:15:08 +00:00
|
|
|
jr z, .reflectLightScreenEffect
|
2015-08-31 02:38:41 +00:00
|
|
|
ld hl, wEnemyBattleStatus3
|
|
|
|
ld de, wEnemyMoveEffect
|
2015-04-08 10:15:08 +00:00
|
|
|
.reflectLightScreenEffect
|
2015-04-01 14:51:04 +00:00
|
|
|
ld a, [de]
|
|
|
|
cp LIGHT_SCREEN_EFFECT
|
|
|
|
jr nz, .reflect
|
2017-12-29 23:59:48 +00:00
|
|
|
bit HAS_LIGHT_SCREEN_UP, [hl] ; is mon already protected by light screen?
|
2015-04-01 14:51:04 +00:00
|
|
|
jr nz, .moveFailed
|
2017-12-29 23:59:48 +00:00
|
|
|
set HAS_LIGHT_SCREEN_UP, [hl] ; mon is now protected by light screen
|
2015-04-01 14:51:04 +00:00
|
|
|
ld hl, LightScreenProtectedText
|
2015-04-08 10:15:08 +00:00
|
|
|
jr .playAnim
|
2015-04-01 14:51:04 +00:00
|
|
|
.reflect
|
2017-12-29 23:59:48 +00:00
|
|
|
bit HAS_REFLECT_UP, [hl] ; is mon already protected by reflect?
|
2015-04-01 14:51:04 +00:00
|
|
|
jr nz, .moveFailed
|
2017-12-29 23:59:48 +00:00
|
|
|
set HAS_REFLECT_UP, [hl] ; mon is now protected by reflect
|
2015-04-01 14:51:04 +00:00
|
|
|
ld hl, ReflectGainedArmorText
|
2015-04-08 10:15:08 +00:00
|
|
|
.playAnim
|
2015-04-01 14:51:04 +00:00
|
|
|
push hl
|
|
|
|
ld hl, PlayCurrentMoveAnimation
|
|
|
|
call BankswitchEtoF
|
|
|
|
pop hl
|
|
|
|
jp PrintText
|
|
|
|
.moveFailed
|
2015-07-03 19:37:53 +00:00
|
|
|
ld c, 50
|
2015-04-01 14:51:04 +00:00
|
|
|
call DelayFrames
|
|
|
|
ld hl, PrintButItFailedText_
|
|
|
|
jp BankswitchEtoF
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
LightScreenProtectedText:
|
2015-04-01 14:51:04 +00:00
|
|
|
TX_FAR _LightScreenProtectedText
|
|
|
|
db "@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
ReflectGainedArmorText:
|
2015-04-01 14:51:04 +00:00
|
|
|
TX_FAR _ReflectGainedArmorText
|
|
|
|
db "@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
BankswitchEtoF:
|
2015-04-01 14:51:04 +00:00
|
|
|
ld b, BANK(BattleCore)
|
|
|
|
jp Bankswitch
|