move effect cleanup

This commit is contained in:
yenatch 2013-05-03 01:29:57 -04:00
parent adeb0ac47c
commit 2b00d49065
3 changed files with 117 additions and 106 deletions

View File

@ -496,7 +496,7 @@ CheckEnemyTurn: ; 3421f
.CheckDisabled .CheckDisabled
ld hl, EnemyEncoreCount ld hl, EnemyDisableCount
ld a, [hl] ld a, [hl]
and a and a
jr z, .CheckConfused jr z, .CheckConfused
@ -2406,7 +2406,7 @@ BattleCommand09: ; 34d32
push bc push bc
call GetOpponentItem call GetOpponentItem
ld a, b ld a, b
cp $4d ; brightpowder cp HELD_BRIGHTPOWDER
ld a, c ; % miss ld a, c ; % miss
pop bc pop bc
jr nz, .asm_34d81 jr nz, .asm_34d81
@ -2983,7 +2983,7 @@ BattleCommand0e: ; 3505e
.asm_35072 .asm_35072
call GetOpponentItem call GetOpponentItem
ld a, b ld a, b
cp $4f cp HELD_FOCUS_BAND
ld b, $0 ld b, $0
jr nz, .asm_3508b ; 3507a $f jr nz, .asm_3508b ; 3507a $f
call FarBattleRNG call FarBattleRNG
@ -3020,21 +3020,22 @@ BattleCommand0e: ; 3505e
call GetOpponentItem call GetOpponentItem
ld a, [hl] ld a, [hl]
ld [$d265], a ld [$d265], a
call $3468 call GetItemName
ld hl, HungOnText ld hl, HungOnText
jp FarBattleTextBox jp FarBattleTextBox
.asm_50bb .asm_50bb
ld a, $8 ld a, BATTLE_VARS_SUBSTATUS4_OPP
call CleanGetBattleVarPair call CleanGetBattleVarPair
bit 4, a bit SUBSTATUS_SUBSTITUTE, a
ret nz ret nz
ld de, EnemyDamageTaken
ld de, PlayerDamageTaken + 1
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr nz, .asm_350ce ; 0x350c9 $3 jr nz, .asm_350ce
ld de, $c685 ld de, EnemyDamageTaken + 1
.asm_350ce .asm_350ce
ld a, [CurDamage + 1] ld a, [CurDamage + 1]
@ -3267,7 +3268,7 @@ BattleCommand11: ; 351c0
ld h, b ld h, b
ld l, c ld l, c
ld a, $b ld a, $b
call $2d83 call Predef
call RefreshBattleHuds call RefreshBattleHuds
call SwitchTurn call SwitchTurn
@ -4516,7 +4517,7 @@ BattleCommand41: ; 35864
; encore ; encore
ld hl, EnemyMonMoves ld hl, EnemyMonMoves
ld de, EnemyPerishCount ld de, EnemyEncoreCount
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_35875 ; 3586d $6 jr z, .asm_35875 ; 3586d $6
@ -4649,7 +4650,7 @@ BattleCommand42: ; 35926
ld [$d10a], a ld [$d10a], a
ld hl, $c55e ld hl, $c55e
ld a, $b ld a, $b
call $2d83 call Predef
ld hl, EnemyMonHPHi ld hl, EnemyMonHPHi
ld a, [hli] ld a, [hli]
ld [$d1ed], a ld [$d1ed], a
@ -4665,7 +4666,7 @@ BattleCommand42: ; 35926
call ResetDamage call ResetDamage
ld hl, $c4ca ld hl, $c4ca
ld a, $b ld a, $b
call $2d83 call Predef
ld a, $5e ld a, $5e
ld hl, $4000 ld hl, $4000
rst FarCall rst FarCall
@ -4811,7 +4812,7 @@ BattleCommand44: ; 359e6
ld a, [hl] ld a, [hl]
ld [$d265], a ld [$d265], a
ld a, $29 ld a, $29
call $2d83 call Predef
ld hl, $5452 ld hl, $5452
jp FarBattleTextBox jp FarBattleTextBox
.asm_35a50 .asm_35a50
@ -5472,7 +5473,7 @@ Function0x35de0: ; 35de0
jr nc, .asm_35e3d jr nc, .asm_35e3d
.asm_35dff .asm_35dff
ld a, $8 ld a, BATTLE_VARS_SUBSTATUS4_OPP
call GetBattleVarPair call GetBattleVarPair
res 4, [hl] res 4, [hl]
@ -5481,23 +5482,23 @@ Function0x35de0: ; 35de0
call SwitchTurn call SwitchTurn
call BattleCommanda7 call BattleCommanda7
ld a, $2 ld a, BATTLE_VARS_SUBSTATUS3
call CleanGetBattleVarPair call CleanGetBattleVarPair
and $60 and $60 ; fly | dig
call z, Function0x37ec7 call z, Function0x37ec7
call SwitchTurn call SwitchTurn
ld a, BATTLE_VARS_MOVE_EFFECT ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVarPair call GetBattleVarPair
cp $1d cp EFFECT_MULTI_HIT
jr z, .asm_35e3a jr z, .asm_35e3a
cp $2c cp EFFECT_DOUBLE_HIT
jr z, .asm_35e3a jr z, .asm_35e3a
cp $4d cp EFFECT_TWINEEDLE
jr z, .asm_35e3a jr z, .asm_35e3a
cp $68 cp EFFECT_TRIPLE_KICK
jr z, .asm_35e3a jr z, .asm_35e3a
cp $9a cp EFFECT_BEAT_UP
jr z, .asm_35e3a jr z, .asm_35e3a
xor a xor a
@ -5537,7 +5538,7 @@ BattleCommand14: ; 35e5c
jr nz, .asm_35e70 ; 35e62 $c jr nz, .asm_35e70 ; 35e62 $c
ld a, [hl] ld a, [hl]
ld [$d265], a ld [$d265], a
call $3468 call GetItemName
ld hl, ProtectedByText ld hl, ProtectedByText
jr .asm_35ec6 jr .asm_35ec6
@ -5692,7 +5693,7 @@ BattleCommand2f: ; 35f2c
jr nz, .asm_35f5f ; 35f51 $c jr nz, .asm_35f5f ; 35f51 $c
ld a, [hl] ld a, [hl]
ld [$d265], a ld [$d265], a
call $3468 call GetItemName
ld hl, ProtectedByText ld hl, ProtectedByText
jr .asm_35fb8 ; 35f5d $59 jr .asm_35fb8 ; 35f5d $59
.asm_35f5f .asm_35f5f
@ -5761,17 +5762,17 @@ Function0x35fc0: ; 35fc0
Function0x35fc9: ; 35fc9 Function0x35fc9: ; 35fc9
ld a, $9 ld a, BATTLE_VARS_SUBSTATUS5_OPP
call $39e7 call GetBattleVarPair
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
ld de, $c67c ld de, $c67c
jr z, .asm_35fd9 ; 0x35fd4 $3 jr z, .asm_35fd9
ld de, $c674 ld de, $c674
.asm_35fd9 .asm_35fd9
ld a, $d ld a, BATTLE_VARS_MOVE_EFFECT
call CleanGetBattleVarPair call CleanGetBattleVarPair
cp $21 cp EFFECT_TOXIC
ret ret
; 35fe1 ; 35fe1
@ -5780,23 +5781,23 @@ Function0x35fe1: ; 35fe1
ld de, EnemyMonType1 ld de, EnemyMonType1
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_35fec ; 0x35fe7 $3 jr z, .asm_35fec
ld de, BattleMonType1 ld de, BattleMonType1
.asm_35fec .asm_35fec
ld a, [de] ld a, [de]
inc de inc de
cp $3 cp POISON
ret z ret z
ld a, [de] ld a, [de]
cp $3 cp POISON
ret ret
; 35ff5 ; 35ff5
Function0x35ff5: ; 35ff5 Function0x35ff5: ; 35ff5
ld a, $b ld a, BATTLE_VARS_STATUS_OPP
call $39e7 call GetBattleVarPair
set 3, [hl] set PSN, [hl]
jp UpdateOpponentInParty jp UpdateOpponentInParty
; 35fff ; 35fff
@ -6418,27 +6419,27 @@ Function0x36386: ; 36386
Function0x36391: ; 36391 Function0x36391: ; 36391
ld a, $d ld a, BATTLE_VARS_MOVE_EFFECT
call CleanGetBattleVarPair call CleanGetBattleVarPair
cp $12 cp EFFECT_ATTACK_DOWN
jr c, .asm_363ae ; 0x36398 $14 jr c, .asm_363ae
cp $19 cp EFFECT_EVASION_DOWN + 1
jr c, .asm_363b0 ; 0x3639c $12 jr c, .asm_363b0
cp $3a cp EFFECT_ATTACK_DOWN_2
jr c, .asm_363ae ; 0x363a0 $c jr c, .asm_363ae
cp $41 cp EFFECT_EVASION_DOWN_2 + 1
jr c, .asm_363b0 ; 0x363a4 $a jr c, .asm_363b0
cp $44 cp EFFECT_ATTACK_DOWN_HIT
jr c, .asm_363ae ; 0x363a8 $4 jr c, .asm_363ae
cp $4b cp EFFECT_EVASION_DOWN_HIT + 1
jr c, .asm_363b0 ; 0x363ac $2 jr c, .asm_363b0
.asm_363ae .asm_363ae
xor a xor a
ret ret
.asm_363b0 .asm_363b0
ld a, $8 ld a, BATTLE_VARS_SUBSTATUS4_OPP
call CleanGetBattleVarPair call CleanGetBattleVarPair
bit 1, a bit SUBSTATUS_MIST, a
ret ret
; 363b8 ; 363b8
@ -6937,11 +6938,11 @@ BattleCommand21: ; 36671
ld hl, PlayerRolloutCount ld hl, PlayerRolloutCount
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_36684 ; 3667f $3 jr z, .asm_36684
ld hl, EnemyRolloutCount ld hl, EnemyRolloutCount
.asm_36684 .asm_36684
dec [hl] dec [hl]
jr nz, .asm_366dc ; 36685 $55 jr nz, .asm_366dc
ld a, BATTLE_VARS_SUBSTATUS3 ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarPair call GetBattleVarPair
res 0, [hl] res 0, [hl]
@ -6951,14 +6952,14 @@ BattleCommand21: ; 36671
ld a, BATTLE_VARS_MOVE_POWER ld a, BATTLE_VARS_MOVE_POWER
call GetBattleVarPair call GetBattleVarPair
ld a, $1 ld a, 1
ld [hl], a ld [hl], a
ld hl, EnemyDamageTaken ld hl, PlayerDamageTaken + 1
ld de, $c732 ld de, $c732
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_366ad ; 366a5 $6 jr z, .asm_366ad
ld hl, $c685 ld hl, EnemyDamageTaken + 1
ld de, $c733 ld de, $c733
.asm_366ad .asm_366ad
ld a, [hld] ld a, [hld]
@ -6968,23 +6969,24 @@ BattleCommand21: ; 36671
ld a, [hl] ld a, [hl]
rl a rl a
ld [CurDamage], a ld [CurDamage], a
jr nc, .asm_366c3 ; 366b9 $8 jr nc, .asm_366c3
ld a, $ff ld a, $ff
ld [CurDamage], a ld [CurDamage], a
ld [CurDamage + 1], a ld [CurDamage + 1], a
.asm_366c3 .asm_366c3
or b or b
jr nz, .asm_366cb ; 366c4 $5 jr nz, .asm_366cb
ld a, $1 ld a, 1
ld [AttackMissed], a ld [AttackMissed], a
.asm_366cb .asm_366cb
xor a xor a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [de], a ld [de], a
ld a, BATTLE_VARS_MOVE_ANIM ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVarPair call GetBattleVarPair
ld a, $75 ld a, BIDE
ld [hl], a ld [hl], a
ld b, $22 ; unleashenergy ld b, $22 ; unleashenergy
@ -8016,7 +8018,7 @@ BattleCommand27: ; 36cb2
.asm_36d0c .asm_36d0c
ld [$d10a], a ld [$d10a], a
ld a, $b ld a, $b
call $2d83 call Predef
call RefreshBattleHuds call RefreshBattleHuds
ld hl, RecoilText ld hl, RecoilText
jp FarBattleTextBox jp FarBattleTextBox
@ -8053,7 +8055,7 @@ BattleCommand2a: ; 36d3b
jr nz, .asm_36d53 jr nz, .asm_36d53
ld a, [hl] ld a, [hl]
ld [$d265], a ld [$d265], a
call $3468 call GetItemName
call Function0x37e77 call Function0x37e77
ld hl, ProtectedByText ld hl, ProtectedByText
jp FarBattleTextBox jp FarBattleTextBox
@ -8150,7 +8152,7 @@ BattleCommand30: ; 36dc7
jr nz, .asm_36def ; 36ddd $10 jr nz, .asm_36def ; 36ddd $10
ld a, [hl] ld a, [hl]
ld [$d265], a ld [$d265], a
call $3468 call GetItemName
call Function0x37e77 call Function0x37e77
ld hl, ProtectedByText ld hl, ProtectedByText
jp FarBattleTextBox jp FarBattleTextBox
@ -8493,7 +8495,7 @@ BattleCommand37: ; 36fed
ld a, [AttackMissed] ld a, [AttackMissed]
and a and a
jr nz, .asm_37059 ; 36ff1 $66 jr nz, .asm_37059 ; 36ff1 $66
ld de, EnemyEncoreCount ld de, EnemyDisableCount
ld hl, EnemyMonMoves ld hl, EnemyMonMoves
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@ -8976,7 +8978,7 @@ Function0x372e7: ; 372e7
jr z, .player jr z, .player
xor a xor a
ld [EnemyEncoreCount], a ld [EnemyDisableCount], a
ld [EnemyEncoredMove], a ld [EnemyEncoredMove], a
ret ret
@ -9360,7 +9362,7 @@ BattleCommand50: ; 37492
ld [hl], a ld [hl], a
ld [de], a ld [de], a
.asm_374f8 .asm_374f8
call $3468 call GetItemName
ld hl, StoleText ld hl, StoleText
jp FarBattleTextBox jp FarBattleTextBox
@ -9539,8 +9541,8 @@ Function0x3762c: ; 3762c
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_37637 jr z, .asm_37637
ld de, $c681
ld de, PlayerDamageTaken
.asm_37637 .asm_37637
call Function0x36abf call Function0x36abf
jr nz, .asm_37665 jr nz, .asm_37665
@ -9596,10 +9598,10 @@ BattleCommand5a: ; 3766f
call Function0x3762c call Function0x3762c
ret c ret c
; get substatus1
ld a, BATTLE_VARS_SUBSTATUS1 ld a, BATTLE_VARS_SUBSTATUS1
call GetBattleVarPair call GetBattleVarPair
set 5, [hl] ; endure set SUBSTATUS_ENDURE, [hl]
call Function0x37e01 call Function0x37e01
ld hl, BracedItselfText ld hl, BracedItselfText
jp FarBattleTextBox jp FarBattleTextBox
@ -9612,16 +9614,19 @@ BattleCommand56: ; 37683
ld hl, EnemyScreens ld hl, EnemyScreens
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_3768e ; 37689 $3 jr z, .asm_3768e
ld hl, PlayerScreens ld hl, PlayerScreens
.asm_3768e .asm_3768e
bit 0, [hl] bit 0, [hl]
jr nz, .asm_3769d ; 37690 $b jr nz, .failed
set 0, [hl] set 0, [hl]
call Function0x37e01 call Function0x37e01
ld hl, SpikesText ld hl, SpikesText
jp FarBattleTextBox jp FarBattleTextBox
.asm_3769d
.failed
jp Function0x37354 jp Function0x37354
; 376a0 ; 376a0
@ -9631,14 +9636,14 @@ BattleCommand57: ; 376a0
ld a, [AttackMissed] ld a, [AttackMissed]
and a and a
jr nz, .asm_376bf ; 376a4 $19 jr nz, .asm_376bf
call CheckHiddenOpponent call CheckHiddenOpponent
jr nz, .asm_376bf ; 376a9 $14 jr nz, .asm_376bf
ld a, BATTLE_VARS_SUBSTATUS1_OPP ld a, BATTLE_VARS_SUBSTATUS1_OPP
call GetBattleVarPair call GetBattleVarPair
bit 3, [hl] bit SUBSTATUS_IDENTIFIED, [hl]
jr nz, .asm_376bf ; 376b2 $b jr nz, .asm_376bf
set 3, [hl] set SUBSTATUS_IDENTIFIED, [hl]
call Function0x37e01 call Function0x37e01
ld hl, IdentifiedText ld hl, IdentifiedText
jp FarBattleTextBox jp FarBattleTextBox
@ -9652,25 +9657,25 @@ BattleCommand58: ; 376c2
ld hl, PlayerSubStatus1 ld hl, PlayerSubStatus1
ld de, EnemySubStatus1 ld de, EnemySubStatus1
bit 4, [hl] bit SUBSTATUS_PERISH, [hl]
jr z, .asm_376d1 ; 376ca $5 jr z, .asm_376d1
ld a, [de] ld a, [de]
bit 4, a bit SUBSTATUS_PERISH, a
jr nz, .asm_376f2 ; 376cf $21 jr nz, .asm_376f2
.asm_376d1 .asm_376d1
bit 4, [hl] bit SUBSTATUS_PERISH, [hl]
jr nz, .asm_376dc ; 376d3 $7 jr nz, .asm_376dc
set 4, [hl] set SUBSTATUS_PERISH, [hl]
ld a, $4 ld a, 4
ld [PlayerPerishCount], a ld [PlayerPerishCount], a
.asm_376dc .asm_376dc
ld a, [de] ld a, [de]
bit 4, a bit SUBSTATUS_PERISH, a
jr nz, .asm_376e9 ; 376df $8 jr nz, .asm_376e9
set 4, a set SUBSTATUS_PERISH, a
ld [de], a ld [de], a
ld a, $4 ld a, 4
ld [$c67f], a ld [EnemyPerishCount], a
.asm_376e9 .asm_376e9
call Function0x37e01 call Function0x37e01
ld hl, StartPerishText ld hl, StartPerishText
@ -9706,13 +9711,13 @@ BattleCommand5b: ; 37718
ld de, PlayerRolloutCount ld de, PlayerRolloutCount
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_37723 ; 3771e $3 jr z, .asm_37723
ld de, EnemyRolloutCount ld de, EnemyRolloutCount
.asm_37723 .asm_37723
ld a, BATTLE_VARS_SUBSTATUS1 ld a, BATTLE_VARS_SUBSTATUS1
call CleanGetBattleVarPair call CleanGetBattleVarPair
bit 6, a bit SUBSTATUS_ENCORED, a
jr z, .asm_37731 ; 3772a $5 jr z, .asm_37731
ld b, $4 ; doturn ld b, $4 ; doturn
jp SkipToBattleCommand jp SkipToBattleCommand

