2018-06-24 07:09:41 -07:00
|
|
|
BattleCommand_FrustrationPower:
|
2022-07-09 14:12:02 -07:00
|
|
|
; BUG: Return and Frustration deal no damage when the user's happiness is low or high, respectively (see docs/bugs_and_glitches.md)
|
2018-01-26 08:36:00 -08:00
|
|
|
push bc
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wBattleMonHappiness
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 08:36:00 -08:00
|
|
|
and a
|
2022-01-24 17:48:21 -08:00
|
|
|
jr z, .ok
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wEnemyMonHappiness
|
2022-01-24 17:48:21 -08:00
|
|
|
.ok
|
2018-01-26 08:36:00 -08:00
|
|
|
ld a, $ff
|
|
|
|
sub [hl]
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMultiplicand + 2], a
|
2018-01-26 08:36:00 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMultiplicand + 0], a
|
|
|
|
ldh [hMultiplicand + 1], a
|
2018-01-26 08:36:00 -08:00
|
|
|
ld a, 10
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMultiplier], a
|
2018-01-26 08:36:00 -08:00
|
|
|
call Multiply
|
|
|
|
ld a, 25
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hDivisor], a
|
2018-01-26 08:36:00 -08:00
|
|
|
ld b, 4
|
|
|
|
call Divide
|
2018-08-26 10:49:38 -07:00
|
|
|
ldh a, [hQuotient + 3]
|
2018-01-26 08:36:00 -08:00
|
|
|
ld d, a
|
|
|
|
pop bc
|
|
|
|
ret
|