예제 #1
0
        /// <summary>
        /// Gets the hatred value.
        /// 多人玩家阵营均大于MaxHatredIndex
        /// 玩家阵营之间的仇恨根据模式不同而不同
        /// 玩家阵营(包括炮塔等)与普通AI阵营的仇恨由普通AI阵营仇恨列表决定(相互一致,主要影响玩家炮塔与普通AI的仇恨)
        /// </summary>
        /// <returns>The hatred value.</returns>
        /// <param name="srcCamp">Source camp.</param>
        /// <param name="dstCamp">Dst camp.</param>
        public static int GetHatredValue(int srcCamp, int dstCamp)
        {
            if (srcCamp <= -1 || dstCamp <= -1)
            {
                return(0);
            }

            if (srcCamp >= MaxHatredIndex && dstCamp >= MaxHatredIndex)
            {
                if (Pathea.PeGameMgr.IsMultiVS)
                {
                    return(srcCamp == dstCamp ? 0 : 10);
                }
                else
                {
                    return(srcCamp == dstCamp ? 0 : 0);
                }
            }

            int src = srcCamp >= MaxHatredIndex ? PlayerCamp : srcCamp;
            int dst = dstCamp >= MaxHatredIndex ? PlayerCamp : dstCamp;

            AiHatredData data = s_tblCampData.Find(ret => ret.m_campID == src);

            if (data == null || dst >= data.m_campData.Length)
            {
                return(0);
            }

            return(data.m_campData[dst]);
        }
예제 #2
0
        public static void LoadData()
        {
            AiHatredData.LoadData();
            AiHarmData.LoadData();
            AiDataBlock.LoadData();
            AiDamageTypeData.LoadData();

            AISpawnDataRepository.LoadData();
        }
예제 #3
0
        public static AiHatredData GetHatredData(int campID)
        {
            foreach (AiHatredData data in s_tblCampData)
            {
                if (data.m_campID == campID)
                {
                    AiHatredData _data = new AiHatredData();
                    _data = data;
                    return(_data);
                }
            }

            return(null);
        }
예제 #4
0
        public static void LoadData()
        {
            s_tblCampData = new List <AiHatredData>();
            SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("ai_campnew");

            CampCount = reader.FieldCount - 3;

            //reader.Read();

            while (reader.Read())
            {
                AiHatredData campData = new AiHatredData();
                campData.m_campData = new int[CampCount];
                campData.m_campID   = Convert.ToInt32(reader.GetString(0));
                campData.m_camName  = reader.GetString(1);

                for (int i = 0; i < CampCount; i++)
                {
                    campData.m_campData[i] = Convert.ToInt32(reader.GetString(i + 3));
                }
                s_tblCampData.Add(campData);
            }
        }