summaryrefslogtreecommitdiff
path: root/engine/battle/effect_commands.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2018-08-26 22:54:11 -0400
committerGitHub <noreply@github.com>2018-08-26 22:54:11 -0400
commita71b28e5b724564fe19f329f5cbb474f8b111acb (patch)
tree0fbb1d3add4c64eb72e9c6790bf35b884fbcee8a /engine/battle/effect_commands.asm
parent3eacab563d0e1ab5557c2443556a7a5e58d14cad (diff)
parentb42ba692c49f09bb51b2fd233a8a97e7eb3208db (diff)
Merge pull request #557 from Rangi42/master
Miscellaneous changes
Diffstat (limited to 'engine/battle/effect_commands.asm')
-rw-r--r--engine/battle/effect_commands.asm52
1 files changed, 26 insertions, 26 deletions
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 8ad52ef3c..366898c8c 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -1368,9 +1368,9 @@ BattleCommand_Stab:
ldh [hDivisor], a
ld b, 4
call Divide
- ldh a, [hQuotient + 1]
- ld b, a
ldh a, [hQuotient + 2]
+ ld b, a
+ ldh a, [hQuotient + 3]
or b
jr nz, .ok
@@ -1469,7 +1469,7 @@ CheckTypeMatchup:
ld b, 4
call Divide
pop bc
- ldh a, [hQuotient + 2]
+ ldh a, [hQuotient + 3]
ld [wTypeMatchup], a
jr .TypesLoop
@@ -1547,10 +1547,10 @@ BattleCommand_DamageVariation:
call Divide
; ...to get .85-1.00x damage.
- ldh a, [hQuotient + 1]
+ ldh a, [hQuotient + 2]
ld hl, wCurDamage
ld [hli], a
- ldh a, [hQuotient + 2]
+ ldh a, [hQuotient + 3]
ld [hl], a
ret
@@ -1832,14 +1832,14 @@ BattleCommand_CheckHit:
ld b, 4
call Divide
; minimum accuracy is $0001
- ldh a, [hQuotient + 2]
+ ldh a, [hQuotient + 3]
ld b, a
- ldh a, [hQuotient + 1]
+ ldh a, [hQuotient + 2]
or b
jr nz, .min_accuracy
- ldh [hQuotient + 1], a
- ld a, 1
ldh [hQuotient + 2], a
+ ld a, 1
+ ldh [hQuotient + 3], a
.min_accuracy
; do the same thing to the target's evasion
@@ -1848,9 +1848,9 @@ BattleCommand_CheckHit:
jr nz, .accuracy_loop
; if the result is more than 2 bytes, max out at 100%
- ldh a, [hQuotient + 1]
- and a
ldh a, [hQuotient + 2]
+ and a
+ ldh a, [hQuotient + 3]
jr z, .finish_accuracy
ld a, $ff
@@ -2984,7 +2984,7 @@ BattleCommand_DamageCalc:
ld a, e
add a
jr nc, .level_not_overflowing
- ld [hl], $1
+ ld [hl], 1
.level_not_overflowing
inc hl
ld [hli], a
@@ -2993,7 +2993,7 @@ BattleCommand_DamageCalc:
ld a, 5
ld [hld], a
push bc
- ld b, $4
+ ld b, 4
call Divide
pop bc
@@ -3012,7 +3012,7 @@ BattleCommand_DamageCalc:
; / Defense
ld [hl], c
- ld b, $4
+ ld b, 4
call Divide
; / 50
@@ -3146,11 +3146,11 @@ BattleCommand_DamageCalc:
ret z
; x2
- ldh a, [hQuotient + 2]
+ ldh a, [hQuotient + 3]
add a
ldh [hProduct + 3], a
- ldh a, [hQuotient + 1]
+ ldh a, [hQuotient + 2]
rl a
ldh [hProduct + 2], a
@@ -3257,7 +3257,7 @@ BattleCommand_ConstantDamage:
ldh [hMultiplicand + 1], a
ld a, [hli]
ldh [hMultiplicand + 2], a
- ld a, $30
+ ld a, 48
ldh [hMultiplier], a
call Multiply
ld a, [hli]
@@ -3288,7 +3288,7 @@ BattleCommand_ConstantDamage:
.skip_to_divide
ld b, 4
call Divide
- ldh a, [hQuotient + 2]
+ ldh a, [hQuotient + 3]
ld b, a
ld hl, FlailReversalPower
@@ -4918,34 +4918,34 @@ CalcStats:
ld b, 4
call Divide
- ldh a, [hQuotient + 1]
- ld b, a
ldh a, [hQuotient + 2]
+ ld b, a
+ ldh a, [hQuotient + 3]
or b
jr nz, .check_maxed_out
ld a, 1
- ldh [hQuotient + 2], a
+ ldh [hQuotient + 3], a
jr .not_maxed_out
.check_maxed_out
- ldh a, [hQuotient + 2]
+ ldh a, [hQuotient + 3]
cp LOW(MAX_STAT_VALUE)
ld a, b
sbc HIGH(MAX_STAT_VALUE)
jr c, .not_maxed_out
ld a, LOW(MAX_STAT_VALUE)
- ldh [hQuotient + 2], a
+ ldh [hQuotient + 3], a
ld a, HIGH(MAX_STAT_VALUE)
- ldh [hQuotient + 1], a
+ ldh [hQuotient + 2], a
.not_maxed_out
pop bc
- ldh a, [hQuotient + 1]
+ ldh a, [hQuotient + 2]
ld [bc], a
inc bc
- ldh a, [hQuotient + 2]
+ ldh a, [hQuotient + 3]
ld [bc], a
inc bc
pop hl