Exemple #1
0
    public List <EnemyData> GetEnemyDataByEnemyCollectionId(uint collectionId)
    {
        List <EnemyData> searchData = new List <EnemyData>();

        enemyTable.ForEach(delegate(EnemyData data)
        {
            if (data.enemyCollectionId == collectionId)
            {
                searchData.Add(data);
            }
        });
        if (searchData.Count == 0)
        {
            Log.Error("Not found enemyData by collection id {0}", collectionId);
        }
        return(searchData);
    }
    public FieldMapTableData[] GetFieldMapDataInRegion(uint regionId)
    {
        if (!Singleton <FieldMapTable> .IsValid())
        {
            return(null);
        }
        List <FieldMapTableData> data = new List <FieldMapTableData>(20);

        fieldMapTable.ForEach(delegate(FieldMapTableData d)
        {
            if (d.regionId == regionId)
            {
                data.Add(d);
            }
        });
        return(data.ToArray());
    }
Exemple #3
0
    public EquipItemExceedParamAll GetEquipItemExceedParamAll(uint exceedId, uint exceedCnt)
    {
        if (tableData == null)
        {
            return(null);
        }
        UIntKeyTable <EquipItemExceedParam> uIntKeyTable = tableData.Get(exceedId);

        if (uIntKeyTable == null)
        {
            return(null);
        }
        EquipItemExceedParamAll             result      = new EquipItemExceedParamAll();
        List <SkillItemTable.SkillSlotData> slotList    = new List <SkillItemTable.SkillSlotData>();
        List <EquipItem.Ability>            abilityList = new List <EquipItem.Ability>();

        uIntKeyTable.ForEach(delegate(EquipItemExceedParam param)
        {
            if (param.cnt <= (int)exceedCnt)
            {
                EquipItemExceedParamAll equipItemExceedParamAll = result;
                equipItemExceedParamAll.atk = (int)equipItemExceedParamAll.atk + (int)param.atk;
                EquipItemExceedParamAll equipItemExceedParamAll2 = result;
                equipItemExceedParamAll2.def = (int)equipItemExceedParamAll2.def + (int)param.def;
                EquipItemExceedParamAll equipItemExceedParamAll3 = result;
                equipItemExceedParamAll3.hp = (int)equipItemExceedParamAll3.hp + (int)param.hp;
                for (int i = 0; i < 6; i++)
                {
                    result.atkElement[i] += param.atkElement[i];
                    result.defElement[i] += param.defElement[i];
                }
                if (param.skillSlot.slotType != 0)
                {
                    slotList.Add(param.skillSlot);
                }
                if (param.ability.id > 0)
                {
                    abilityList.Add(param.ability);
                }
            }
        });
        result.skillSlot = slotList.ToArray();
        result.ability   = abilityList.ToArray();
        return(result);
    }
    public PlayData[] GetSortedPlayData(AchievementCounter[] dataList)
    {
        DateTime        now      = TimeManager.GetNow();
        List <PlayData> sortData = new List <PlayData>();

        playDataTable.ForEach(delegate(PlayData o)
        {
            if (o.startAt <= now)
            {
                AchievementCounter achievementCounter = dataList.Find((AchievementCounter x) => x.type == o.type && x.subType == o.subType);
                string s = (achievementCounter == null) ? "0" : achievementCounter.count;
                o.count  = int.Parse(s);
                sortData.Add(o);
            }
        });
        sortData.Sort((PlayData a, PlayData b) => a.orderNo - b.orderNo);
        return(sortData.ToArray());
    }
    public AbilityData GetMinimumAbilityData(uint ability_id)
    {
        if (abilityDataTable == null)
        {
            return(null);
        }
        UIntKeyTable <AbilityData> uIntKeyTable = abilityDataTable.Get(ability_id);

        if (uIntKeyTable == null)
        {
            Log.Error("GetAbilityDataList is NULL :: ability id = " + ability_id);
            return(null);
        }
        AbilityData res            = null;
        AbilityData linearBaseData = null;

        uIntKeyTable.ForEach(delegate(AbilityData data)
        {
            if ((int)data.needAP >= 0 && (res == null || (int)res.needAP > (int)data.needAP))
            {
                res = data;
            }
            if (data.minNeedAP > 0)
            {
                if (linearBaseData != null)
                {
                    if (linearBaseData.minNeedAP > data.minNeedAP)
                    {
                        linearBaseData = data;
                    }
                }
                else
                {
                    linearBaseData = data;
                }
            }
        });
        if (linearBaseData != null)
        {
            return(CreateLinearInterpolationData(linearBaseData, linearBaseData.minNeedAP));
        }
        return(res);
    }
    public AbilityData[] GetAbilityDataArray(uint ability_id)
    {
        if (abilityDataTable == null)
        {
            return(null);
        }
        UIntKeyTable <AbilityData> uIntKeyTable = abilityDataTable.Get(ability_id);

        if (uIntKeyTable == null)
        {
            Log.Error("GetAbilityDataList is NULL :: ability id = " + ability_id);
            return(null);
        }
        List <AbilityData> list = new List <AbilityData>();

        uIntKeyTable.ForEach(delegate(AbilityData data)
        {
            list.Add(data);
        });
        return(list.ToArray());
    }
    public AbilityData GetAbilityData(uint ability_id, int AP)
    {
        if (abilityDataTable == null)
        {
            return(null);
        }
        UIntKeyTable <AbilityData> uIntKeyTable = abilityDataTable.Get(ability_id);

        if (uIntKeyTable == null)
        {
            Log.Error("AbilityDataTable is NULL :: ability id = " + ability_id + " AP = " + AP);
            return(null);
        }
        AbilityData under          = null;
        AbilityData linearBaseData = null;

        uIntKeyTable.ForEach(delegate(AbilityData data)
        {
            if (AP >= 0)
            {
                if ((int)data.needAP <= AP && (int)data.needAP >= 0 && (under == null || (int)data.needAP > (int)under.needAP))
                {
                    under = data;
                }
                if (data.minNeedAP > 0 && data.minNeedAP <= AP && (int)data.needAP >= AP)
                {
                    linearBaseData = data;
                }
            }
            else if ((int)data.needAP >= AP && (int)data.needAP < 0 && (under == null || (int)data.needAP < (int)under.needAP))
            {
                under = data;
            }
        });
        if (linearBaseData != null)
        {
            return(CreateLinearInterpolationData(linearBaseData, AP));
        }
        return(under);
    }
    public EvolveEquipItemData[] GetEvolveEquipItemData(uint base_equip_id)
    {
        if (tableData == null)
        {
            return(null);
        }
        List <EvolveEquipItemData> list = new List <EvolveEquipItemData>();

        tableData.ForEach(delegate(EvolveEquipItemData table)
        {
            if (table.equipBaseItemID == base_equip_id)
            {
                list.Add(table);
            }
        });
        if (list.Count == 0)
        {
            return(null);
        }
        list.Sort((EvolveEquipItemData l, EvolveEquipItemData r) => (int)(l.equipEvolveItemID - r.equipEvolveItemID));
        return(list.ToArray());
    }
 public void ForEach(Action <Ability> cb)
 {
     abilityTable.ForEach(cb);
 }
