diff options
Diffstat (limited to 'battle/effect_commands.asm')
-rw-r--r-- | battle/effect_commands.asm | 121 |
1 files changed, 66 insertions, 55 deletions
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index 4d53eec08..fd35756ee 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -700,7 +700,7 @@ BattleCommand02: ; 343db and a ret nz - ld a, [wcfc0] + ld a, [InBattleTowerBattle] and a ret nz @@ -1458,37 +1458,37 @@ BattleCommand07: ; 346d2 ld [AttackMissed], a xor a .asm_34775 - ld [$ffb7], a + ld [hMultiplier], a add b ld [TypeModifier], a xor a - ld [$ffb4], a + ld [hMultiplicand + 0], a ld hl, CurDamage ld a, [hli] - ld [$ffb5], a + ld [hMultiplicand + 1], a ld a, [hld] - ld [$ffb6], a + ld [hMultiplicand + 2], a call Multiply - ld a, [$ffb4] + ld a, [hProduct + 1] ld b, a - ld a, [$ffb5] + ld a, [hProduct + 2] or b ld b, a - ld a, [$ffb6] + ld a, [hProduct + 3] or b jr z, .asm_347ab ld a, $a - ld [$ffb7], a + ld [hDivisor], a ld b, $4 call Divide - ld a, [$ffb5] + ld a, [hQuotient + 1] ld b, a - ld a, [$ffb6] + ld a, [hQuotient + 2] or b jr nz, .asm_347ab @@ -1572,11 +1572,11 @@ Function347d3: ; 347d3 jr .asm_347e7 .asm_3480b xor a - ld [$ffb3], a - ld [$ffb4], a - ld [$ffb5], a + ld [hDividend + 0], a + ld [hMultiplicand + 0], a + ld [hMultiplicand + 1], a ld a, [hli] - ld [$ffb6], a + ld [hMultiplicand + 2], a ld a, [wd265] ld [hMultiplier], a call Multiply @@ -1586,7 +1586,7 @@ Function347d3: ; 347d3 ld b, 4 call Divide pop bc - ld a, [$ffb6] + ld a, [hQuotient + 2] ld [wd265], a jr .asm_347e7 @@ -2305,12 +2305,12 @@ BattleCommand08: ; 34cfd .go ; Start with the maximum damage. xor a - ld [$ffb4], a + ld [hMultiplicand + 0], a dec hl ld a, [hli] - ld [$ffb5], a + ld [hMultiplicand + 1], a ld a, [hl] - ld [$ffb6], a + ld [hMultiplicand + 2], a ; Multiply by 85-100%... .loop @@ -2319,20 +2319,20 @@ BattleCommand08: ; 34cfd cp $d9 ; 85% jr c, .loop - ld [$ffb7], a + ld [hMultiplier], a call Multiply ; ...divide by 100%... ld a, $ff ; 100% - ld [$ffb7], a + ld [hDivisor], a ld b, $4 call Divide ; ...to get .85-1.00x damage. - ld a, [$ffb5] + ld a, [hQuotient + 1] ld hl, CurDamage ld [hli], a - ld a, [$ffb6] + ld a, [hQuotient + 2] ld [hl], a ret ; 34d32 @@ -2594,10 +2594,10 @@ BattleCommand09: ; 34d32 sub c ld c, a xor a - ld [$ffb4], a - ld [$ffb5], a + ld [hMultiplicand + 0], a + ld [hMultiplicand + 1], a ld a, [hl] - ld [$ffb6], a + ld [hMultiplicand + 2], a push hl ld d, $2 @@ -2611,15 +2611,15 @@ BattleCommand09: ; 34d32 add hl, bc pop bc ld a, [hli] - ld [$ffb7], a + ld [hMultiplier], a call Multiply ld a, [hl] - ld [$ffb7], a + ld [hDivisor], a ld b, $4 call Divide - ld a, [$ffb6] + ld a, [hQuotient + 2] ld b, a - ld a, [$ffb5] + ld a, [hQuotient + 1] or b jr nz, .asm_34ea2 ld [$ffb5], a @@ -3841,7 +3841,7 @@ BattleCommanda1: ; 35461 and a jr nz, .asm_35532 - ld a, [wcfc0] + ld a, [InBattleTowerBattle] and a jr nz, .asm_35532 @@ -4344,18 +4344,18 @@ BattleCommand3f: ; 35726 .asm_3579d xor a ld [$ffb3], a - ld [$ffb4], a + ld [hMultiplicand + 0], a ld a, [hli] - ld [$ffb5], a + ld [hMultiplicand + 1], a ld a, [hli] - ld [$ffb6], a + ld [hMultiplicand + 2], a ld a, $30 - ld [$ffb7], a + ld [hMultiplier], a call Multiply ld a, [hli] ld b, a ld a, [hl] - ld [$ffb7], a + ld [hDivisor], a ld a, b and a jr z, .asm_357d6 @@ -4365,22 +4365,22 @@ BattleCommand3f: ; 35726 rr a srl b rr a - ld [$ffb7], a - ld a, [$ffb5] + ld [hDivisor], a + ld a, [hProduct + 2] ld b, a srl b - ld a, [$ffb6] + ld a, [hProduct + 3] rr a srl b rr a - ld [$ffb6], a + ld [hDividend + 3], a ld a, b - ld [$ffb5], a + ld [hDividend + 2], a .asm_357d6 ld b, $4 call Divide - ld a, [$ffb6] + ld a, [hQuotient + 2] ld b, a ld hl, .FlailPower @@ -5544,7 +5544,7 @@ BattleCommand14: ; 35e5c call AnimateCurrentMove ld b, $7 - ld a, [wcfc0] + ld a, [InBattleTowerBattle] and a jr z, .asm_35ea4 ld b, $3 @@ -5587,7 +5587,7 @@ Function35ece: ; 35ece and a jr nz, .asm_35eec - ld a, [wcfc0] + ld a, [InBattleTowerBattle] and a jr nz, .asm_35eec @@ -5676,18 +5676,23 @@ BattleCommand2f: ; 35f2c call GetBattleVar and a jr nz, .asm_35fb8 + ld a, [hBattleTurn] and a jr z, .asm_35f89 + ld a, [InLinkBattle] and a jr nz, .asm_35f89 - ld a, [wcfc0] + + ld a, [InBattleTowerBattle] and a jr nz, .asm_35f89 + ld a, [PlayerSubStatus5] bit SUBSTATUS_LOCK_ON, a jr nz, .asm_35f89 + call BattleRandom cp $40 jr c, .asm_35fb8 @@ -6323,11 +6328,12 @@ BattleCommand1d: ; 362e3 ld a, [hBattleTurn] and a jr z, .DidntMiss + ld a, [InLinkBattle] and a jr nz, .DidntMiss - ld a, [wcfc0] + ld a, [InBattleTowerBattle] and a jr nz, .DidntMiss @@ -6868,7 +6874,7 @@ rept 2 endr xor a - ld [hMultiplicand], a + ld [hMultiplicand + 0], a ld a, [de] ld [hMultiplicand + 1], a inc de @@ -8168,18 +8174,23 @@ BattleCommand30: ; 36dc7 ld a, [hBattleTurn] and a jr z, .asm_36e0e + ld a, [InLinkBattle] and a jr nz, .asm_36e0e - ld a, [wcfc0] + + ld a, [InBattleTowerBattle] and a jr nz, .asm_36e0e + ld a, [PlayerSubStatus5] bit SUBSTATUS_LOCK_ON, a jr nz, .asm_36e0e + call BattleRandom cp $40 jr c, .asm_36e52 + .asm_36e0e ld a, BATTLE_VARS_STATUS_OPP call GetBattleVarAddr @@ -9459,7 +9470,7 @@ BattleCommand60: ; 3784b ld hl, EnemyMonHappiness .ok xor a - ld [hMultiplicand], a + ld [hMultiplicand + 0], a ld [hMultiplicand + 1], a ld a, [hl] ld [hMultiplicand + 2], a @@ -9584,18 +9595,18 @@ BattleCommand63: ; 3790e .asm_3791a ld a, $ff sub [hl] - ld [$ffb6], a + ld [hMultiplicand + 2], a xor a - ld [$ffb4], a - ld [$ffb5], a + ld [hMultiplicand + 0], a + ld [hMultiplicand + 1], a ld a, 10 - ld [$ffb7], a + ld [hMultiplier], a call Multiply ld a, 25 - ld [$ffb7], a + ld [hDivisor], a ld b, 4 call Divide - ld a, [$ffb6] + ld a, [hQuotient + 2] ld d, a pop bc ret |