Game.musicplayer = true --enables mod referencing
------------------------------------------------------------------------------------------
function OnModGameStart_Music_player()
    if Game.factionselection == true then return 0 end
MagicAvailable("ALL_PLAYERS","MUSIC_PLAYER",true,true)
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local music = 0
function Music_player(player,power_kind,power_level,stl_x,stl_y,thing,is_free)
    ClearMessage()
    music = music + 1

    if Game.factionselection == true then
    Music_player_faction(player)
    return 0
    end

        if music==1 or music>9 then  SetMusic("SoftFlute.ogg")           QuickMessage("Soft Flute") music = 1 end
        if music==2 then             SetMusic("DownDeep.ogg")            QuickMessage("Down Deep") end
        if music==3 then             SetMusic("MysticalTunnels.ogg")     QuickMessage("Mystical Tunnels") end
        if music==4 then             SetMusic("ConstructionTime.ogg")    QuickMessage("It's Construction Time!") end
        if music==5 then             SetMusic("GhostlyWaterways.ogg")    QuickMessage("Ghostly Waterways") end
        if music==6 then             SetMusic("TheHornedReaper.ogg")     QuickMessage("The Horned Reaper") end
        if music==7 then             SetMusic("Alpha1.ogg")              QuickMessage("Alpha 1") end
        if music==8 then             SetMusic("Alpha2.ogg")              QuickMessage("Alpha 2") end
        if music==9 then             SetMusic("Alpha3.ogg")              QuickMessage("Alpha 3") end

return 0
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function Music_player_faction(player,power_kind,power_level,stl_x,stl_y,thing,is_free)
--------------------------------------KEEPER/HEROES
    if Game.faction[player] == 1 or Game.faction[player] == 2 then
    if music==1 or music>8 then SetMusic("DK_SoftFlute.ogg")            QuickMessage("Soft Flute") music = 1 end
    if music==2 then            SetMusic("DK_DownDeep.ogg")             QuickMessage("Down Deep") end
    if music==3 then            SetMusic("DK_MysticalTunnels.ogg")      QuickMessage("Mystical Tunnels") end
    if music==4 then            SetMusic("DK_ConstructionTime.ogg")     QuickMessage("It's Construction Time!") end
    if music==5 then            SetMusic("DK_GhostlyWaterways.ogg")     QuickMessage("Ghostly Waterways") end
    if music==6 then            SetMusic("DK_Alpha1.ogg")               QuickMessage("Alpha 1") end
    if music==7 then            SetMusic("DK_Alpha2.ogg")               QuickMessage("Alpha 2") end
    if music==8 then            SetMusic("DK_Alpha3.ogg")               QuickMessage("Alpha 3") end
    end
--------------------------------------DK2 KEEPER/HEROES

--------------------------------------SILENT HILL
--------------------------------------CULTIST
return 0
end