예제 #1
0
    int GetEnvironmentBgMusic()
    {
        if (VCEditor.s_Active)
        {
            return(CreationMusicID);
        }
        else
        {
            PeEntity player = PeCreature.Instance.mainPlayer;
            if (player != null)
            {
                if (CSMain.Instance != null && CSMain.Instance.IsInAssemblyArea(player.position))
                {
                    return(PlayerBaseMusicID);
                }
                else
                {
                    if (PeGameMgr.IsAdventure)
                    {
                        if (RandomDunGenUtil.IsInDungeon(player))
                        {
                            if (RandomDunGenUtil.GetDungeonType() == DungeonType.Iron)
                            {
                                return(DungeonIronMusicID);
                            }
                            else
                            {
                                return(DungeonCaveMusicID);
                            }
                        }
                        else if (VArtifactUtil.IsInNativeCampArea(player.position) >= 0)
                        {
                            return(NativeBaseMusicID);
                        }
                    }

                    if (PeGameMgr.IsStory)
                    {
                        int soundID = PeMap.StaticPoint.Mgr.Instance.GetMapSoundID(player.position);
                        if (soundID > 0)
                        {
                            return(soundID);
                        }
                    }
                }
            }
        }

        return(0);
    }