Exemplo n.º 1
0
        public static void LoadData()
        {
            AiHatredData.LoadData();
            AiHarmData.LoadData();
            AiDataBlock.LoadData();
            AiDamageTypeData.LoadData();

            AISpawnDataRepository.LoadData();
        }
Exemplo n.º 2
0
        public static float GetDamageScale(int damageType, int defenceType)
        {
            AiDamageTypeData data = s_tblDamageData.Find(ret => ret.m_damageTypeId == damageType);

            if (data == null)
            {
                return(1.0f);
            }

            if (defenceType < 0 || defenceType >= DamageTypeCount)
            {
                return(1.0f);
            }

            return(data.m_damageData[defenceType]);
        }
Exemplo n.º 3
0
        public static void LoadData()
        {
            s_tblDamageData = new List <AiDamageTypeData>();
            SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("adtype");

            DamageTypeCount = reader.FieldCount - 1;

            //reader.Read();

            while (reader.Read())
            {
                AiDamageTypeData damageData = new AiDamageTypeData();
                damageData.m_damageData    = new float[DamageTypeCount];
                damageData.m_damageTypeId  = Convert.ToInt32(reader.GetString(0));
                damageData.m_damageData[0] = 1.0f;

                for (int i = 1; i < DamageTypeCount; i++)
                {
                    damageData.m_damageData[i] = Convert.ToSingle(reader.GetString(i + 1));
                }

                s_tblDamageData.Add(damageData);
            }
        }