View File

@ -3737,6 +3737,7 @@ SUBSTATUS_IN_LOVE EQU 7
SUBSTATUS_ENCORED EQU 6 SUBSTATUS_ENCORED EQU 6
SUBSTATUS_ENDURE EQU 5 SUBSTATUS_ENDURE EQU 5
SUBSTATUS_PERISH EQU 4 SUBSTATUS_PERISH EQU 4
SUBSTATUS_IDENTIFIED EQU 3
SUBSTATUS_PROTECT EQU 2 SUBSTATUS_PROTECT EQU 2
SUBSTATUS_CURSE EQU 1 SUBSTATUS_CURSE EQU 1
SUBSTATUS_NIGHTMARE EQU 0 SUBSTATUS_NIGHTMARE EQU 0
@ -3756,10 +3757,12 @@ SUBSTATUS_RAGE EQU 6
SUBSTATUS_RECHARGE EQU 5 SUBSTATUS_RECHARGE EQU 5
SUBSTATUS_SUBSTITUTE EQU 4 SUBSTATUS_SUBSTITUTE EQU 4
SUBSTATUS_FOCUS_ENERGY EQU 2 SUBSTATUS_FOCUS_ENERGY EQU 2
SUBSTATUS_MIST EQU 1
SUBSTATUS_UNLEASH EQU 0 SUBSTATUS_UNLEASH EQU 0
SUBSTATUS_DESTINY_BOND EQU 6 SUBSTATUS_DESTINY_BOND EQU 6
SUBSTATUS_LOCK_ON EQU 5 SUBSTATUS_LOCK_ON EQU 5
SUBSTATUS_TOXIC EQU 0
; status ; status

