Exemplo n.º 1
0
        protected override bool FillData()
        {
            base.FillData();

            init_weapon_id       = ParseInt("init_weapon_id", 5);
            fuse_card_max_count  = ParseInt("fuse_card_max_count", 5);
            fuse_card_atk_scale  = ParseFloat("fuse_card_atk_scale", 0);
            card_quality_color_1 = ParseString("card_quality_color_1", "");
            card_quality_color_2 = ParseString("card_quality_color_2", "");
            card_quality_color_3 = ParseString("card_quality_color_3", "");
            card_quality_color_4 = ParseString("card_quality_color_4", "");
            camp_task_max_count  = ParseInt("camp_task_max_count", 3);
            refresh_data_time    = ParseInt("refresh_data_time", 8);
            convert_key_gem      = ParseInt("convert_key_gem", 10);
            battle_revive_cost   = ParseInt("battle_revive_cost", 10);
            box_init_award_count = ParseInt("box_init_award_count", 10);
            card_reset_cost      = ParseInt("card_reset_cost", 10);
            open_box_ten_cost    = ParseInt("open_box_ten_cost", 10);

            card_productionBonus_rarity_1 = ParseFloat("card_productionBonus_rarity_1", 1);
            card_productionBonus_rarity_2 = ParseFloat("card_productionBonus_rarity_2", 1);
            card_productionBonus_rarity_3 = ParseFloat("card_productionBonus_rarity_3", 1);
            card_productionBonus_rate     = ParseFloat("card_productionBonus_rate", 1);
            card_levelup_cost_k1          = ParseInt("card_levelup_cost_k1", 1);
            card_levelup_cost_k2          = ParseInt("card_levelup_cost_k2", 1);
            card_levelup_cost_k3          = ParseInt("card_levelup_cost_k3", 1);
            card_levelup_cost_k4          = ParseInt("card_levelup_cost_k4", 1);
            player_levelup_hp_k1          = ParseFloat("player_levelup_hp_k1", 1);
            player_levelup_hp_k2          = ParseFloat("player_levelup_hp_k2", 1);
            building_production_k1        = ParseFloat("building_production_k1", 1);
            //building_cost_k1 = ParseFloat("building_cost_k1", 2);
            card_dps = ParseFloat("card_dps", 1);
            card_rarity_capability_1 = ParseFloat("card_rarity_capability_1", 1);
            card_rarity_capability_2 = ParseFloat("card_rarity_capability_2", 1);
            card_rarity_capability_3 = ParseFloat("card_rarity_capability_3", 1);
            combat_capability        = ParseFloat("combat_capability", 1);
            card_levelup_dpsrate     = ParseFloat("card_levelup_dpsrate", 1);
            card_star_dpsrate        = ParseFloat("card_star_dpsrate", 1);
            camp_combat = ParseFloat("camp_combat", 1);

            box_award_gun = ParseString("box_award_gun", "");
            player_levelup_production_k1 = ParseFloat("player_levelup_production_k1", 0f);
            string[] parser = new string[] { "|" };
            BoxAwardGunArr = TableItem.SpliteToInts(box_award_gun, parser);

            string campLevel_1 = ParseString("campLevel_1", "");
            string campLevel_2 = ParseString("campLevel_2", "");

            CampLevel_1Arr = TableItem.SpliteToInts(campLevel_1, parser);
            CampLevel_2Arr = TableItem.SpliteToInts(campLevel_2, parser);

            return(true);
        }
Exemplo n.º 2
0
        public FieldPairTable makeFieldPairTable(TableItem _item)
        {
            if (fieldPairTable == null)
            {
                fieldPairTable = new FieldPairTable();
                _item.CollectFields(fieldPairTable);
                fieldPairTable.catchField();
                _item.CollectFields(fieldPairTable);
            }
            else
            {
                fieldPairTable.clear();
                _item.CollectFields(fieldPairTable);
            }
            if (!hasCatchColume)
            {
                if (nameToColume.Count != 0)
                {
                    for (int i = 0; i < fieldPairTable.mFields.Length; ++i)
                    {
                        int iColumn = fieldPairTable.getCatchColume(i);
                        if (iColumn < 0)
                        {
                            iColumn = getColumIndex(fieldPairTable.mFields[i].name);
                            fieldPairTable.setCatchColume(i, iColumn);
                            if (iColumn < 0)
                            {
                                Debug.LogError("table[" + fileName + "]load error:not find [" + fieldPairTable.mFields[i].name + "]");
                            }
                        }
                    }
                    foreach (KeyValuePair <string, int> item in nameToColume)
                    {
                        int iColumn = fieldPairTable.getFiledIndexByName(item.Key);
                        if (iColumn < 0)
                        {
                            Debug.LogWarningFormat("table[{0}] column:[{1}] Has not been used!", fileName, item.Key);
                        }
                    }
                    hasCatchColume = true;
                }
            }

            return(fieldPairTable);
        }
Exemplo n.º 3
0
        public object GetItemValueByName(string id, string name)
        {
            TableItem item = GetItemByID(id);

            if (item == null)
            {
                return(null);
            }
            var _FieldPairTable = makeFieldPairTable(item);
            var FieldIndex      = _FieldPairTable.getFiledIndexByName(name);

            if (FieldIndex >= 0)
            {
                return(_FieldPairTable.GetValue(FieldIndex));
            }
            else
            {
                Debug.LogError("not find file [" + fileName + "]field[" + name + "]");
            }
            return(null);
        }