Esempio n. 1
0
 /// <summary>
 /// 点击传送点
 /// </summary>
 /// <param name="info"></param>
 public void OnClickTranspotPoint(MiniMapPointInfo info)
 {
     TargetPathManager.Instance.GoToConstPosition(m_CurSceneId, SceneHelp.Instance.CurLine, info.Position, null, () =>
     {
         isStartPath = false;
     });
 }
Esempio n. 2
0
    /// <summary>
    /// 传送点
    /// </summary>
    /// <returns></returns>
    public static List <MiniMapPointInfo> GetInstanceAllTrasnspot(uint instance_id)
    {
        List <MiniMapPointInfo> map_point_infos = new List <MiniMapPointInfo>();
        var nep_data = xc.Dungeon.LevelManager.Instance.LoadLevelFileTemporary(SceneHelp.GetFirstStageId(instance_id));

        if (nep_data == null)
        {
            GameDebug.LogError("get nep_data failed,instance id: " + instance_id);
            return(map_point_infos);
        }

        var monstersData = nep_data.GetData <Neptune.Collider>().Data;

        foreach (var item in monstersData)
        {
            if (item.Value is Neptune.Collider)
            {
                Neptune.Collider tag = item.Value as Neptune.Collider;
                if (tag.Comment != null && tag.Comment.CompareTo("transfer") == 0)
                {
                    MiniMapPointInfo info = new MiniMapPointInfo();
                    info.Id        = tag.Id;
                    info.MapId     = instance_id;
                    info.Position  = tag.Position;
                    info.PointType = MiniMapPointType.Transfer;
                    map_point_infos.Add(info);
                }
            }
        }
        return(map_point_infos);
    }
Esempio n. 3
0
 /// <summary>
 /// 点击怪物挂机点的按钮
 /// </summary>
 /// <param name="info"></param>
 public void OnClickMonsterPoint(MiniMapPointInfo info)
 {
     MonsterTipsTrigger.gameObject.SetActive(true);
     MonsterTipsTrigger.transform.SetAsLastSibling();
     ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.NEW_MINIMAP_SELECT_MONSTER_MINIMAPINFO, new CEventEventParamArgs("MiniMap", info));
     SetMonsterTipsInfo(info);
 }
Esempio n. 4
0
    /// <summary>
    /// 获得场景中所有npc
    /// </summary>
    /// <returns></returns>
    public static List <MiniMapPointInfo> GetInstanceAllNpc(uint instance_id)
    {
        List <MiniMapPointInfo> map_point_infos = new List <MiniMapPointInfo>();
        var nep_data = xc.Dungeon.LevelManager.Instance.LoadLevelFileTemporary(SceneHelp.GetFirstStageId(instance_id));

        if (nep_data == null)
        {
            GameDebug.LogError("get nep_data failed,instance id: " + instance_id);
            return(map_point_infos);
        }

        Dictionary <int, Neptune.BaseGenericNode> monstersData = nep_data.GetData <Neptune.NPC>().Data;

        foreach (var item in monstersData)
        {
            if (item.Value is Neptune.NPC)
            {
                Neptune.NPC npc = item.Value as Neptune.NPC;
                //if (npc.SpawnDirectly)
                {
                    MiniMapPointInfo info = new MiniMapPointInfo();
                    info.Id        = npc.Id;
                    info.MapId     = instance_id;
                    info.ActorId   = NpcHelper.GetNpcActorId(npc.ExcelId);
                    info.Name      = RoleHelp.GetActorName(info.ActorId);
                    info.BlackName = info.Name;
                    info.Position  = npc.Position;
                    info.PointType = MiniMapPointType.Npc;
                    map_point_infos.Add(info);
                }
            }
        }
        return(map_point_infos);
    }
Esempio n. 5
0
        public void DestroyPoint()
        {
            mCurrentMonsterInfo = null;
            if (mUpdateTeamPosCd != null)
            {
                mUpdateTeamPosCd.Destroy();
                mUpdateTeamPosCd = null;
            }

            UIResourceManager.Instance.DestroyPool(m_TranspotPoint);
            UIResourceManager.Instance.DestroyPool(m_TeamPoint);
            UIResourceManager.Instance.DestroyPool(m_MonsterPoint);
            UIResourceManager.Instance.DestroyPool(m_NpcPoint);
        }