View File

@ -510,7 +510,7 @@ PlayerSubStatus1: ; c668
; 6 encore ; 6 encore
; 5 endure ; 5 endure
; 4 perish song ; 4 perish song
; 3 ; 3 identified
; 2 protect ; 2 protect
; 1 curse ; 1 curse
; 0 nightmare ; 0 nightmare
@ -528,7 +528,7 @@ PlayerSubStatus2: ; c669
ds 1 ds 1
PlayerSubStatus3: ; c66a PlayerSubStatus3: ; c66a
; bit ; bit
; 7 confusion ; 7 confused
; 6 flying ; 6 flying
; 5 underground ; 5 underground
; 4 charged ; 4 charged
@ -545,7 +545,7 @@ PlayerSubStatus4: ; c66b
; 4 substitute ; 4 substitute
; 3 ; 3
; 2 focus energy ; 2 focus energy
; 1 ; 1 mist
; 0 bide: unleashed energy ; 0 bide: unleashed energy
ds 1 ds 1
PlayerSubStatus5: ; c66c PlayerSubStatus5: ; c66c
@ -557,7 +557,7 @@ PlayerSubStatus5: ; c66c
; 3 ; 3
; 2 ; 2
; 1 ; 1
; 0 ; 0 toxic
ds 1 ds 1
EnemySubStatus1: ; c66d EnemySubStatus1: ; c66d
@ -596,20 +596,22 @@ EnemyRolloutCount: ; c67a
EnemyConfuseCount: ; c67b EnemyConfuseCount: ; c67b
ds 1 ds 1
ds 1 ds 1
EnemyEncoreCount: ; c67d EnemyDisableCount: ; c67d
ds 1 ds 1
EnemyPerishCount: ; c67e EnemyEncoreCount: ; c67e
ds 1 ds 1
EnemyPerishCount: ; c67f
ds 1 ds 1
EnemyFuryCutterCount: ; c680 EnemyFuryCutterCount: ; c680
ds 1 ds 1
ds 1
PlayerDamageTaken: ; c681 PlayerDamageTaken: ; c682
ds 2 ds 2
EnemyDamageTaken: ; c683 EnemyDamageTaken: ; c684
ds 2 ds 2
ds 4 ds 3
ds 1 ds 1
@ -706,13 +708,14 @@ AlreadyFailed: ; c6fb
ds 3 ds 3
PlayerScreens: ; c6ff PlayerScreens: ; c6ff
; bit 4: reflect ; bit
; bit 3: light screen ; 4 reflect
; 3 light screen
; 0 spikes
ds 1 ds 1
EnemyScreens: ; c700 EnemyScreens: ; c700
; bit 4: reflect ; see PlayerScreens
; bit 3: light screen
ds 1 ds 1
ds 1 ds 1