Exemple #10
0
 public void ForEach(Action <EquipItemData> cb)
 {
     equipItemTable.ForEach(cb);
 }
Exemple #11
0
    public GrowSkillItemData GetGrowSkillItemData(uint skill_grow_id, int level)
    {
        if (growSkillItemTable == null)
        {
            return(null);
        }
        UIntKeyTable <GrowSkillItemData> uIntKeyTable = growSkillItemTable.Get(skill_grow_id);

        if (uIntKeyTable == null)
        {
            Log.Error("GrowSkillTable is NULL :: grow id = " + skill_grow_id + " Lv = " + level);
            return(null);
        }
        GrowSkillItemData growSkillItemData = uIntKeyTable.Get((uint)level);

        if (growSkillItemData != null)
        {
            return(growSkillItemData);
        }
        GrowSkillItemData under = null;
        GrowSkillItemData over  = null;

        uIntKeyTable.ForEach(delegate(GrowSkillItemData data)
        {
            if (data.lv > level && (over == null || data.lv < over.lv))
            {
                over = data;
            }
            if (data.lv <= level && (under == null || data.lv > under.lv))
            {
                under = data;
            }
        });
        if (under != null && over == null)
        {
            return(under);
        }
        if (under == null)
        {
            return(null);
        }
        float             num = (float)(level - under.lv) / (float)(over.lv - under.lv);
        GrowSkillItemData growSkillItemData2 = new GrowSkillItemData();

        growSkillItemData2.id           = skill_grow_id;
        growSkillItemData2.lv           = level;
        growSkillItemData2.exceedCnt    = Mathf.FloorToInt(Mathf.Lerp((float)under.exceedCnt, (float)over.exceedCnt, num));
        growSkillItemData2.needExp      = new GrowRate();
        growSkillItemData2.needExp.rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.needExp.rate, (float)(int)over.needExp.rate, num));
        growSkillItemData2.needExp.add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.needExp.add, (float)(int)over.needExp.add, num));
        growSkillItemData2.giveExp      = new GrowRate();
        growSkillItemData2.giveExp.rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.giveExp.rate, (float)(int)over.giveExp.rate, num));
        growSkillItemData2.giveExp.add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.giveExp.add, (float)(int)over.giveExp.add, num));
        growSkillItemData2.atk          = new GrowRate();
        growSkillItemData2.atk.rate     = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.atk.rate, (float)(int)over.atk.rate, num));
        growSkillItemData2.atk.add      = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.atk.add, (float)(int)over.atk.add, num));
        growSkillItemData2.def          = new GrowRate();
        growSkillItemData2.def.rate     = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.def.rate, (float)(int)over.def.rate, num));
        growSkillItemData2.def.add      = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.def.add, (float)(int)over.def.add, num));
        growSkillItemData2.hp           = new GrowRate();
        growSkillItemData2.hp.rate      = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.hp.rate, (float)(int)over.hp.rate, num));
        growSkillItemData2.hp.add       = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.hp.add, (float)(int)over.hp.add, num));
        growSkillItemData2.elemAtk      = new GrowRate[6];
        for (int i = 0; i < 6; i++)
        {
            growSkillItemData2.elemAtk[i]      = new GrowRate();
            growSkillItemData2.elemAtk[i].rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemAtk[i].rate, (float)(int)over.elemAtk[i].rate, num));
            growSkillItemData2.elemAtk[i].add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemAtk[i].add, (float)(int)over.elemAtk[i].add, num));
        }
        growSkillItemData2.elemDef = new GrowRate[6];
        for (int j = 0; j < 6; j++)
        {
            growSkillItemData2.elemDef[j]      = new GrowRate();
            growSkillItemData2.elemDef[j].rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemDef[j].rate, (float)(int)over.elemDef[j].rate, num));
            growSkillItemData2.elemDef[j].add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemDef[j].add, (float)(int)over.elemDef[j].add, num));
        }
        growSkillItemData2.skillAtk          = new GrowRate();
        growSkillItemData2.skillAtk.rate     = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.skillAtk.rate, (float)(int)over.skillAtk.rate, num));
        growSkillItemData2.skillAtk.add      = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.skillAtk.add, (float)(int)over.skillAtk.add, num));
        growSkillItemData2.skillAtkRate      = new GrowRate();
        growSkillItemData2.skillAtkRate.rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.skillAtkRate.rate, (float)(int)over.skillAtkRate.rate, num));
        growSkillItemData2.skillAtkRate.add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.skillAtkRate.add, (float)(int)over.skillAtkRate.add, num));
        growSkillItemData2.heal        = new GrowRate();
        growSkillItemData2.heal.rate   = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.heal.rate, (float)(int)over.heal.rate, num));
        growSkillItemData2.heal.add    = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.heal.add, (float)(int)over.heal.add, num));
        growSkillItemData2.supprtValue = new GrowRate[3];
        growSkillItemData2.supprtTime  = new GrowRateFloat[3];
        for (int k = 0; k < 3; k++)
        {
            growSkillItemData2.supprtValue[k]      = new GrowRate();
            growSkillItemData2.supprtValue[k].rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.supprtValue[k].rate, (float)(int)over.supprtValue[k].rate, num));
            growSkillItemData2.supprtValue[k].add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.supprtValue[k].add, (float)(int)over.supprtValue[k].add, num));
            growSkillItemData2.supprtTime[k]       = new GrowRateFloat();
            growSkillItemData2.supprtTime[k].rate  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.supprtTime[k].rate, (float)(int)over.supprtTime[k].rate, num));
            growSkillItemData2.supprtTime[k].add   = (float)Mathf.FloorToInt(Mathf.Lerp((float)under.supprtTime[k].add, (float)over.supprtTime[k].add, num));
        }
        growSkillItemData2.castTime      = new GrowRate();
        growSkillItemData2.castTime.rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.castTime.rate, (float)(int)over.castTime.rate, num));
        growSkillItemData2.castTime.add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.castTime.add, (float)(int)over.castTime.add, num));
        growSkillItemData2.useGauge      = new GrowRate();
        growSkillItemData2.useGauge.rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.useGauge.rate, (float)(int)over.useGauge.rate, num));
        growSkillItemData2.useGauge.add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.useGauge.add, (float)(int)over.useGauge.add, num));
        return(growSkillItemData2);
    }
