Misc clean up and small improvements

This commit is contained in:
dannye 2021-03-28 02:23:54 -05:00
parent e8dd755e18
commit 459b5bd615
25 changed files with 326 additions and 160 deletions

View file

@ -2618,7 +2618,7 @@ PlayApplyingAttackSound:
; play a different sound depending if move is not very effective, neutral, or super-effective
; don't play any sound at all if move is ineffective
call WaitForSoundToFinish
ld a, [wDamageMultipliers] ; effectiveness
ld a, [wDamageMultipliers]
and $7f
ret z
cp 10

View file

@ -865,7 +865,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 [wDanger], a ; turn off low health alarm
ld [wLowHealthAlarm], a ; turn off low health alarm
ld [wChannelSoundIDs + Ch5], a
inc a
ld [wLowHealthAlarmDisabled], a ; prevent it from reactivating
@ -1008,11 +1008,11 @@ RemoveFaintedPlayerMon:
predef FlagActionPredef ; clear gain exp flag for fainted mon
ld hl, wEnemyBattleStatus1
res 2, [hl] ; reset "attacking multiple times" flag
ld a, [wDanger]
ld a, [wLowHealthAlarm]
bit 7, a ; skip sound flag (red bar (?))
jr z, .skipWaitForSound
ld a, $ff
ld [wDanger], a ;disable low health alarm
ld [wLowHealthAlarm], a ;disable low health alarm
call WaitForSoundToFinish
.skipWaitForSound
; a is 0, so this zeroes the enemy's accumulated damage.
@ -1859,7 +1859,7 @@ DrawPlayerHUDAndHPBar:
cp HP_BAR_RED
jr z, .setLowHealthAlarm
.fainted
ld hl, wDanger
ld hl, wLowHealthAlarm
bit 7, [hl] ;low health alarm enabled?
ld [hl], $0
ret z
@ -1867,7 +1867,7 @@ DrawPlayerHUDAndHPBar:
ld [wChannelSoundIDs + Ch5], a
ret
.setLowHealthAlarm
ld hl, wDanger
ld hl, wLowHealthAlarm
set 7, [hl] ;enable low health alarm
ret

View file

@ -45,7 +45,7 @@ EndOfBattle:
predef EvolutionAfterBattle
.resetVariables
xor a
ld [wDanger], a ;disable low health alarm
ld [wLowHealthAlarm], a ;disable low health alarm
ld [wChannelSoundIDs + Ch5], a
ld [wIsInBattle], a
ld [wBattleType], a

View file

@ -990,7 +990,7 @@ ItemUseMedicine:
jp .cureStatusAilment
.notFullHP ; if the pokemon's current HP doesn't equal its max HP
xor a
ld [wDanger], a ;disable low health alarm
ld [wLowHealthAlarm], a ;disable low health alarm
ld [wChannelSoundIDs + Ch5], a
push hl
push de
@ -1731,7 +1731,7 @@ ItemUsePokeflute:
; if some pokemon were asleep
ld hl, PlayedFluteHadEffectText
call PrintText
ld a, [wDanger]
ld a, [wLowHealthAlarm]
and $80
jr nz, .skipMusic
call WaitForSoundToFinish ; wait for sound to end

View file

@ -7,7 +7,7 @@ EvolveMon:
ld a, [wd0b5]
push af
xor a
ld [wDanger], a
ld [wLowHealthAlarm], a
ld [wChannelSoundIDs + Ch5], a
dec a ; SFX_STOP_ALL_MUSIC
ld [wNewSoundID], a

View file

@ -131,11 +131,15 @@ OakSpeech:
ld a, 0 ; BANK(Music_PalletTown)
ld [wAudioROMBank], a
ld [wAudioSavedROMBank], a
ld a, 10
ld [wAudioFadeOutControl], a
ld a, SFX_STOP_ALL_MUSIC
ld [wNewSoundID], a
call PlaySound
call StopMusic
; ld a, 10
; ld [wAudioFadeOutControl], a
; ld a, SFX_STOP_ALL_MUSIC
; ld [wNewSoundID], a
; call PlaySound
pop af
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a

View file

@ -182,9 +182,6 @@ ENDC
ret
.finishedBouncingPokemonLogo
xor a
ldh [hSCY], a
call LoadScreenTilesFromBuffer1
ld c, 36
call DelayFrames

View file

@ -1,7 +1,4 @@
AnimateHealingMachine:
xor a
call PlayMusic
ld de, PokeCenterFlashingMonitorAndHealBall
ld hl, vChars0 tile $7c
lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), 3 ; should be 2
@ -19,6 +16,9 @@ AnimateHealingMachine:
ld de, PokeCenterOAMData
call CopyHealingMachineOAM
ld a, 4
call StopMusic
call WaitForSongToFinish
; ld a, 4
; ld [wAudioFadeOutControl], a
; ld a, SFX_STOP_ALL_MUSIC