public static void LoadData() { AiHatredData.LoadData(); AiHarmData.LoadData(); AiDataBlock.LoadData(); AiDamageTypeData.LoadData(); AISpawnDataRepository.LoadData(); }
public static void LoadData() { s_tblHarmData = new List <AiHarmData>(); SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("ai_harmdata"); HarmCount = reader.FieldCount - 3; //reader.Read(); while (reader.Read()) { AiHarmData campData = new AiHarmData(); campData.m_harmData = new int[HarmCount]; campData.m_harmID = Convert.ToInt32(reader.GetString(0)); campData.m_harmName = reader.GetString(1); for (int i = 0; i < HarmCount; i++) { campData.m_harmData[i] = Convert.ToInt32(reader.GetString(i + 3)); } s_tblHarmData.Add(campData); } }
/// <summary> /// Gets the harm value. /// 多人玩家阵营均大于MaxHarmIndex /// 多人玩家对非同阵营对象均可以造成伤害 /// </summary> /// <returns>The harm value.</returns> /// <param name="srcHarmID">Source harm I.</param> /// <param name="dstHarmID">Dst harm I.</param> public static int GetHarmValue(int srcHarmID, int dstHarmID) { if (srcHarmID <= -1 || dstHarmID <= -1) { return(0); } if (srcHarmID >= MaxHarmIndex && dstHarmID >= MaxHarmIndex) { return(srcHarmID == dstHarmID ? 0 : 1); } int src = srcHarmID >= MaxHarmIndex ? AiHatredData.PlayerCamp : srcHarmID; int dst = dstHarmID >= MaxHarmIndex ? AiHatredData.PlayerCamp : dstHarmID; AiHarmData data = GetHarmData(src); if (data == null || dst >= data.m_harmData.Length) { return(0); } return(data.m_harmData[dst]); }