Exemple #12
0
 public void ForEach(Action <AchievementIdData> cb)
 {
     achievementIdDataTable.ForEach(cb);
 }
    public GrowEquipItemNeedItemData GetGrowEquipItemNeedItemData(uint id, uint lv)
    {
        if (needTableData == null)
        {
            return(null);
        }
        UIntKeyTable <GrowEquipItemNeedItemData> uIntKeyTable = needTableData.Get(id);

        if (uIntKeyTable == null)
        {
            Log.Error("GetGrowEquipItemNeedItemData is NULL :: need id = " + id + " Lv = " + lv);
            return(null);
        }
        GrowEquipItemNeedItemData growEquipItemNeedItemData = uIntKeyTable.Get(lv);

        if (growEquipItemNeedItemData != null)
        {
            return(growEquipItemNeedItemData);
        }
        GrowEquipItemNeedItemData under = null;
        GrowEquipItemNeedItemData over  = null;

        uIntKeyTable.ForEach(delegate(GrowEquipItemNeedItemData table)
        {
            if (table.lv > lv && (over == null || table.lv < over.lv))
            {
                over = table;
            }
            if (table.lv <= lv && (under == null || table.lv > under.lv))
            {
                under = table;
            }
        });
        if (under != null && over == null)
        {
            return(under);
        }
        if (under == null)
        {
            return(null);
        }
        GrowEquipItemNeedItemData growEquipItemNeedItemData2 = new GrowEquipItemNeedItemData();
        float lerp_value = (float)(double)(lv - under.lv) / (float)(double)(over.lv - under.lv);

        growEquipItemNeedItemData2.id = id;
        growEquipItemNeedItemData2.lv = lv;
        List <NeedMaterial> material_list = new List <NeedMaterial>();

        Array.ForEach(under.needMaterial, delegate(NeedMaterial material_data)
        {
            Array.ForEach(over.needMaterial, delegate(NeedMaterial over_need_material)
            {
                if (over_need_material.itemID == material_data.itemID)
                {
                    material_list.Add(new NeedMaterial(over_need_material.itemID, Mathf.FloorToInt(Mathf.Lerp((float)material_data.num, (float)over_need_material.num, lerp_value))));
                }
            });
        });
        growEquipItemNeedItemData2.needMaterial = material_list.ToArray();
        growEquipItemNeedItemData2.needMoney    = Mathf.FloorToInt(Mathf.Lerp((float)under.needMoney, (float)over.needMoney, lerp_value));
        return(growEquipItemNeedItemData2);
    }
    public GrowEquipItemData GetGrowEquipItemData(uint id, uint lv)
    {
        if (growTableData == null)
        {
            return(null);
        }
        UIntKeyTable <GrowEquipItemData> uIntKeyTable = growTableData.Get(id);

        if (uIntKeyTable == null)
        {
            Log.Error("GrowEquipItemTable is NULL :: grow id = " + id + " Lv = " + lv);
            return(null);
        }
        GrowEquipItemData growEquipItemData = uIntKeyTable.Get(lv);

        if (growEquipItemData != null && lv > 1)
        {
            return(growEquipItemData);
        }
        GrowEquipItemData under = null;
        GrowEquipItemData over  = null;

        uIntKeyTable.ForEach(delegate(GrowEquipItemData table)
        {
            if ((uint)table.lv > lv && (over == null || (uint)table.lv < (uint)over.lv))
            {
                over = table;
            }
            if ((uint)table.lv <= lv && (under == null || (uint)table.lv > (uint)under.lv))
            {
                under = table;
            }
        });
        if (under != null && over == null)
        {
            return(under);
        }
        if (under == null)
        {
            under          = new GrowEquipItemData();
            under.lv       = 1u;
            under.id       = id;
            under.atk      = new GrowRate();
            under.atk.rate = 100;
            under.atk.add  = 0;
            under.def      = new GrowRate();
            under.def.rate = 100;
            under.def.add  = 0;
            under.hp       = new GrowRate();
            under.hp.rate  = 100;
            under.hp.add   = 0;
            under.elemAtk  = new GrowRate[6];
            for (int i = 0; i < 6; i++)
            {
                under.elemAtk[i]      = new GrowRate();
                under.elemAtk[i].rate = 100;
                under.elemAtk[i].add  = 0;
            }
            under.elemDef = new GrowRate[6];
            for (int j = 0; j < 6; j++)
            {
                under.elemDef[j]      = new GrowRate();
                under.elemDef[j].rate = 100;
                under.elemDef[j].add  = 0;
            }
        }
        GrowEquipItemData growEquipItemData2 = new GrowEquipItemData();
        float             num = (float)(double)(lv - (uint)under.lv) / (float)(double)((uint)over.lv - (uint)under.lv);

        growEquipItemData2.id       = id;
        growEquipItemData2.lv       = lv;
        growEquipItemData2.atk      = new GrowRate();
        growEquipItemData2.atk.rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.atk.rate, (float)(int)over.atk.rate, num));
        growEquipItemData2.atk.add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.atk.add, (float)(int)over.atk.add, num));
        growEquipItemData2.def      = new GrowRate();
        growEquipItemData2.def.rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.def.rate, (float)(int)over.def.rate, num));
        growEquipItemData2.def.add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.def.add, (float)(int)over.def.add, num));
        growEquipItemData2.hp       = new GrowRate();
        growEquipItemData2.hp.rate  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.hp.rate, (float)(int)over.hp.rate, num));
        growEquipItemData2.hp.add   = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.hp.add, (float)(int)over.hp.add, num));
        growEquipItemData2.elemAtk  = new GrowRate[6];
        for (int k = 0; k < 6; k++)
        {
            growEquipItemData2.elemAtk[k]      = new GrowRate();
            growEquipItemData2.elemAtk[k].rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemAtk[k].rate, (float)(int)over.elemAtk[k].rate, num));
            growEquipItemData2.elemAtk[k].add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemAtk[k].add, (float)(int)over.elemAtk[k].add, num));
        }
        growEquipItemData2.elemDef = new GrowRate[6];
        for (int l = 0; l < 6; l++)
        {
            growEquipItemData2.elemDef[l]      = new GrowRate();
            growEquipItemData2.elemDef[l].rate = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemDef[l].rate, (float)(int)over.elemDef[l].rate, num));
            growEquipItemData2.elemDef[l].add  = Mathf.FloorToInt(Mathf.Lerp((float)(int)under.elemDef[l].add, (float)(int)over.elemDef[l].add, num));
        }
        return(growEquipItemData2);
    }