Esempio n. 6
0
        /// <summary>
        /// 响应最佳刷怪点的按钮的点击消息
        /// </summary>
        /// <param name="evt"></param>
        public void MonsterSelectChange(CEventBaseArgs evt)
        {
            if (IsEnable == false)
            {
                return;
            }

            if (evt is CEventEventParamArgs)
            {
                CEventEventParamArgs moreEvt = evt as CEventEventParamArgs;
                string           str         = moreEvt.mMoreParam[0] as string;
                MiniMapPointInfo info        = moreEvt.mMoreParam[1] as MiniMapPointInfo;
                if (str.CompareTo("MiniMap") != 0)// 不是Minimap的时候,显示怪物挂机的提示框
                {
                    MonsterTipsTrigger.gameObject.SetActive(true);
                    MonsterTipsTrigger.transform.SetAsLastSibling();
                    SetMonsterTipsInfo(info);
                }
            }
        }
Esempio n. 7
0
        public override void InitBehaviour()
        {
            m_LocalPlayerPoint = Window.FindChild("LocalPlayerPoint");
            m_MonsterPoint     = Window.FindChild("MonsterPoint");
            m_TranspotPoint    = Window.FindChild("TranspotPoint");
            m_NpcPoint         = Window.FindChild("NpcPoint");
            m_TeamPoint        = Window.FindChild("TeamPlayerPoint");

            mMiniMapRawImage         = Window.FindChild <RawImage>("MapTexture");
            MonsterLineObj           = Window.FindChild("MonsterLine");
            mEndPathGo               = Window.FindChild("EndPathPoint");
            mMiniMapRawImage.enabled = false;
            mMapScroll               = Window.FindChild <ScrollRect>("MapScrollView");
            m_MonsterInfo            = Window.FindChild("MonsterInfo");
            mPathPointRectTemplate   = Window.FindChild <RectTransform>("PathPoint");
            m_GotoBtn = Window.FindChild <Button>("GotoBtn");
            m_GotoBtn.onClick.AddListener(OnClickGotoMonster);
            mCurrentMonsterInfo = null;
            MonsterTipsTrigger  = EventTriggerListener.GetListener(Window.FindChild("MonsterTips"));
            MonsterTipsTrigger.onPointerDown += LostMonsterTips;
            MonsterTipsTrigger.gameObject.SetActive(false);
            mPathPointRectTemplate.gameObject.SetActive(false);
            mEndPathGo.SetActive(false);
            UIResourceManager.Instance.InitPool(m_MonsterPoint, 5);
            UIResourceManager.Instance.InitPool(m_TranspotPoint, 3);
            UIResourceManager.Instance.InitPool(m_NpcPoint, 3);
            UIResourceManager.Instance.InitPool(m_TeamPoint, 2);
            UIResourceManager.Instance.InitPool(mPathPointRectTemplate.gameObject, 5);
            ClientEventMgr.Instance.SubscribeClientEvent((int)ClientEvent.TASK_CHANGED, UpdateNpcState);
            ClientEventMgr.Instance.SubscribeClientEvent((int)ClientEvent.CE_TEAM_INFO_CHANGED, UpdateRequsetTeam);
            ClientEventMgr.Instance.SubscribeClientEvent((int)ClientEvent.NEW_MINIMAP_SELECT_MONSTER_MINIMAPINFO, MonsterSelectChange);
            ClientEventMgr.Instance.SubscribeClientEvent((int)ClientEvent.CE_ACTOR_PATH_POINTS_CHANGED, OnWalkPathChange);
            ClientEventMgr.Instance.SubscribeClientEvent((int)ClientEvent.CE_MINI_MAP_COM_POS, ClickMiniMapPos);
            ClientEventMgr.Instance.SubscribeClientEvent((int)xc.ClientEvent.CE_WORLD_BOSS_UPDATE_BOSS_INFO_ALL, UpdateWorldBossState);
            Game.GetInstance().SubscribeNetNotify(NetMsg.MSG_TEAM_MEMBER_POS, UpdateTeam);
            base.InitBehaviour();
        }
