Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- these functions are used for adding music to areas that normally play music we've snipped out of the music.xml, or areas that don't know how to play their own musics
- -- replace floor music (unique utero, unique greed mode, stuff that's been snipped out of the music.xml so unique utero and unique greed mode work)
- function SMB8th:CustomPlay(song)
- -- this part uses heavily modified code from "unique utero theme" by marty flymac, used for pretty much everything that can have a custom theme. (thx marty!) i modified this to 1. allow certain jingles to play fully instead of being cut off, 2. allow the themes to properly play after you quit and continue the game, 3. fix the song overriding the boss tune if greed is summoned from bombing a special shopkeeper, and 4. look prettier.
- -- do we ought to be playing or queueing up song right now? (inclusive or)
- if (Room:GetType() == RoomType.ROOM_CURSE
- or Room:GetType() == RoomType.ROOM_DEFAULT
- or Room:GetType() == RoomType.ROOM_DUNGEON
- or Room:GetType() == RoomType.ROOM_ISAACS
- or Room:GetType() == RoomType.ROOM_BARREN
- or Room:GetType() == RoomType.ROOM_DICE
- or Room:GetType() == RoomType.ROOM_CHEST
- or Room:GetType() == RoomType.ROOM_SACRIFICE
- or Room:GetType() == RoomType.ROOM_TREASURE)
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_GAME_OVER
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_GAME_OVER
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_BOSS
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS2
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS_OVER
- and MusicManager():GetCurrentMusicID() ~= song
- then
- -- is the boss over jingle currently playing?
- if MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER
- or MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER2
- then
- -- boss over music can, in fact, play in a normal room, if greed is summoned via bombing a special shopkeeper and then defeated. also, greed mode. duh.
- MusicManager():Queue(Music.MUSIC_BOSS_OVER)
- -- by here we know we're going to play song, we just have to decide on whether to queue it or immediately play it.
- elseif MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_0
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_1
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_2
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_3
- and MusicManager():GetQueuedMusicID() ~= Music.MUSIC_BOSS_OVER
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_SECRETROOM_FIND
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_GAME_START
- then
- MusicManager():Play(song, 0)
- MusicManager():UpdateVolume()
- else
- MusicManager():Queue(song)
- end
- end
- end
- function SMB8th:SpecialPlay(song, challenge)
- if MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_GAME_OVER
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_GAME_OVER
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_BOSS
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS2
- and SMB8th:MBOCheck(challenge) == false
- and MusicManager():GetCurrentMusicID() ~= song
- then
- -- is the boss over jingle currently playing?
- if MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER
- or MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER2
- then
- -- boss over music can, in fact, play in a normal room, if greed is summoned via bombing a special shopkeeper and then defeated. also, greed mode. duh.
- MusicManager():Queue(Music.MUSIC_BOSS_OVER)
- -- by here we know we're going to play song, we just have to decide on whether to queue it or immediately play it.
- elseif MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_0
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_1
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_2
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_3
- and MusicManager():GetQueuedMusicID() ~= Music.MUSIC_BOSS_OVER
- and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_SECRETROOM_FIND
- and SMB8th:GSCheck(challenge) == false
- then
- MusicManager():Play(song, 0)
- MusicManager():UpdateVolume()
- else
- MusicManager():Queue(song)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement