2018-06-24 07:09:41 -07:00
|
|
|
BattleCommand_FrustrationPower:
|
2018-01-26 08:36:00 -08:00
|
|
|
; frustrationpower
|
|
|
|
|
|
|
|
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
|
|
|
|
jr z, .got_happiness
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wEnemyMonHappiness
|
2018-01-26 08:36:00 -08:00
|
|
|
.got_happiness
|
|
|
|
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
|