Esempio n. 8
0
        public void ClearPoint()
        {
            mCurrentMonsterInfo = null;
            if (mUpdateTeamPosCd != null)
            {
                mUpdateTeamPosCd.Destroy();
                mUpdateTeamPosCd = null;
            }

            ClearTeamPoint();

            if (mMonsterListPointObjs.Count > 0)
            {
                foreach (var kv in mMonsterListPointObjs)
                {
                    UIResourceManager.Instance.ReturnObjectToPool(kv.Value);
                }
                mMonsterListPointObjs.Clear();
            }
            if (mTranspotListPointObjs.Count > 0)
            {
                for (int i = 0; i < mTranspotListPointObjs.Count; i++)
                {
                    UIResourceManager.Instance.ReturnObjectToPool(mTranspotListPointObjs[i]);
                }
                mTranspotListPointObjs.Clear();
            }

            if (mNpcListPointObjs.Count > 0)
            {
                foreach (var kv in mNpcListPointObjs)
                {
                    UIResourceManager.Instance.ReturnObjectToPool(kv.Value);
                }
                mNpcListPointObjs.Clear();
            }
        }
Esempio n. 9
0
 public void OnClickNpcPoint(MiniMapPointInfo info)
 {
     TargetPathManager.Instance.GoToNpcPos(info.MapId, (uint)info.Id, null);
     UIManager.Instance.CloseSysWindow("UIMapWindow");
 }
