Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. -- 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
  2. -- 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)
  3. function SMB8th:CustomPlay(song)
  4. -- 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.
  5. -- do we ought to be playing or queueing up song right now? (inclusive or)
  6. if (Room:GetType() == RoomType.ROOM_CURSE
  7. or Room:GetType() == RoomType.ROOM_DEFAULT
  8. or Room:GetType() == RoomType.ROOM_DUNGEON
  9. or Room:GetType() == RoomType.ROOM_ISAACS
  10. or Room:GetType() == RoomType.ROOM_BARREN
  11. or Room:GetType() == RoomType.ROOM_DICE
  12. or Room:GetType() == RoomType.ROOM_CHEST
  13. or Room:GetType() == RoomType.ROOM_SACRIFICE
  14. or Room:GetType() == RoomType.ROOM_TREASURE)
  15. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_GAME_OVER
  16. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_GAME_OVER
  17. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS
  18. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_BOSS
  19. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS2
  20. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS_OVER
  21. and MusicManager():GetCurrentMusicID() ~= song
  22. then
  23. -- is the boss over jingle currently playing?
  24. if MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER
  25. or MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER2
  26. then
  27. -- 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.
  28. MusicManager():Queue(Music.MUSIC_BOSS_OVER)
  29. -- by here we know we're going to play song, we just have to decide on whether to queue it or immediately play it.
  30. elseif MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_0
  31. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_1
  32. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_2
  33. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_3
  34. and MusicManager():GetQueuedMusicID() ~= Music.MUSIC_BOSS_OVER
  35. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_SECRETROOM_FIND
  36. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_GAME_START
  37. then
  38. MusicManager():Play(song, 0)
  39. MusicManager():UpdateVolume()
  40. else
  41. MusicManager():Queue(song)
  42. end
  43. end
  44. end
  45.  
  46. function SMB8th:SpecialPlay(song, challenge)
  47. if MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_GAME_OVER
  48. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_GAME_OVER
  49. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS
  50. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_BOSS
  51. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_BOSS2
  52. and SMB8th:MBOCheck(challenge) == false
  53. and MusicManager():GetCurrentMusicID() ~= song
  54. then
  55. -- is the boss over jingle currently playing?
  56. if MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER
  57. or MusicManager():GetCurrentMusicID() == Music.MUSIC_JINGLE_BOSS_OVER2
  58. then
  59. -- 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.
  60. MusicManager():Queue(Music.MUSIC_BOSS_OVER)
  61. -- by here we know we're going to play song, we just have to decide on whether to queue it or immediately play it.
  62. elseif MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_0
  63. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_1
  64. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_2
  65. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_TREASUREROOM_ENTRY_3
  66. and MusicManager():GetQueuedMusicID() ~= Music.MUSIC_BOSS_OVER
  67. and MusicManager():GetCurrentMusicID() ~= Music.MUSIC_JINGLE_SECRETROOM_FIND
  68. and SMB8th:GSCheck(challenge) == false
  69. then
  70. MusicManager():Play(song, 0)
  71. MusicManager():UpdateVolume()
  72. else
  73. MusicManager():Queue(song)
  74. end
  75. end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement