#-----------------------------------------------------------------------------
# * Autoplays background music
# Plays music called "[normal BGM]n" if it's night time and it exists
#-----------------------------------------------------------------------------
def autoplayAsCue
if @map.autoplay_bgm
if PBDayNight.isNight?(pbGetTimeNow) &&
FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "n")
pbCueBGM(@map.bgm.name+"n",1.0,@map.bgm.volume,@map.bgm.pitch)
end
if PBDayNight.isAfternoon?(pbGetTimeNow) &&
FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "a")
pbCueBGM(@map.bgm.name+"a",1.0,@map.bgm.volume,@map.bgm.pitch)
end
if PBDayNight.isMorning?(pbGetTimeNow) &&
FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "m")
pbCueBGM(@map.bgm.name+"m",1.0,@map.bgm.volume,@map.bgm.pitch)
end
if PBDayNight.isNight?(pbGetTimeNow) &&
!FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "n")
pbCueBGM(@map.bgm,1.0)
end
if PBDayNight.isAfternoon?(pbGetTimeNow) &&
!FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "a")
pbCueBGM(@map.bgm,1.0)
end
if PBDayNight.isMorning?(pbGetTimeNow) &&
!FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "m")
pbCueBGM(@map.bgm,1.0)
end
if PBDayNight.isDay?(pbGetTimeNow) &&
!PBDayNight.isMorning?(pbGetTimeNow) &&
!PBDayNight.isAfternoon?(pbGetTimeNow)
pbCueBGM(@map.bgm,1.0)
end
end
if @map.autoplay_bgs
pbBGSPlay(@map.bgs)
end
end
#-----------------------------------------------------------------------------
# * Plays background music
# Plays music called "[normal BGM]n" if it's night time and it exists
#-----------------------------------------------------------------------------
def autoplay
if @map.autoplay_bgm
if PBDayNight.isNight?(pbGetTimeNow) &&
FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "n")
pbBGMPlay(@map.bgm.name+"n",@map.bgm.volume,@map.bgm.pitch)
end
if PBDayNight.isMorning?(pbGetTimeNow) &&
FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "m")
pbBGMPlay(@map.bgm.name+"m",@map.bgm.volume,@map.bgm.pitch)
end
if PBDayNight.isAfternoon?(pbGetTimeNow) &&
FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "a")
pbBGMPlay(@map.bgm.name+"a",@map.bgm.volume,@map.bgm.pitch)
end
if PBDayNight.isAfternoon?(pbGetTimeNow) &&
!FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "a")
pbBGMPlay(@map.bgm)
end
if PBDayNight.isMorning?(pbGetTimeNow) &&
!FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "m")
pbBGMPlay(@map.bgm)
end
if PBDayNight.isNight?(pbGetTimeNow) &&
!FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "n")
pbBGMPlay(@map.bgm)
end
if PBDayNight.isDay?(pbGetTimeNow) &&
!PBDayNight.isMorning?(pbGetTimeNow) &&
!PBDayNight.isAfternoon?(pbGetTimeNow)
pbBGMPlay(@map.bgm)
end
end
if @map.autoplay_bgs
pbBGSPlay(@map.bgs)
end
end