2018-06-24 14:09:41 +00:00
|
|
|
BattleCommand_FrustrationPower:
|
2018-01-26 16:36:00 +00:00
|
|
|
; frustrationpower
|
|
|
|
|
|
|
|
push bc
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wBattleMonHappiness
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 16:36:00 +00:00
|
|
|
and a
|
|
|
|
jr z, .got_happiness
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wEnemyMonHappiness
|
2018-01-26 16:36:00 +00:00
|
|
|
.got_happiness
|
|
|
|
ld a, $ff
|
|
|
|
sub [hl]
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hMultiplicand + 2], a
|
2018-01-26 16:36:00 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hMultiplicand + 0], a
|
|
|
|
ldh [hMultiplicand + 1], a
|
2018-01-26 16:36:00 +00:00
|
|
|
ld a, 10
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hMultiplier], a
|
2018-01-26 16:36:00 +00:00
|
|
|
call Multiply
|
|
|
|
ld a, 25
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hDivisor], a
|
2018-01-26 16:36:00 +00:00
|
|
|
ld b, 4
|
|
|
|
call Divide
|
2018-08-26 17:49:38 +00:00
|
|
|
ldh a, [hQuotient + 3]
|
2018-01-26 16:36:00 +00:00
|
|
|
ld d, a
|
|
|
|
pop bc
|
|
|
|
ret
|