%%---------------------------------------------------- %% 数据配置文件 %% @author whjing2011@gmail.com %%---------------------------------------------------- -module(dungeon_stone_data). -export([cfg/0, get/1]). -include("data_config.hrl"). -include("common.hrl"). cfg() -> #data_cfg{ name = dungeon_stone_data ,lua_name = dungeon_stone_data ,desc = "配置数据" ,source = "dungeon_stone_data.xml" ,target = "dungeon_stone_data.erl" ,inc = [] ,callback = [ {{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}} ,{list_id, cb_fun, handle, {list, ["副本数据"]}} ,{get, cb_fun, handle, {get_record, ["副本数据"], id, new_map, all}} ,{buy_num, cb_fun, handle, {get_record, ["次数购买"], [id, num], new_map, all}} ,{type_open, cb_fun, handle, {get_tuple, ["副本开启"], id, activate}} ] ,callback_cli = [ {const, cb_fun_lua, handle, {key_val, ["常量配置"], key, [val, desc]}} % ,{award_list, cb_fun_lua, handle, {key_val, ["副本数据"], [id], all}} ,{award_list, cb_fun_lua, handle, {type_get_val, ["副本数据"], [class_type, id], all}} ,{buy, cb_fun_lua, handle, {type_get_val, ["次数购买"], [id, num], [vip, cost]}} ,{type_open, cb_fun_lua, handle, {key_val, ["副本开启"], [id], all}} ] ,callback_json = [ {const, cb_fun_json, handle, {key_val, ["常量配置"], key, [val, desc]}} ,{award_list, cb_fun_json, handle, {type_get_val, ["副本数据"], [class_type, id], all}} ,{buy, cb_fun_json, handle, {type_get_val, ["次数购买"], [id, num], [vip, cost]}} ,{type_open, cb_fun_json, handle, {key_val, ["副本开启"], [id], all}} ] ,sheet = [ {["常量配置"], [ #f_column{type = atom, name = key, desc = "键", primary = true, mod = all} ,#f_column{type = term, name = val, desc = "值", add_list_sign=false, mod = all} ,#f_column{type = str, name = desc, 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, name = dun_type, desc = "类型", kv_type = {?MODULE, get, [dun_type]}, mod = all} ,#f_column{type = kv, name = difficulty, desc = "难度", kv_type = {?MODULE, get, [difficulty]}, mod = all} ,#f_column{type = int, name = pre_id, desc = "前置ID", mod = all} ,#f_column{type = int, name = lev_limit, desc = "等级限制", mod = all} ,#f_column{type = int, name = power, desc = "战力限制", mod = all} ,#f_column{type = int, name = unit_id, desc = "单位", mod = all} ,#f_column{type = term, name = base_items, desc = "基本奖励"} ,#f_column{type = term, name = first_items, desc = "首通奖励", mod = all} ,#f_column{type = term, name = drop_ids, desc = "掉落ID"} ,#f_column{type = term, name = show_items, desc = "展示奖励", mod = client} ,#f_column{type = bstr, name = pis_str, desc = "图片资源", mod = client} ,#f_column{type = bstr, name = title_name, desc = "标题名字", mod = client} ,#f_column{type = int, name = class_type, desc = "名字类型", mod = client} ]} ,{["次数购买"], [ #f_column{type = int, name = id, desc = "副本类型", mod = all} ,#f_column{type = int, name = num, desc = "次数", mod = all} ,#f_column{type = int, name = vip, desc = "VIP", mod = all} ,#f_column{type = int, name = cost, desc = "扫荡消耗", mod = all} ]} ,{["副本开启"], [ #f_column{type = kv, name = id, desc = "类型", kv_type = {?MODULE, get, [dun_type]}, mod = all} ,#f_column{type = term, name = activate, desc = "开启条件", mod = all} ,#f_column{type = bstr, name = desc, desc = "开启提示", mod = client} ,#f_column{type = bstr, name = name, desc = "名字", mod = client} ]} ] }. get(dun_type) -> [ {"金币副本", 1} , {"英雄副本", 2} , {"神器副本", 3} , {"经验副本", 4} , {"符文副本", 5} ]; get(difficulty) -> [ {"简单", 1} ,{"普通", 2} ,{"困难", 3} ,{"噩梦1", 4} ,{"噩梦2", 5} ,{"地狱1", 6} ,{"地狱2", 7} ,{"深渊1", 8} ,{"深渊2", 9} ].