mirror of https://github.com/pret/pokecrystal.git
Fix some misnamed substatus constants.
SUBSTATUS_ROLLOUT was actually SUBSTATUS_RAMPAGE. SUBSTATUS_ENCORED was actually SUBSTATUS_ROLLOUT. Substatus 5 bit 4 was actually SUBSTATUS_ENCORED. Also use some more (sub)status constants where needed.
This commit is contained in:
parent
c2dba43188
commit
dbe4c7ab67
|
@ -439,41 +439,34 @@ AIScoring_LeechHit: ; 387f7
|
|||
|
||||
AIScoring_LockOn: ; 3881d
|
||||
ld a, [PlayerSubStatus5]
|
||||
bit 5, a
|
||||
bit SUBSTATUS_LOCK_ON, a
|
||||
jr nz, .asm_38882
|
||||
|
||||
push hl
|
||||
call AICheckEnemyQuarterHP
|
||||
|
||||
jr nc, .asm_38877
|
||||
|
||||
call AICheckEnemyHalfHP
|
||||
|
||||
jr c, .asm_38834
|
||||
|
||||
call AICompareSpeed
|
||||
|
||||
jr nc, .asm_38877
|
||||
|
||||
|
||||
.asm_38834
|
||||
ld a, [PlayerEvaLevel]
|
||||
cp $a
|
||||
jr nc, .asm_3887a
|
||||
|
||||
cp $8
|
||||
jr nc, .asm_38875
|
||||
|
||||
ld a, [EnemyAccLevel]
|
||||
cp $5
|
||||
jr c, .asm_3887a
|
||||
|
||||
cp $7
|
||||
jr c, .asm_38875
|
||||
|
||||
ld hl, EnemyMonMoves
|
||||
ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
|
||||
|
||||
.asm_3884f
|
||||
dec c
|
||||
jr z, .asm_38877
|
||||
|
@ -490,18 +483,16 @@ AIScoring_LockOn: ; 3881d
|
|||
|
||||
ld a, $1
|
||||
ld [hBattleTurn], a
|
||||
|
||||
push hl
|
||||
push bc
|
||||
|
||||
callba Function347c8
|
||||
|
||||
ld a, [$d265]
|
||||
cp $a
|
||||
pop bc
|
||||
pop hl
|
||||
jr c, .asm_3884f
|
||||
|
||||
|
||||
.asm_38875
|
||||
pop hl
|
||||
ret
|
||||
|
@ -514,8 +505,8 @@ AIScoring_LockOn: ; 3881d
|
|||
.asm_3887a
|
||||
pop hl
|
||||
call Function39527
|
||||
|
||||
ret c
|
||||
|
||||
dec [hl]
|
||||
dec [hl]
|
||||
ret
|
||||
|
@ -546,11 +537,9 @@ AIScoring_LockOn: ; 3881d
|
|||
dec [hl]
|
||||
jr .asm_3888b
|
||||
|
||||
|
||||
.asm_388a2
|
||||
pop hl
|
||||
jp AIDiscourageMove
|
||||
|
||||
; 388a6
|
||||
|
||||
|
||||
|
@ -632,7 +621,6 @@ AIScoring_EvasionUp: ; 388d4
|
|||
jr c, .asm_388ef
|
||||
jr .asm_38911
|
||||
|
||||
|
||||
.asm_3890a
|
||||
call Function39527
|
||||
jr c, .asm_38911
|
||||
|
@ -661,7 +649,7 @@ AIScoring_EvasionUp: ; 388d4
|
|||
jr nz, .asm_388ef
|
||||
|
||||
ld a, [PlayerSubStatus1]
|
||||
bit SUBSTATUS_ENCORED, a
|
||||
bit SUBSTATUS_ROLLOUT, a
|
||||
jr nz, .asm_388ef
|
||||
|
||||
|
||||
|
@ -679,8 +667,8 @@ AIScoring_EvasionUp: ; 388d4
|
|||
|
||||
.asm_38941
|
||||
call Function39527
|
||||
|
||||
ret c
|
||||
|
||||
dec [hl]
|
||||
ret
|
||||
; 38947
|
||||
|
@ -802,7 +790,7 @@ AIScoring_AccuracyDown: ; 38985
|
|||
jr nz, .asm_3899d
|
||||
|
||||
ld a, [PlayerSubStatus1]
|
||||
bit SUBSTATUS_ENCORED, a
|
||||
bit SUBSTATUS_ROLLOUT, a
|
||||
jr nz, .asm_3899d
|
||||
|
||||
.asm_389e4
|
||||
|
@ -951,7 +939,7 @@ AIScoring_Bind: ; 38a71
|
|||
jr nz, .asm_38a91
|
||||
|
||||
ld a, [PlayerSubStatus1]
|
||||
and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ENCORED | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
|
||||
and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
|
||||
jr nz, .asm_38a91
|
||||
|
||||
ld a, [PlayerTurnsTaken]
|
||||
|
@ -1168,7 +1156,7 @@ AIScoring_HyperBeam: ; 38b63
|
|||
|
||||
AIScoring_Rage: ; 38b7f
|
||||
ld a, [EnemySubStatus4]
|
||||
bit 6, a
|
||||
bit SUBSTATUS_RAGE, a
|
||||
jr z, .asm_38b9b
|
||||
|
||||
call Function39527
|
||||
|
@ -1714,7 +1702,7 @@ AIScoring_MeanLook: ; 38dfb
|
|||
jr nz, .asm_38e26
|
||||
|
||||
ld a, [PlayerSubStatus1]
|
||||
and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ENCORED | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
|
||||
and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
|
||||
jr nz, .asm_38e26
|
||||
|
||||
push hl
|
||||
|
@ -1902,7 +1890,7 @@ AIScoring_Protect: ; 38ed2
|
|||
bit SUBSTATUS_CURSE, a
|
||||
jr nz, .asm_38f0d
|
||||
|
||||
bit SUBSTATUS_ENCORED, a
|
||||
bit SUBSTATUS_ROLLOUT, a
|
||||
jr z, .asm_38f14
|
||||
|
||||
ld a, [PlayerRolloutCount]
|
||||
|
@ -1966,7 +1954,7 @@ AIScoring_PerishSong: ; 38f4a
|
|||
jr c, .asm_38f75
|
||||
|
||||
ld a, [PlayerSubStatus5]
|
||||
bit 7, a
|
||||
bit SUBSTATUS_CANT_RUN, a
|
||||
jr nz, .asm_38f6f
|
||||
|
||||
push hl
|
||||
|
@ -1984,8 +1972,8 @@ AIScoring_PerishSong: ; 38f4a
|
|||
|
||||
.asm_38f6f
|
||||
call Function39527
|
||||
|
||||
ret c
|
||||
|
||||
dec [hl]
|
||||
ret
|
||||
|
||||
|
@ -2146,14 +2134,14 @@ AIScoring_Swagger:
|
|||
AIScoring_Attract: ; 39026
|
||||
ld a, [PlayerTurnsTaken]
|
||||
and a
|
||||
jr z, .asm_39032
|
||||
jr z, .first_turn
|
||||
|
||||
call Function39521
|
||||
ret c
|
||||
inc [hl]
|
||||
ret
|
||||
|
||||
.asm_39032
|
||||
.first_turn
|
||||
call Random
|
||||
cp 200
|
||||
ret nc
|
||||
|
@ -2180,7 +2168,7 @@ AIScoring_Earthquake: ; 39044
|
|||
|
||||
ld a, [PlayerSubStatus3]
|
||||
bit SUBSTATUS_UNDERGROUND, a
|
||||
jr z, .asm_39058
|
||||
jr z, .could_dig
|
||||
|
||||
call AICompareSpeed
|
||||
ret nc
|
||||
|
@ -2188,7 +2176,9 @@ AIScoring_Earthquake: ; 39044
|
|||
dec [hl]
|
||||
ret
|
||||
|
||||
.asm_39058
|
||||
.could_dig
|
||||
; Try to predict if the player
|
||||
; will use Dig this turn.
|
||||
call AICompareSpeed
|
||||
ret c
|
||||
call Function39527
|
||||
|
@ -2263,7 +2253,7 @@ AIScoring_HiddenPower: ; 3909e
|
|||
jr c, .asm_390c9
|
||||
|
||||
ld a, d
|
||||
cp $32
|
||||
cp 50
|
||||
jr c, .asm_390c9
|
||||
|
||||
ld a, [$d265]
|
||||
|
@ -2271,7 +2261,7 @@ AIScoring_HiddenPower: ; 3909e
|
|||
jr nc, .asm_390c7
|
||||
|
||||
ld a, d
|
||||
cp $46
|
||||
cp 70
|
||||
ret c
|
||||
|
||||
.asm_390c7
|
||||
|
|
|
@ -603,11 +603,11 @@ Function3c410: ; 3c410
|
|||
res SUBSTATUS_FLINCHED, [hl]
|
||||
|
||||
ld a, [hl]
|
||||
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT
|
||||
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE
|
||||
jp nz, .quit
|
||||
|
||||
ld hl, PlayerSubStatus1
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
bit SUBSTATUS_ROLLOUT, [hl]
|
||||
jp nz, .quit
|
||||
|
||||
and a
|
||||
|
@ -622,7 +622,7 @@ Function3c434: ; 3c434
|
|||
call Function3c410
|
||||
jp c, .asm_3c4ba
|
||||
ld hl, PlayerSubStatus5
|
||||
bit 4, [hl]
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
jr z, .asm_3c449
|
||||
ld a, [LastPlayerMove]
|
||||
ld [CurPlayerMove], a
|
||||
|
@ -725,7 +725,7 @@ Function3c4df: ; 3c4df
|
|||
call .asm_3c518
|
||||
.asm_3c4ed
|
||||
ld hl, PlayerSubStatus5
|
||||
bit 4, [hl]
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
ret z
|
||||
ld a, [PlayerEncoreCount]
|
||||
dec a
|
||||
|
@ -742,14 +742,14 @@ Function3c4df: ; 3c4df
|
|||
|
||||
.asm_3c50a
|
||||
ld hl, PlayerSubStatus5
|
||||
res 4, [hl]
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
call SetEnemyTurn
|
||||
ld hl, BattleText_0x80c8a
|
||||
jp StdBattleTextBox
|
||||
|
||||
.asm_3c518
|
||||
ld hl, EnemySubStatus5
|
||||
bit 4, [hl]
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
ret z
|
||||
ld a, [EnemyEncoreCount]
|
||||
dec a
|
||||
|
@ -766,7 +766,7 @@ Function3c4df: ; 3c4df
|
|||
|
||||
.asm_3c535
|
||||
ld hl, EnemySubStatus5
|
||||
res 4, [hl]
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
call SetPlayerTurn
|
||||
ld hl, BattleText_0x80c8a
|
||||
jp StdBattleTextBox
|
||||
|
@ -1095,26 +1095,28 @@ Function3c716: ; 3c716
|
|||
push de
|
||||
call StdBattleTextBox
|
||||
pop de
|
||||
|
||||
xor a
|
||||
ld [$cfca], a
|
||||
call Function3ee0f
|
||||
call GetEighthMaxHP
|
||||
ld de, $c674
|
||||
ld de, PlayerToxicCount
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .asm_3c74d
|
||||
ld de, $c67c
|
||||
|
||||
ld de, EnemyToxicCount
|
||||
.asm_3c74d
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS5
|
||||
call GetBattleVar
|
||||
bit SUBSTATUS_TOXIC, a
|
||||
jr z, .asm_3c765
|
||||
|
||||
call GetSixteenthMaxHP
|
||||
ld a, [de]
|
||||
inc a
|
||||
ld [de], a
|
||||
ld hl, $0000
|
||||
ld hl, 0
|
||||
.asm_3c75f
|
||||
add hl, bc
|
||||
dec a
|
||||
|
@ -1600,7 +1602,7 @@ Function3ca8f: ; 3ca8f
|
|||
call .asm_3cac9
|
||||
.asm_3ca9d
|
||||
ld a, [BattleMonStatus]
|
||||
bit 5, a
|
||||
bit FRZ, a
|
||||
ret z
|
||||
ld a, [$c73f]
|
||||
and a
|
||||
|
@ -1613,7 +1615,7 @@ Function3ca8f: ; 3ca8f
|
|||
ld a, [CurBattleMon]
|
||||
ld hl, PartyMon1Status
|
||||
call GetPartyLocation
|
||||
ld [hl], $0
|
||||
ld [hl], 0
|
||||
call UpdateBattleHuds
|
||||
call SetEnemyTurn
|
||||
ld hl, DefrostedOpponentText
|
||||
|
@ -1621,7 +1623,7 @@ Function3ca8f: ; 3ca8f
|
|||
|
||||
.asm_3cac9
|
||||
ld a, [EnemyMonStatus]
|
||||
bit 5, a
|
||||
bit FRZ, a
|
||||
ret z
|
||||
ld a, [$c740]
|
||||
and a
|
||||
|
@ -1631,15 +1633,16 @@ Function3ca8f: ; 3ca8f
|
|||
ret nc
|
||||
xor a
|
||||
ld [EnemyMonStatus], a
|
||||
|
||||
ld a, [IsInBattle]
|
||||
dec a
|
||||
jr z, .asm_3caef
|
||||
ld a, [CurOTMon]
|
||||
ld hl, OTPartyMon1Status
|
||||
call GetPartyLocation
|
||||
ld [hl], $0
|
||||
|
||||
ld [hl], 0
|
||||
.asm_3caef
|
||||
|
||||
call UpdateBattleHuds
|
||||
call SetPlayerTurn
|
||||
ld hl, DefrostedOpponentText
|
||||
|
@ -2938,7 +2941,6 @@ Function3d2b3: ; 3d2b3
|
|||
; 3d2e0
|
||||
|
||||
|
||||
|
||||
Function3d2e0: ; 3d2e0
|
||||
ld a, [InLinkBattle]
|
||||
cp $4
|
||||
|
@ -3625,7 +3627,7 @@ Function3d714: ; 3d714
|
|||
and a
|
||||
jp nz, .asm_3d749
|
||||
ld a, [Options]
|
||||
bit 6, a
|
||||
bit BATTLE_SHIFT, a
|
||||
jr nz, .asm_3d749
|
||||
ld a, [CurPartyMon]
|
||||
push af
|
||||
|
@ -4911,7 +4913,7 @@ PrintPlayerHUD: ; 3dfbf
|
|||
pop bc
|
||||
ret nz
|
||||
ld a, b
|
||||
cp $7f
|
||||
cp " "
|
||||
jr nz, .asm_3e02d
|
||||
dec hl
|
||||
|
||||
|
@ -5675,14 +5677,15 @@ Function3e4bc: ; 3e4bc
|
|||
ld a, $1
|
||||
ld [hBGMapMode], a
|
||||
call Function1bd3
|
||||
bit 6, a
|
||||
bit 6, a ; D_UP
|
||||
jp nz, .asm_3e61d
|
||||
bit 7, a
|
||||
bit 7, a ; D_DOWN
|
||||
jp nz, .asm_3e62e
|
||||
bit 2, a
|
||||
jp nz, Function3e643
|
||||
bit 1, a
|
||||
bit 2, a ; B_BUTTON
|
||||
jp nz, .asm_3e643
|
||||
bit 1, a ; A_BUTTON
|
||||
push af
|
||||
|
||||
xor a
|
||||
ld [$d0e3], a
|
||||
ld a, [$cfa9]
|
||||
|
@ -5692,6 +5695,7 @@ Function3e4bc: ; 3e4bc
|
|||
ld a, [$d235]
|
||||
dec a
|
||||
jr nz, .asm_3e5d0
|
||||
|
||||
pop af
|
||||
ret
|
||||
|
||||
|
@ -5700,12 +5704,14 @@ Function3e4bc: ; 3e4bc
|
|||
ld a, b
|
||||
ld [CurMoveNum], a
|
||||
jr nz, .asm_3e5d9
|
||||
|
||||
pop af
|
||||
ret
|
||||
|
||||
.asm_3e5d9
|
||||
pop af
|
||||
ret nz
|
||||
|
||||
ld hl, BattleMonPP
|
||||
ld a, [$cfa9]
|
||||
ld c, a
|
||||
|
@ -5762,7 +5768,7 @@ Function3e4bc: ; 3e4bc
|
|||
jp .asm_3e57a
|
||||
; 3e62e
|
||||
|
||||
.asm_3e62e: ; 3e62e
|
||||
.asm_3e62e ; 3e62e
|
||||
ld a, [$cfa9]
|
||||
ld b, a
|
||||
ld a, [$d0eb]
|
||||
|
@ -5775,7 +5781,7 @@ Function3e4bc: ; 3e4bc
|
|||
jp .asm_3e57a
|
||||
; 3e643
|
||||
|
||||
Function3e643: ; 3e643
|
||||
.asm_3e643 ; 3e643
|
||||
ld a, [$d0e3]
|
||||
and a
|
||||
jr z, .asm_3e6bf
|
||||
|
@ -5942,10 +5948,9 @@ Function3e75f: ; 3e75f
|
|||
hlcoord 5, 11
|
||||
ld a, [InLinkBattle]
|
||||
cp $4
|
||||
jr c, .asm_3e76c
|
||||
jr c, .ok
|
||||
hlcoord 5, 11
|
||||
|
||||
.asm_3e76c
|
||||
.ok
|
||||
push hl
|
||||
ld de, StringBuffer1
|
||||
ld bc, $0102
|
||||
|
@ -6033,14 +6038,14 @@ Function3e7c1: ; 3e7c1
|
|||
ld [CurEnemyMoveNum], a
|
||||
ld c, a
|
||||
ld a, [EnemySubStatus1]
|
||||
bit SUBSTATUS_ENCORED, a
|
||||
bit SUBSTATUS_ROLLOUT, a
|
||||
jp nz, .asm_3e882
|
||||
ld a, [EnemySubStatus3]
|
||||
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT | 1 << SUBSTATUS_BIDE
|
||||
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
|
||||
jp nz, .asm_3e882
|
||||
|
||||
ld hl, EnemySubStatus5
|
||||
bit 4, [hl]
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
ld a, [LastEnemyMove]
|
||||
jp nz, .asm_3e87f
|
||||
ld hl, EnemyMonMoves
|
||||
|
@ -6051,7 +6056,7 @@ Function3e7c1: ; 3e7c1
|
|||
|
||||
.asm_3e817
|
||||
ld hl, EnemySubStatus5
|
||||
bit 4, [hl]
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
jr z, .asm_3e824
|
||||
ld a, [LastEnemyMove]
|
||||
jp .asm_3e87f
|
||||
|
@ -6155,7 +6160,7 @@ Function3e7c1: ; 3e7c1
|
|||
ret
|
||||
|
||||
.asm_3e8bd
|
||||
ld a, $a5
|
||||
ld a, STRUGGLE
|
||||
jr .asm_3e87f
|
||||
; 3e8c1
|
||||
|
||||
|
@ -6175,10 +6180,10 @@ Function3e8d1: ; 3e8d1
|
|||
ret nz
|
||||
ld hl, EnemySubStatus3
|
||||
ld a, [hl]
|
||||
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT | 1 << SUBSTATUS_BIDE
|
||||
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
|
||||
ret nz
|
||||
ld hl, EnemySubStatus1
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
bit SUBSTATUS_ROLLOUT, [hl]
|
||||
ret
|
||||
; 3e8e4
|
||||
|
||||
|
@ -6554,7 +6559,6 @@ LoadEnemyMon: ; 3e8eb
|
|||
|
||||
|
||||
.Moves
|
||||
; ????
|
||||
ld hl, BaseType1
|
||||
ld de, EnemyMonType1
|
||||
ld a, [hli]
|
||||
|
@ -6884,7 +6888,7 @@ Function3ec39: ; 3ec39
|
|||
and a
|
||||
jr z, .asm_3ec5a
|
||||
ld a, [BattleMonStatus]
|
||||
and $40
|
||||
and 1 << PAR
|
||||
ret z
|
||||
ld hl, $c645
|
||||
ld a, [hld]
|
||||
|
@ -6905,7 +6909,7 @@ Function3ec39: ; 3ec39
|
|||
|
||||
.asm_3ec5a
|
||||
ld a, [EnemyMonStatus]
|
||||
and $40
|
||||
and 1 << PAR
|
||||
ret z
|
||||
ld hl, $d21f
|
||||
ld a, [hld]
|
||||
|
@ -6930,7 +6934,7 @@ Function3ec76: ; 3ec76
|
|||
and a
|
||||
jr z, .asm_3ec93
|
||||
ld a, [BattleMonStatus]
|
||||
and $10
|
||||
and 1 << BRN
|
||||
ret z
|
||||
ld hl, $c641
|
||||
ld a, [hld]
|
||||
|
@ -6949,7 +6953,7 @@ Function3ec76: ; 3ec76
|
|||
|
||||
.asm_3ec93
|
||||
ld a, [EnemyMonStatus]
|
||||
and $10
|
||||
and 1 << BRN
|
||||
ret z
|
||||
ld hl, $d21b
|
||||
ld a, [hld]
|
||||
|
@ -8288,9 +8292,10 @@ Function3f41c: ; 3f41c
|
|||
|
||||
Function3f43d: ; 3f43d
|
||||
ld a, [PlayerSubStatus4]
|
||||
bit 4, a
|
||||
bit SUBSTATUS_SUBSTITUTE, a
|
||||
ld hl, BattleAnimCmd_DD
|
||||
jr nz, Function3f46f
|
||||
|
||||
Function3f447: ; 3f447
|
||||
ld a, [$c6fe]
|
||||
and a
|
||||
|
@ -8323,7 +8328,7 @@ Function3f46f: ; 3f46f
|
|||
|
||||
Function3f47c: ; 3f47c
|
||||
ld a, [EnemySubStatus4]
|
||||
bit 4, a
|
||||
bit SUBSTATUS_SUBSTITUTE, a
|
||||
ld hl, BattleAnimCmd_DD
|
||||
jr nz, Function3f4b4
|
||||
Function3f486: ; 3f486
|
||||
|
@ -8661,10 +8666,10 @@ Function3f6d0: ; 3f6d0
|
|||
ld [$d0e1], a
|
||||
ld hl, PlayerSubStatus1
|
||||
ld b, $18
|
||||
.asm_3f715
|
||||
.loop
|
||||
ld [hli], a
|
||||
dec b
|
||||
jr nz, .asm_3f715
|
||||
jr nz, .loop
|
||||
call WaitSFX
|
||||
ret
|
||||
; 3f71d
|
||||
|
|
|
@ -356,12 +356,12 @@ CheckPlayerTurn:
|
|||
CantMove: ; 341f0
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call GetBattleVarAddr
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
res SUBSTATUS_ROLLOUT, [hl]
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS3
|
||||
call GetBattleVarAddr
|
||||
ld a, [hl]
|
||||
and $ff ^ (1<<SUBSTATUS_BIDE + 1<<SUBSTATUS_ROLLOUT + 1<<SUBSTATUS_CHARGED)
|
||||
and $ff ^ (1<<SUBSTATUS_BIDE + 1<<SUBSTATUS_RAMPAGE + 1<<SUBSTATUS_CHARGED)
|
||||
ld [hl], a
|
||||
|
||||
call ResetFuryCutterCount
|
||||
|
@ -819,7 +819,7 @@ BattleCommand02: ; 343db
|
|||
ld hl, WontObeyText
|
||||
call StdBattleTextBox
|
||||
call HitConfusion
|
||||
jp Function3450c
|
||||
jp .asm_3450c
|
||||
|
||||
|
||||
.Nap
|
||||
|
@ -855,7 +855,7 @@ BattleCommand02: ; 343db
|
|||
|
||||
.Print
|
||||
call StdBattleTextBox
|
||||
jp Function3450c
|
||||
jp .asm_3450c
|
||||
|
||||
|
||||
.UseInstead
|
||||
|
@ -959,19 +959,15 @@ BattleCommand02: ; 343db
|
|||
pop af
|
||||
ld [CurMoveNum], a
|
||||
|
||||
; fallthrough
|
||||
; 3450c
|
||||
|
||||
|
||||
Function3450c: ; 3450c
|
||||
.asm_3450c
|
||||
xor a
|
||||
ld [LastPlayerMove], a
|
||||
ld [LastEnemyCounterMove], a
|
||||
|
||||
; Break Encore too.
|
||||
ld hl, PlayerSubStatus5
|
||||
res 4, [hl]
|
||||
|
||||
; Break encore too.
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
xor a
|
||||
ld [PlayerEncoreCount], a
|
||||
|
||||
|
@ -994,7 +990,7 @@ IgnoreSleepOnly: ; 3451f
|
|||
.CheckSleep
|
||||
ld a, BATTLE_VARS_STATUS
|
||||
call GetBattleVar
|
||||
and 7
|
||||
and SLP
|
||||
ret z
|
||||
|
||||
; 'ignored orders…sleeping!'
|
||||
|
@ -4475,20 +4471,20 @@ BattleCommand41: ; 35864
|
|||
ld de, EnemyEncoreCount
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .asm_35875 ; 3586d $6
|
||||
jr z, .ok
|
||||
ld hl, BattleMonMoves
|
||||
ld de, PlayerEncoreCount
|
||||
.asm_35875
|
||||
.ok
|
||||
ld a, BATTLE_VARS_LAST_MOVE_OPP
|
||||
call GetBattleVar
|
||||
and a
|
||||
jp z, .asm_35923
|
||||
jp z, .failed
|
||||
cp STRUGGLE
|
||||
jp z, .asm_35923
|
||||
jp z, .failed
|
||||
cp ENCORE
|
||||
jp z, .asm_35923
|
||||
jp z, .failed
|
||||
cp MIRROR_MOVE
|
||||
jp z, .asm_35923
|
||||
jp z, .failed
|
||||
ld b, a
|
||||
|
||||
.asm_3588e
|
||||
|
@ -4500,15 +4496,15 @@ BattleCommand41: ; 35864
|
|||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
jp z, .asm_35923
|
||||
jp z, .failed
|
||||
ld a, [AttackMissed]
|
||||
and a
|
||||
jp nz, .asm_35923
|
||||
jp nz, .failed
|
||||
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
||||
call GetBattleVarAddr
|
||||
bit 4, [hl]
|
||||
jp nz, .asm_35923
|
||||
set 4, [hl]
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
jp nz, .failed
|
||||
set SUBSTATUS_ENCORED, [hl]
|
||||
call BattleRandom
|
||||
and $3
|
||||
inc a
|
||||
|
@ -4535,10 +4531,11 @@ BattleCommand41: ; 35864
|
|||
cp NUM_MOVES
|
||||
jr c, .asm_358cc
|
||||
pop hl
|
||||
res 4, [hl]
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
xor a
|
||||
ld [de], a
|
||||
jr .asm_35923
|
||||
jr .failed
|
||||
|
||||
.asm_358dd
|
||||
pop hl
|
||||
|
||||
|
@ -4566,10 +4563,10 @@ BattleCommand41: ; 35864
|
|||
cp NUM_MOVES
|
||||
jr c, .asm_358f9
|
||||
pop hl
|
||||
res 4, [hl]
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
xor a
|
||||
ld [de], a
|
||||
jr .asm_35923
|
||||
jr .failed
|
||||
.asm_3590a
|
||||
pop hl
|
||||
|
||||
|
@ -4586,7 +4583,7 @@ BattleCommand41: ; 35864
|
|||
ld hl, GotAnEncoreText
|
||||
jp StdBattleTextBox
|
||||
|
||||
.asm_35923
|
||||
.failed
|
||||
jp PrintDidntAffect2
|
||||
; 35926
|
||||
|
||||
|
@ -5669,6 +5666,7 @@ BattleCommand2f: ; 35f2c
|
|||
call BattleRandom
|
||||
cp $40
|
||||
jr c, .asm_35fb8
|
||||
|
||||
.asm_35f89
|
||||
call CheckSubstituteOpp
|
||||
jr nz, .asm_35fb8
|
||||
|
@ -5677,12 +5675,12 @@ BattleCommand2f: ; 35f2c
|
|||
jr nz, .asm_35fb8
|
||||
call Function35fc9
|
||||
jr z, .asm_35fa4
|
||||
call Function35fc0
|
||||
|
||||
call Function35fc0
|
||||
ld hl, WasPoisonedText
|
||||
call StdBattleTextBox
|
||||
|
||||
jr .asm_35fb1
|
||||
|
||||
.asm_35fa4
|
||||
set SUBSTATUS_TOXIC, [hl]
|
||||
xor a
|
||||
|
@ -5716,10 +5714,10 @@ Function35fc9: ; 35fc9
|
|||
call GetBattleVarAddr
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
ld de, $c67c
|
||||
jr z, .asm_35fd9
|
||||
ld de, $c674
|
||||
.asm_35fd9
|
||||
ld de, EnemyToxicCount
|
||||
jr z, .ok
|
||||
ld de, PlayerToxicCount
|
||||
.ok
|
||||
ld a, BATTLE_VARS_MOVE_EFFECT
|
||||
call GetBattleVar
|
||||
cp EFFECT_TOXIC
|
||||
|
@ -5731,9 +5729,9 @@ Function35fe1: ; 35fe1
|
|||
ld de, EnemyMonType1
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .asm_35fec
|
||||
jr z, .ok
|
||||
ld de, BattleMonType1
|
||||
.asm_35fec
|
||||
.ok
|
||||
ld a, [de]
|
||||
inc de
|
||||
cp POISON
|
||||
|
@ -7057,7 +7055,7 @@ BattleCommand3d: ; 36751
|
|||
.ok
|
||||
ld a, BATTLE_VARS_SUBSTATUS3
|
||||
call GetBattleVarAddr
|
||||
set SUBSTATUS_ROLLOUT, [hl]
|
||||
set SUBSTATUS_RAMPAGE, [hl]
|
||||
call BattleRandom
|
||||
and 1
|
||||
inc a
|
||||
|
@ -9831,7 +9829,7 @@ ResetBatonPassStatus: ; 37ab1
|
|||
ld a, BATTLE_VARS_SUBSTATUS5
|
||||
call GetBattleVarAddr
|
||||
res SUBSTATUS_TRANSFORMED, [hl]
|
||||
res 4, [hl]
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
|
||||
; New mon hasn't used a move yet.
|
||||
ld a, BATTLE_VARS_LAST_MOVE
|
||||
|
|
|
@ -7,19 +7,18 @@ BattleCommand5b: ; 37718
|
|||
ld de, PlayerRolloutCount
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .asm_37723
|
||||
jr z, .ok
|
||||
ld de, EnemyRolloutCount
|
||||
|
||||
.asm_37723
|
||||
.ok
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call GetBattleVar
|
||||
bit SUBSTATUS_ENCORED, a
|
||||
jr z, .asm_37731
|
||||
bit SUBSTATUS_ROLLOUT, a
|
||||
jr z, .reset
|
||||
|
||||
ld b, $4 ; doturn
|
||||
jp SkipToBattleCommand
|
||||
|
||||
.asm_37731
|
||||
.reset
|
||||
xor a
|
||||
ld [de], a
|
||||
ret
|
||||
|
@ -66,13 +65,13 @@ BattleCommand5c: ; 37734
|
|||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call GetBattleVarAddr
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
res SUBSTATUS_ROLLOUT, [hl]
|
||||
jr .asm_37775
|
||||
|
||||
.asm_3776e
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call GetBattleVarAddr
|
||||
set SUBSTATUS_ENCORED, [hl]
|
||||
set SUBSTATUS_ROLLOUT, [hl]
|
||||
|
||||
.asm_37775
|
||||
ld a, BATTLE_VARS_SUBSTATUS2
|
||||
|
|
|
@ -86,7 +86,7 @@ PAR EQU 6
|
|||
|
||||
; substatus
|
||||
SUBSTATUS_IN_LOVE EQU 7
|
||||
SUBSTATUS_ENCORED EQU 6
|
||||
SUBSTATUS_ROLLOUT EQU 6
|
||||
SUBSTATUS_ENDURE EQU 5
|
||||
SUBSTATUS_PERISH EQU 4
|
||||
SUBSTATUS_IDENTIFIED EQU 3
|
||||
|
@ -101,7 +101,7 @@ SUBSTATUS_FLYING EQU 6
|
|||
SUBSTATUS_UNDERGROUND EQU 5
|
||||
SUBSTATUS_CHARGED EQU 4
|
||||
SUBSTATUS_FLINCHED EQU 3
|
||||
SUBSTATUS_ROLLOUT EQU 1
|
||||
SUBSTATUS_RAMPAGE EQU 1
|
||||
SUBSTATUS_BIDE EQU 0
|
||||
|
||||
SUBSTATUS_LEECH_SEED EQU 7
|
||||
|
@ -115,6 +115,7 @@ SUBSTATUS_UNLEASH EQU 0
|
|||
SUBSTATUS_CANT_RUN EQU 7
|
||||
SUBSTATUS_DESTINY_BOND EQU 6
|
||||
SUBSTATUS_LOCK_ON EQU 5
|
||||
SUBSTATUS_ENCORED EQU 4
|
||||
SUBSTATUS_TRANSFORMED EQU 3
|
||||
SUBSTATUS_TOXIC EQU 0
|
||||
|
||||
|
|
2
wram.asm
2
wram.asm
|
@ -433,6 +433,7 @@ PlayerRolloutCount:: ; c672
|
|||
ds 1
|
||||
PlayerConfuseCount:: ; c673
|
||||
ds 1
|
||||
PlayerToxicCount:: ; c674
|
||||
ds 1
|
||||
PlayerDisableCount:: ; c675
|
||||
ds 1
|
||||
|
@ -449,6 +450,7 @@ EnemyRolloutCount:: ; c67a
|
|||
ds 1
|
||||
EnemyConfuseCount:: ; c67b
|
||||
ds 1
|
||||
EnemyToxicCount:: ; c67c
|
||||
ds 1
|
||||
EnemyDisableCount:: ; c67d
|
||||
ds 1
|
||||
|
|
Loading…
Reference in New Issue