Beispiel #1
0
        /// <summary>
        /// 获取boss角色id列表
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        static public List <uint> GetBossMonsterList(Neptune.Data data = null)
        {
            if (data == null)
            {
                data = Neptune.DataManager.Instance.Data;
            }
            Dictionary <int, Neptune.BaseGenericNode> monsters = data.GetData <Neptune.MonsterBase>().Data;

            List <uint> actorIdList = new List <uint>();

            actorIdList.Clear();
            if (monsters != null)
            {
                foreach (var monsterBase in monsters.Values)
                {
                    if (monsterBase is Neptune.Monster)
                    {
                        Neptune.Monster monster = (Neptune.Monster)monsterBase;
                        if (ActorHelper.IsBoss(monster.ExcelId) == true)
                        {
                            actorIdList.Add(monster.ExcelId);
                        }
                    }
                }
            }

            return(actorIdList);
        }
Beispiel #2
0
        /// <summary>
        /// 根据角色id获取怪物的位置
        /// </summary>
        static public List <Vector3> GetMonsterPositionsByActorId(uint actorId, Neptune.Data data = null)
        {
            if (data == null)
            {
                data = Neptune.DataManager.Instance.Data;
            }
            Dictionary <int, Neptune.BaseGenericNode> monsters = data.GetData <Neptune.MonsterBase>().Data;
            List <Vector3> retPositions = new List <Vector3>();

            retPositions.Clear();

            if (monsters != null)
            {
                foreach (var monsterBase in monsters.Values)
                {
                    if (monsterBase is Neptune.Monster)
                    {
                        Neptune.Monster monster = (Neptune.Monster)monsterBase;
                        if (monster != null && monster.ExcelId == actorId)
                        {
                            retPositions.Add(monster.Position);
                        }
                    }
                    else if (monsterBase is Neptune.MonsterGroup)
                    {
                        Neptune.MonsterGroup monsterGroup = (Neptune.MonsterGroup)monsterBase;
                        if (monsterGroup != null)
                        {
                            List <string> strs = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "data_monster", "id", monsterGroup.ExcelId.ToString(), "actor");
                            foreach (string str in strs)
                            {
                                uint ret = 0;
                                uint.TryParse(str, out ret);
                                if (ret == actorId)
                                {
                                    retPositions.Add(monsterGroup.Position);
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            return(retPositions);
        }