mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00

This adds the Mega Punch & Mega Kick guys from FireRed and LeafGreen. Given Mega Punch was in Mt. Moon, and GF replaced it with Thief in FRLG, I decided to change the TM to the Wing Fossil, which currently isn't obtainable outside of Mt. Moon Crater.
46 lines
762 B
NASM
46 lines
762 B
NASM
PayDayEffect_: ; Pay Day money calculation
|
|
xor a
|
|
ld hl, wcd6d
|
|
ld [hli], a
|
|
ldh a, [hWhoseTurn]
|
|
and a
|
|
ld a, [wBattleMonLevel]
|
|
jr z, .payDayEffect
|
|
ld a, [wEnemyMonLevel]
|
|
.payDayEffect ; what
|
|
; level * 2
|
|
add a
|
|
ldh [hDividend + 3], a
|
|
xor a
|
|
ldh [hDividend], a
|
|
ldh [hDividend + 1], a
|
|
ldh [hDividend + 2], a
|
|
; convert to BCD
|
|
ld a, 100
|
|
ldh [hDivisor], a
|
|
ld b, $4
|
|
call Divide
|
|
ldh a, [hQuotient + 3]
|
|
ld [hli], a
|
|
ldh a, [hRemainder]
|
|
ldh [hDividend + 3], a
|
|
ld a, 10
|
|
ldh [hDivisor], a
|
|
ld b, $4
|
|
call Divide
|
|
ldh a, [hQuotient + 3]
|
|
swap a
|
|
ld b, a
|
|
ldh a, [hRemainder]
|
|
add b
|
|
ld [hl], a
|
|
ld de, wTotalPayDayMoney + 2
|
|
ld c, $3
|
|
predef AddBCDPredef
|
|
ld hl, CoinsScatteredText
|
|
jp PrintText
|
|
|
|
CoinsScatteredText:
|
|
text_far _CoinsScatteredText
|
|
text_end
|