2018-06-24 14:09:41 +00:00
|
|
|
BattleCommand_PsychUp:
|
2018-01-26 16:36:00 +00:00
|
|
|
; psychup
|
|
|
|
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wEnemyStatLevels
|
|
|
|
ld de, wPlayerStatLevels
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 16:36:00 +00:00
|
|
|
and a
|
|
|
|
jr z, .pointers_correct
|
|
|
|
; It's the enemy's turn, so swap the pointers.
|
|
|
|
push hl
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
pop de
|
|
|
|
.pointers_correct
|
|
|
|
push hl
|
|
|
|
ld b, NUM_LEVEL_STATS
|
|
|
|
; If any of the enemy's stats is modified from its base level,
|
|
|
|
; the move succeeds. Otherwise, it fails.
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
cp BASE_STAT_LEVEL
|
|
|
|
jr nz, .break
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
pop hl
|
|
|
|
call AnimateFailedMove
|
|
|
|
jp PrintButItFailed
|
|
|
|
|
|
|
|
.break
|
|
|
|
pop hl
|
|
|
|
ld b, NUM_LEVEL_STATS
|
|
|
|
.loop2
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec b
|
|
|
|
jr nz, .loop2
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 16:36:00 +00:00
|
|
|
and a
|
|
|
|
jr nz, .calc_enemy_stats
|
|
|
|
call CalcPlayerStats
|
|
|
|
jr .merge
|
|
|
|
|
|
|
|
.calc_enemy_stats
|
|
|
|
call CalcEnemyStats
|
|
|
|
.merge
|
|
|
|
call AnimateCurrentMove
|
|
|
|
ld hl, CopiedStatsText
|
2019-04-08 12:15:10 +00:00
|
|
|
jp StdBattleTextbox
|