Insert Crystal audio engine and music

most credit goes to Sanqui
This commit is contained in:
dannye 2017-05-07 15:30:08 -05:00
parent 832c28eaea
commit 87eed68710
586 changed files with 193763 additions and 6447 deletions

View file

@ -955,7 +955,7 @@ EndLowHealthAlarm:
; This function is called when the player has the won the battle. It turns off
; the low health alarm and prevents it from reactivating until the next battle.
xor a
ld [wLowHealthAlarm], a ; turn off low health alarm
ld [wDanger], a ; turn off low health alarm
ld [wChannelSoundIDs + Ch4], a
inc a
ld [wLowHealthAlarmDisabled], a ; prevent it from reactivating
@ -1051,7 +1051,7 @@ PlayBattleVictoryMusic:
ld a, $ff
ld [wNewSoundID], a
call PlaySoundWaitForCurrent
ld c, BANK(Music_DefeatedTrainer)
ld c, 0 ; BANK(Music_DefeatedTrainer)
pop af
call PlayMusic
jp Delay3
@ -1098,11 +1098,11 @@ RemoveFaintedPlayerMon:
predef FlagActionPredef ; clear gain exp flag for fainted mon
ld hl, wEnemyBattleStatus1
res 2, [hl] ; reset "attacking multiple times" flag
ld a, [wLowHealthAlarm]
ld a, [wDanger]
bit 7, a ; skip sound flag (red bar (?))
jr z, .skipWaitForSound
ld a, $ff
ld [wLowHealthAlarm], a ;disable low health alarm
ld [wDanger], a ;disable low health alarm
call WaitForSoundToFinish
.skipWaitForSound
; a is 0, so this zeroes the enemy's accumulated damage.
@ -1949,7 +1949,7 @@ DrawPlayerHUDAndHPBar:
cp HP_BAR_RED
jr z, .setLowHealthAlarm
.fainted
ld hl, wLowHealthAlarm
ld hl, wDanger
bit 7, [hl] ;low health alarm enabled?
ld [hl], $0
ret z
@ -1957,7 +1957,7 @@ DrawPlayerHUDAndHPBar:
ld [wChannelSoundIDs + Ch4], a
ret
.setLowHealthAlarm
ld hl, wLowHealthAlarm
ld hl, wDanger
set 7, [hl] ;enable low health alarm
ret