%%---------------------------------------------------- %% 精灵配置表 %% %% @author liufenglin 240039421@qq.com %%---------------------------------------------------- -module(sprite_data). -export([cfg/0, get/1]). -include("data_config.hrl"). -include("common.hrl"). cfg() -> #data_cfg{ name = sprite_data ,lua_name = sprite_data ,desc = "精灵配置表" ,splitv = 2 ,source = "sprite_data.xml" ,target = "sprite_data.erl" ,inc = ["common.hrl", "attr.hrl"] ,callback = [ {{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}} ,{get_hatch_ids, cb_fun, handle, {list, ["孵化器解锁配置"]}} ,{get_hatch_cond, cb_fun, handle, {get_tuple, ["孵化器解锁配置"], id, hatch_cond}} ,{get_hatch_open_expend, cb_fun, handle, {get_tuple, ["孵化器解锁配置"], id, expend}} ,{get_need_time, cb_fun, handle, {get_tuple, ["孵化等级"], lev, do_time}} ,{get_lev_expend, cb_fun, handle, {get_tuple, ["孵化等级"], lev, [limit_vip, expend]}} ,{get_lev_max, cb_fun, handle, {get_max, ["孵化等级"], lev}} ,{get_lev_mail_award, cb_fun, handle, {get_tuple, ["孵化等级"], lev, award}} ,{get_need_piont, cb_fun, handle, {get_tuple, ["孵化配置"], item_bid, need_piont}} ,{get_hatch_award, cb_fun, handle, {get_tuple, ["孵化配置"], item_bid, [drop_id1, baodi_dropids, drop_id2, award]}} ,{{get_baodi_count, "0"}, cb_fun, handle, {get_tuple, ["孵化配置"], item_bid, baodi_count}} ,{{get_baodi_quality, "999"}, cb_fun, handle, {get_tuple, ["孵化配置"], item_bid, baodi_quality}} ,{{get_reset_award, "[]"}, cb_fun, handle, {get_tuple, ["孵化配置"], item_bid, reset_award}} ,{get_egg_bids, cb_fun, handle, {list, ["孵化配置"]}} ,{get_del_piont, cb_fun, handle, {get_tuple, ["孵化砸蛋配置"], item_bid, del_piont}} ,{get_egg_buy_info, cb_fun, handle, {get_tuple, ["孵化配置"], item_bid, [can_buy, price, limit_num]}} ,{get_item_buy_info, cb_fun, handle, {get_tuple, ["孵化砸蛋配置"], item_bid, [can_buy, price, limit_num]}} ,{{get_tree_attr,0, def}, cb_fun, handle, {row_fun, ["古树属性"], fun tree_attr_val/1}} ,{{get_lev_group,0, def}, cb_fun, handle, {row_fun, ["古树属性"], fun get_lev_group/1}} ,{get_break_group, cb_fun, handle, {get_tuple, ["古树进阶"], count, [add_hp, add_atk, add_def, add_speed]}} ,{{get_break_attr, "[]"}, cb_fun, handle, {get_tuple, ["古树进阶"], count, all_attr}} ,{get_tree_break_expend, cb_fun, handle, {get_tuple, ["古树进阶"], count, expend}} ,{get_limit_sprite_num, cb_fun, handle, {get_tuple, ["古树进阶"], count, skill_num}} ,{get_tree_max_lev, cb_fun, handle, {get_tuple, ["古树进阶"], count, lev_max}} ,{get_tree_lev_expend, cb_fun, handle, {get_tuple, ["古树升级"], lev, expend}} ,{{get_sprite_skill, "[]"}, cb_fun, handle, {get_tuple, ["精灵技能配置"], id, skill}} ,{{get_sprite_type, "undefined"}, cb_fun, handle, {get_tuple, ["精灵技能配置"], id, sprite_type}} ,{{get_sprite_power, "0"}, cb_fun, handle, {get_tuple, ["精灵技能配置"], id, power}} ,{{get_sprite_holiday_decompound, "undefined"}, cb_fun, handle, {get_tuple, ["精灵重生"], [camp_id, id], award}} ,{{get_sprite_compound_info, "undefined"}, cb_fun, handle, {get_tuple, ["精灵合成"], id, [expend, award]}} ,{get_all_sprites_plan, cb_fun, handle, {tuple_list, ["精灵方案"], [id, name, flag]}} ,{get_sprite_plan, cb_fun, handle, {get_tuple, ["精灵方案"], id, [name, expend]}} ,{{get_sprite_type_team, undefined}, cb_fun, handle, {get_tuple, ["精灵布阵初始化"], type, num}} ] ,callback_cli = [ {const, cb_fun_lua, handle, {key_val, ["常量配置"], key, [val, desc]}} ,{hatch_data, cb_fun_lua, handle, {key_val, ["孵化器解锁配置"], id, [hatch_cond,name, res_id,sort,expend,desc1,desc2]}} ,{hatch_lev, cb_fun_lua, handle, {key_val, ["孵化等级"], lev, all}} ,{hatch_egg, cb_fun_lua, handle, {key_val, ["孵化配置"], item_bid, all}} ,{smash_item, cb_fun_lua, handle, {key_val, ["孵化砸蛋配置"], item_bid, all}} ,{elfin_data, cb_fun_lua, handle, {val_str, ["精灵技能配置"], id, all}} ,{elfin_book, cb_fun_lua, handle, {type_val, ["精灵技能配置"], [step], id}} ,{elfin_skill, cb_fun_lua, handle, {type_get_last_row, ["精灵技能配置"], [skill], effect_id}} ,{elfin_skill_icon, cb_fun_lua, handle, {type_get_last_row, ["精灵技能配置"], [skill], icon}} ,{tree_attr, cb_fun_lua, handle, {list_val, ["古树属性"], all}} ,{tree_up_lv, cb_fun_lua, handle, {val_str, ["古树升级"], lev, all}} ,{tree_step, cb_fun_lua, handle, {key_val, ["古树进阶"], count, all}} ,{tree_limit, cb_fun_lua, handle, {type_get_val, [ "古树进阶"], [skill_num], count}} ,{elfin_com, cb_fun_lua, handle, {key_val, ["精灵合成"], id, all}} ,{elfin_reset, cb_fun_lua, handle, {type_val, ["精灵重生"], [camp_id,id], all}} ,{elfin_plan, cb_fun_lua, handle, {key_val, ["精灵方案"], [id], all}} ] ,callback_json = [ {const, cb_fun_json, handle, {key_val, ["常量配置"], key, [val, desc]}} ,{hatch_data, cb_fun_json, handle, {key_val, ["孵化器解锁配置"], id, [hatch_cond,name, res_id,sort,expend,desc1,desc2]}} ,{hatch_lev, cb_fun_json, handle, {key_val, ["孵化等级"], lev, all}} ,{hatch_egg, cb_fun_json, handle, {key_val, ["孵化配置"], item_bid, all}} ,{smash_item, cb_fun_json, handle, {key_val, ["孵化砸蛋配置"], item_bid, all}} ,{elfin_data, cb_fun_json, handle, {val_str, ["精灵技能配置"], id, all}} ,{elfin_book, cb_fun_json, handle, {type_val, ["精灵技能配置"], [step], id}} ,{elfin_skill, cb_fun_json, handle, {type_get_last_row, ["精灵技能配置"], [skill], effect_id}} ,{elfin_skill_icon, cb_fun_json, handle, {type_get_last_row, ["精灵技能配置"], [skill], icon}} ,{tree_attr, cb_fun_json, handle, {list_val, ["古树属性"], all}} ,{tree_up_lv, cb_fun_json, handle, {val_str, ["古树升级"], lev, all}} ,{tree_step, cb_fun_json, handle, {key_val, ["古树进阶"], count, all}} ,{tree_limit, cb_fun_json, handle, {type_val, [ "古树进阶"], [skill_num], count}} ,{elfin_com, cb_fun_json, handle, {key_val, ["精灵合成"], id, all}} ,{elfin_reset, cb_fun_json, handle, {type_val, ["精灵重生"], [camp_id,id], all}} ,{elfin_plan, cb_fun_json, handle, {key_val, ["精灵方案"], [id], all}} ] ,sheet = [ {["常量配置"],[ #f_column{type = term, name = key, desc = "常量标识", add_list_sign = false,mod = all} ,#f_column{type = term, name = val, desc = "常量值", add_list_sign = false,mod= all} ,#f_column{type = bstr, name = desc, desc = "描述", mod = client} ]} ,{["孵化器解锁配置"],[ #f_column{type = int, name = id, desc = "孵化器id", mod = all} ,#f_column{type = term, name = hatch_cond, desc = "解锁条件", add_list_sign = false, mod = all} ,#f_column{type = bstr, name = name, desc = "名称", mod = client} ,#f_column{type = int, name = res_id, desc = "背景id", mod = client} ,#f_column{type = int, name = sort, desc = "排序", mod = client} ,#f_column{type = term, name = expend, desc = "解锁消耗", val = "[]", mod = all} ,#f_column{type = bstr, name = desc1, desc = "解锁条件描述1", mod = client} ,#f_column{type = bstr, name = desc2, desc = "解锁条件描述2", mod = client} ]} ,{["孵化等级"],[ #f_column{type = int, name = lev, desc = "等级", mod = all} ,#f_column{type = int, name = limit_vip, desc = "vip限制", mod = all} ,#f_column{type = term, name = expend, desc = "升级需要", val = "[]", mod = all} ,#f_column{type = int, name = do_time, desc = "孵化效率", comment = "多少秒孵化1点", mod = all} ,#f_column{type = term, name = award, desc = "孵化返还", val = "[]", mod = all} ]} ,{["孵化配置"],[ #f_column{type = int, name = item_bid, desc = "蛋id", mod = all} ,#f_column{type = int, name = need_piont, desc = "所需孵化点", mod = all} ,#f_column{type = term, name = drop_id1, desc = "精灵掉落id", val = "[]", mod = all} ,#f_column{type = int, name = baodi_count, desc = "保底掉落次数", val = "0", mod = server} ,#f_column{type = kv, name = baodi_quality, kv_type = quality, desc = "保底品质", val = "999", mod = server} ,#f_column{type = term, name = baodi_dropids, desc = "保底掉落id", val = "[]", mod = server} ,#f_column{type = term, name = drop_id2, desc = "物品掉落id", val = "[]", mod = all} ,#f_column{type = term, name = award, desc = "额外固定奖励", val = "[]", mod = all} ,#f_column{type = int, name = res_id, desc = "资源id", mod = client} ,#f_column{type = bstr, name = desc, desc = "选择描述", mod = client} ,#f_column{type = int, name = can_buy, desc = "是否允许购买", val = "0", mod = all} ,#f_column{type = term, name = price, desc = "价格", val = "[]", mod = all} ,#f_column{type = int, name = limit_num, desc = "每日限购数量", val = "0", mod = all} ,#f_column{type = term, name = reset_award, desc = "孵化补偿", val = "[]", mod = all} ]} ,{["孵化砸蛋配置"],[ #f_column{type = int, name = item_bid, desc = "物品id", mod = all} ,#f_column{type = int, name = del_piont, desc = "减少孵化点", mod = all} ,#f_column{type = bstr, name = desc, desc = "选择描述", mod = client} ,#f_column{type = bstr, name = res_id, desc = "资源id", mod = client} ,#f_column{type = int, name = can_buy, desc = "是否允许购买", val = "0", mod = all} ,#f_column{type = term, name = price, desc = "价格", val = "[]", mod = all} ,#f_column{type = int, name = limit_num, desc = "每日限购数量", val = "0", mod = all} ]} ,{["古树属性"],[ #f_column{type = int, name = hp_max, desc = "初始生命", mod = all} ,#f_column{type = int, name = atk, desc = "初始攻击", mod = all} ,#f_column{type = int, name = def, desc = "初始防御", mod = all} ,#f_column{type = int, name = speed, desc = "初始速度", mod = all} ,#f_column{type = int, name = crit_rate, desc = "暴击", mod = all} ,#f_column{type = int, name = crit_ratio, desc = "暴伤", mod = all} ,#f_column{type = int, name = hit_magic, desc = "效果命中", mod = all} ,#f_column{type = int, name = dodge_magic, desc = "效果抵抗", mod = all} ,#f_column{type = int, name = hit_rate, desc = "命中", mod = all} ,#f_column{type = int, name = dodge_rate, desc = "闪避", mod = all} ,#f_column{type = int, name = add_hp, desc = "生命成长", mod = all} ,#f_column{type = int, name = add_atk, desc = "攻击成长", mod = all} ,#f_column{type = int, name = add_def, desc = "防御成长", mod = all} ,#f_column{type = int, name = add_speed, desc = "速度成长", mod = all} ]} ,{["古树升级"],[ #f_column{type = int, name = lev, desc = "等级", mod = all} ,#f_column{type = term, name = expend, desc = "消耗", mod = all} ]} ,{["古树进阶"],[ #f_column{type = int, name = count, desc = "进阶次数", mod = all} ,#f_column{type = int, name = lev_max, desc = "等级上限", mod = all} ,#f_column{type = int, name = add_hp, desc = "生命成长", mod = all} ,#f_column{type = int, name = add_atk, desc = "攻击成长", mod = all} ,#f_column{type = int, name = add_def, desc = "防御成长", mod = all} ,#f_column{type = int, name = add_speed, desc = "速度成长", mod = all} ,#f_column{type = term, name = all_attr, desc = "固定属性", val = "[]", mod = all} ,#f_column{type = int, name = skill_num, desc = "当前激活技能数", mod = all} ,#f_column{type = term, name = expend, desc = "进阶消耗", val = "[]", mod = all} ,#f_column{type = int, name = res_id, desc = "资源id", mod = client} ,#f_column{type = term, name = step_cond, desc = "进阶条件", mod = all} ]} ,{["精灵技能配置"],[ #f_column{type = int, name = id, desc = "精灵id", mod = all} ,#f_column{type = int, name = skill, desc = "技能", comment = "一个精灵只能有一个技能id", mod = all} ,#f_column{type = int, name = step, desc = "阶数", mod = client} ,#f_column{type = bstr, name = effect_id, desc = "特效资源", mod = client} ,#f_column{type = int, name = sprite_type, desc = "精灵类型", mod = all} ,#f_column{type = int, name = icon, desc = "精灵头像", mod = client} ,#f_column{type = int, name = scale_val, desc = "精灵缩放系数", mod = client} ,#f_column{type = bstr, name = offset_y, desc = "精灵上下偏移", mod = client} ,#f_column{type = int, name = power, desc = "战力属性", mod = all} ]} ,{["精灵合成"],[ #f_column{type = int, name = id, desc = "精灵id", mod = all} ,#f_column{type = term, name = expend, desc = "合成消耗", mod = all} ,#f_column{type = int, name = award, desc = "合成所得", mod = all} ]} ,{["精灵重生"],[ #f_column{type = int, name = camp_id, desc = "活动id", mod = all} ,#f_column{type = int, name = id, desc = "精灵id", mod = all} ,#f_column{type = term, name = award, desc = "重生获得", mod = all} ]} ,{["精灵方案"],[ #f_column{type = int, name = id, desc = "方案ID", mod = all} ,#f_column{type = bstr, name = name, desc = "方案初始名", mod = all} ,#f_column{type = kv, kv_type = bool, name = flag, desc = "方案初始是否开启", mod = all} ,#f_column{type = term, name = expend, desc = "开启消耗", mod = all, val = "[]"} ]} ,{["精灵布阵初始化"], [ #f_column{type = kv, kv_type = {?MODULE, get, [type]}, name = type, desc = "阵容类型", mod = all} ,#f_column{type = int, name = num, desc = "队伍数量", mod = all} ]} ] }. get(type) -> [ {"巅峰冠军赛", 95} ,{"跨服竞技场进攻", 19} ,{"跨服竞技场防守", 20} ,{"天界副本(BOSS)", 97} ,{"王者赛", 99} ]; get(_) -> []. tree_attr_val(Row) -> Attr = [hp_max, atk, def, speed, crit_rate, crit_ratio, hit_magic, dodge_magic, hit_rate, dodge_rate], ValList = [cb_fun:get_val(Atom, Row) || Atom <- Attr], {true, ?S("get_tree_attr() -> #attr{hp_max = ~s, atk = ~s, def = ~s, speed = ~s, crit_rate = ~s, crit_ratio = ~s, hit_magic = ~s, dodge_magic = ~s, hit_rate = ~s, dodge_rate = ~s}.", ValList)}. get_lev_group(Row) -> Attr = [add_hp, add_atk, add_def, add_speed], ValList = [cb_fun:get_val(Atom, Row) || Atom <- Attr], {true, ?S("get_lev_group() -> {~s, ~s, ~s, ~s}.", ValList)}.