shithub: pokecrystal

ref: 159a0ef7b451159dd75384e4a2121b85a25e277d
dir: /engine/battle/move_effects/pay_day.asm/

View raw version
BattleCommand_PayDay: ; 3705c
; payday

	xor a
	ld hl, wStringBuffer1
	ld [hli], a

	ld a, [hBattleTurn]
	and a
	ld a, [wBattleMonLevel]
	jr z, .ok
	ld a, [wEnemyMonLevel]
.ok

	add a
	ld hl, wPayDayMoney + 2
	add [hl]
	ld [hld], a
	jr nc, .done
	inc [hl]
	dec hl
	jr nz, .done
	inc [hl]
.done
	ld hl, CoinsScatteredText
	jp StdBattleTextBox

; 3707f