Esempio n. 10
0
        /// <summary>
        /// 设置怪物挂架的tips
        /// </summary>
        /// <param name="info"></param>
        public void SetMonsterTipsInfo(MiniMapPointInfo info)
        {
            mCurrentMonsterInfo = info;
            string key = string.Format("{0}_{1}", info.Tag, m_CurSceneId);

            // F副本.xlsx -- 刷怪点信息
            var data_actor_tag = DBManager.Instance.QuerySqliteRow <string>(GlobalConfig.DBFile, "data_actor_tag", "csv_id", key);


            //服务端不建议改表格式
            //List<Dictionary<string, string>> data_actor_tag = null;
            //string key = string.Empty;
            //SDKConfig sdk_config = SDKHelper.GetSDKConfig();
            //if (sdk_config != null && SDKHelper.IsCopyBag() && AuditManager.Instance.Open)
            //{
            //    key = string.Format("{0}_{1}{2}", info.Tag, m_CurSceneId, sdk_config.SDKNamePrefix);
            //    data_actor_tag = DBManager.Instance.QuerySqliteRow<string>(GlobalConfig.DBFile, "data_actor_tag", "csv_id", key);
            //}

            ////当对应的马甲包没配置对应的数据时,就直接用正式数据
            //if (data_actor_tag == null || data_actor_tag.Count == 0)
            //{
            //    key = string.Format("{0}_{1}", info.Tag, m_CurSceneId);// 唯一id由{tag_id}_{map_id}组成
            //    data_actor_tag = DBManager.Instance.QuerySqliteRow<string>(GlobalConfig.DBFile, "data_actor_tag", "csv_id", key);
            //}



            string titlestr   = string.Empty;
            string contentstr = string.Empty;

            if (info.PointType != MiniMapPointType.Boss) // 普通怪物
            {
                if (data_actor_tag.Count > 0)
                {
                    var  table = data_actor_tag[0];
                    uint level = DBTextResource.ParseUI(table["min_level"]);

                    string levelDesc = string.Empty;
                    uint   peakLevel = 0;
                    bool   isPeak    = TransferHelper.IsPeak(level, out peakLevel);
                    if (isPeak)
                    {
                        var fmt = DBConstText.GetText("UI_PLAYER_PEAK_LEVEL_FORMAT"); // 巅峰{0}级
                        levelDesc = string.Format(fmt, peakLevel);
                    }
                    else
                    {
                        var fmt = DBConstText.GetText("UI_PLAYER_LEVEL_FORMAT"); // {0}级
                        levelDesc = string.Format(fmt, peakLevel);
                    }

                    uint   def  = DBTextResource.ParseUI(table["min_def"]);
                    string _def = string.Empty;
                    if (LocalPlayerManager.Instance.Level < level)
                    {
                        levelDesc = string.Format(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_108"), GameConst.COLOR_DARK_RED, levelDesc);
                    }
                    else
                    {
                        levelDesc = string.Format(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_108"), GameConst.COLOR_DARK_GREEN, levelDesc);
                    }

                    var Def = LocalPlayerManager.Instance.LocalActorAttribute.Attribute[GameConst.AR_DEF].Value;
                    if (Def < def)
                    {
                        _def = string.Format(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_109"), GameConst.COLOR_DARK_RED, def);
                    }
                    else
                    {
                        _def = string.Format(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_109"), GameConst.COLOR_DARK_GREEN, def);
                    }

                    titlestr = levelDesc + _def;

                    StringBuilder award_desc = new StringBuilder(150);
                    award_desc.AppendFormat(xc.TextHelper.GetTranslateText(table["tips1_format"]), table["tips1"]);
                    award_desc.Append('\n');
                    award_desc.AppendFormat(xc.TextHelper.GetTranslateText(table["tips2_format"]), table["tips2"]);
                    award_desc.Append('\n');
                    award_desc.AppendFormat(xc.TextHelper.GetTranslateText(table["tips3_format"]), table["tips3"]);

                    contentstr = award_desc.ToString();
                }
                else
                {
                    titlestr   = string.Format(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_110"));
                    contentstr = string.Format(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_111"));;
                }
            }
            else
            {
                if (GlobalConst.IsBanshuVersion)
                {
                    titlestr = string.Format(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_112"), GameConst.COLOR_DARK_RED, info.BlackName, info.Level);
                }
                else
                {
                    titlestr = string.Format("{0}{1} Lv{2}</color>", GameConst.COLOR_DARK_RED, info.BlackName, info.Level);
                }

                uint actorId = (uint)info.ActorId;

                bool isSouthLandBoss   = ActorHelper.IsSouthLandBoss(actorId);   // 南天圣地boss
                bool isElementAreaBoss = ActorHelper.IsElementAreaBoss(actorId); // 元素禁地boss
                if (isSouthLandBoss || isElementAreaBoss)
                {
                    // 浊气值
                    uint evilValue = 0;

                    if (isSouthLandBoss)
                    {
                        var evilItem = DBManager.Instance.GetDB <DBEvilValue>().GetData(actorId);
                        if (null != evilItem)
                        {
                            evilValue = evilItem.Value;
                        }
                    }
                    else
                    {
                        var evilItem = DBManager.Instance.GetDB <DBElementAreaEvilValue>().GetData(actorId);
                        if (null != evilItem)
                        {
                            evilValue = evilItem.Value;
                        }
                    }

                    string strEvilValue = DBConstText.GetText("SOUTH_LAND_EVIL_VALUE"); // 浊气值:
                    titlestr = string.Format("{0}\n{1}{2}{3}</color>", titlestr, strEvilValue, GameConst.COLOR_DARK_YELLOW, evilValue);
                }

                if (data_actor_tag.Count > 0)
                {
                    var           table      = data_actor_tag[0];
                    StringBuilder award_desc = new StringBuilder(150);
                    award_desc.AppendFormat(xc.TextHelper.GetTranslateText(table["tips1_format"]), table["tips1"]);
                    award_desc.Append('\n');
                    award_desc.AppendFormat(xc.TextHelper.GetTranslateText(table["tips2_format"]), table["tips2"]);
                    award_desc.Append('\n');
                    award_desc.AppendFormat(xc.TextHelper.GetTranslateText(table["tips3_format"]), table["tips3"]);

                    contentstr = award_desc.ToString();
                }
            }

            Text title   = UIHelper.FindChild(m_MonsterInfo, "TitleText").GetComponent <Text>();
            Text content = UIHelper.FindChild(m_MonsterInfo, "Content").GetComponent <Text>();

            title.text   = titlestr;
            content.text = contentstr;
            GameObject monster_point;

            if (mMonsterListPointObjs.TryGetValue(mCurrentMonsterInfo.Id, out monster_point))
            {
                m_MonsterInfo.transform.localPosition = GetTipsPos(monster_point);
                float y = mMapScroll.viewport.rect.height / 2 - monster_point.transform.localPosition.y;
                float x = mMapScroll.viewport.rect.width / 2 - monster_point.transform.localPosition.x;
                mMiniMapRawImage.rectTransform.anchoredPosition = new Vector2(x, y);
            }
        }
Esempio n. 11
0
    /// <summary>
    /// 获取指定副本中标记的普通刷怪点和特殊怪物点
    /// </summary>
    /// <returns></returns>
    public static List <MiniMapPointInfo> GetInstanceAllNormalMonster(uint instance_id)
    {
        List <MiniMapPointInfo> map_point_infos = new List <MiniMapPointInfo>();
        var nep_data = xc.Dungeon.LevelManager.Instance.LoadLevelFileTemporary(SceneHelp.GetFirstStageId(instance_id));

        if (nep_data == null)
        {
            GameDebug.LogError("get nep_data failed,instance id: " + instance_id);
            return(map_point_infos);
        }

        Dictionary <int, Neptune.BaseGenericNode> all_node_data = nep_data.GetData <Neptune.Tag>().Data;  // 获取关卡中所有标记为Tag的物体数据
        var special_monster_info = DBManager.Instance.GetDB <DBSpecialMon>().GetDungeonData(instance_id); // 获取当前副本中特殊怪物的数据(世界boss,盗宝怪)

        foreach (var item in all_node_data)
        {
            Neptune.Tag tag = item.Value as Neptune.Tag;
            if (tag == null || tag.Type == null)
            {
                continue;
            }

            if (tag.Type.CompareTo("map_mon_pos") == 0)// Tag 为怪物标识点
            {
                MiniMapPointInfo info = new MiniMapPointInfo();
                info.Id       = tag.Id;
                info.Tag      = tag.Id;
                info.Position = tag.Position;
                info.MapId    = instance_id;
                string key            = string.Format("{0}_{1}", tag.Id, instance_id);// 唯一id由{tag_id}_{map_id}组成
                var    data_actor_tag = DBManager.Instance.QuerySqliteRow <string>(GlobalConfig.DBFile, "data_actor_tag", "csv_id", key);


                //服务端不建议改表格式
                //List<Dictionary<string, string>> data_actor_tag = null;
                //string key = string.Empty;
                //SDKConfig sdk_config = SDKHelper.GetSDKConfig();
                //if (sdk_config != null && SDKHelper.IsCopyBag() && AuditManager.Instance.Open)
                //{
                //    key = string.Format("{0}_{1}{2}", tag.Id, instance_id, sdk_config.SDKNamePrefix);
                //    data_actor_tag = DBManager.Instance.QuerySqliteRow<string>(GlobalConfig.DBFile, "data_actor_tag", "csv_id", key);
                //}


                ////当对应的马甲包没配置对应的数据时,就直接用正式数据
                //if (data_actor_tag == null || data_actor_tag.Count == 0)
                //{
                //    key = string.Format("{0}_{1}", tag.Id, instance_id);// 唯一id由{tag_id}_{map_id}组成
                //    data_actor_tag = DBManager.Instance.QuerySqliteRow<string>(GlobalConfig.DBFile, "data_actor_tag", "csv_id", key);
                //}



                if (data_actor_tag.Count > 0)
                {
                    var table = data_actor_tag[0];
                    info.ActorId      = DBTextResource.ParseUI(table["actor_id"]);
                    info.ListNeedShow = DBTextResource.ParseUI(table["need_show"]) == 1 ? true : false;

                    if (ActorHelper.IsEliteMonster(info.ActorId))// 判断怪物是否是精英怪
                    {
                        info.PointType = MiniMapPointType.EliteMonster;
                    }
                    else
                    {
                        info.PointType = MiniMapPointType.Monster;
                    }

                    info.Name      = ActorHelper.GetColorNameDiff(info.ActorId, 0);
                    info.BlackName = ActorHelper.GetColorNameDiff(info.ActorId, 1);
                    info.Level     = ActorHelper.GetActorLevel(info.ActorId);
                    map_point_infos.Add(info);
                }
            }
            else if (tag.Type.CompareTo("boss_pos") == 0 && special_monster_info != null)
            {
                //boss读表
                string tagGroup = "boss_pos_" + tag.Id;
                DBSpecialMon.DBSpecialMonItem boss = special_monster_info.Find(delegate(DBSpecialMon.DBSpecialMonItem specialMon)
                {
                    return(specialMon.TagGroup.CompareTo(tagGroup) == 0);
                });

                if (boss != null)
                {
                    MiniMapPointInfo info = new MiniMapPointInfo();
                    info.Id        = (int)boss.Id;
                    info.Tag       = tag.Id;
                    info.Position  = tag.Position;
                    info.MapId     = instance_id;
                    info.ActorId   = boss.ActorId;
                    info.Name      = ActorHelper.GetColorNameDiff(info.ActorId, 0);
                    info.BlackName = ActorHelper.GetColorNameDiff(info.ActorId, 1);
                    info.Level     = ActorHelper.GetActorLevel(info.ActorId);
                    info.PointType = MiniMapPointType.Boss;

                    map_point_infos.Add(info);
                }
            }
        }
        return(map_point_infos);
    }