Exemple #15
0
    public ItemDetailToFieldData[] GetFieldTableFromItemID(uint item_id, out bool find_unknown_field, bool isExcludeNotPlayable = false)
    {
        find_unknown_field = false;
        if (itemToFieldTable == null)
        {
            return(null);
        }
        UIntKeyTable <ItemToFieldData> uIntKeyTable = itemToFieldTable.Get(item_id);

        if (uIntKeyTable == null)
        {
            return(null);
        }
        bool temp_find_unknown            = false;
        List <ItemDetailToFieldData> list = new List <ItemDetailToFieldData>();
        List <uint> icon_id_list          = new List <uint>();

        uIntKeyTable.ForEach(delegate(ItemToFieldData data)
        {
            if (data.enemyId != null && data.enemyId.Length != 0)
            {
                FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData(data.fieldId);
                if (fieldMapData != null)
                {
                    if (IsOpenMap(fieldMapData))
                    {
                        if (data.enemyId[0] != 0)
                        {
                            list.Add(new ItemDetailToFieldEnemyData(fieldMapData, data.enemyId));
                        }
                        int i = 0;
                        for (int num = data.pointId.Length; i < num; i++)
                        {
                            if (data.pointId[i] != 0)
                            {
                                FieldMapTable.GatherPointTableData gatherPointData = Singleton <FieldMapTable> .I.GetGatherPointData(data.pointId[i]);
                                if (gatherPointData != null)
                                {
                                    FieldMapTable.GatherPointViewTableData gatherPointViewData = Singleton <FieldMapTable> .I.GetGatherPointViewData(gatherPointData.viewID);
                                    if (gatherPointViewData != null && gatherPointViewData.iconID != 0 && icon_id_list.IndexOf(gatherPointViewData.iconID) < 0 && (!isExcludeNotPlayable || IsPlayableField(fieldMapData)))
                                    {
                                        icon_id_list.Add(gatherPointViewData.iconID);
                                        list.Add(new ItemDetailToFieldPointData(fieldMapData, data.pointId[i], gatherPointData, gatherPointViewData));
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        temp_find_unknown = true;
                    }
                }
            }
        });
        find_unknown_field = temp_find_unknown;
        if (list.Count == 0)
        {
            return(null);
        }
        return(list.ToArray());
    }