%%---------------------------------------------------- %% 数据配置文件 %% @author yzq<741287960@qq.com> %%---------------------------------------------------- -module(dial_data). -export([cfg/0, get/1]). -include("data_config.hrl"). -include("common.hrl"). cfg() -> #data_cfg{ name = dial_data ,lua_name = dial_data ,desc = "配置数据" ,source = "dial_data.xml" ,target = "dial_data.erl" ,inc = ["common.hrl", "dial.hrl"] ,callback = [ {list, cb_fun, handle, {list, ["奖励配置"]}} ,{get_limit_open, cb_fun, handle, {get_tuple, ["奖励配置"], [type, type2], limit_open}} ,{get_expend_item, cb_fun, handle, {get_tuple, ["奖励配置"], [type, type2], expend_item}} ,{{get_expend_gold, "[]"}, cb_fun, handle, {get_tuple, ["奖励配置"], [type, type2], expend_gold}} ,{{get_add_item, "[]"}, cb_fun, handle, {get_tuple, ["奖励配置"], [type, type2], add_item}} ,{{get_add_lucky, "0"}, cb_fun, handle, {get_tuple, ["奖励配置"], [type, type2], add_lucky}} ,{get_rand_id, cb_fun, handle, {get_tuple, ["奖励配置"], [type, type2], rand_id}} ,{get_count, cb_fun, handle, {get_tuple, ["奖励配置"], [type, type2], count}} ,{get_rand_list, cb_fun, handle, {tuple_type, ["随机库"], [type, pos], [id, min_lev, max_lev, pro, limit_count]}} ,{get_item_must_no_count, cb_fun, handle, {get_tuple, ["随机库"], [type, id], must_no_count}} ,{get_award_by_id, cb_fun, handle, {get_tuple, ["随机库"], id, [item_id, item_num, notice]}} ,{get_rand_pos, cb_fun, handle, {tuple_type, ["转盘抽取概率"], type, [pos, pro]}} ,{get_pos_must_no_count, cb_fun, handle, {get_tuple, ["转盘抽取概率"], [type, pos], must_no_count}} ,{get_lucky_award, cb_fun, handle, {tuple_type, ["幸运值奖励"], type, all}} ,{get_lucky_list, cb_fun, handle, {tuple_type, ["幸运值奖励"], type, id}} ,{get_del_lucky, cb_fun, handle, {get_tuple, ["幸运值奖励"], [type, id], lucky_val}} ,{{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}} ] ,callback_cli = [ {const, cb_fun_lua, handle, {key_val, ["常量配置"], key, [val, desc]}} ,{rewards, cb_fun_lua, handle, {key_val, ["转盘展示道具"], [id],all}} ,{get_limit_open, cb_fun_lua, handle, {list_val, ["奖励配置"], all}} ,{get_lucky_award, cb_fun_lua, handle, {list_val, ["幸运值奖励"], all}} ,{get_rand_list, cb_fun_lua, handle, {list_val, ["随机库"], [id], all}} ,{magnificat_list, cb_fun_lua, handle, {type_get_val, ["倍率表"], [round_id,id], all}} ] ,callback_json = [ {const, cb_fun_json, handle, {key_val, ["常量配置"], key, [val, desc]}} ,{rewards, cb_fun_json, handle, {key_val, ["转盘展示道具"], [id],all}} ,{get_limit_open, cb_fun_json, handle, {list_val, ["奖励配置"], all}} ,{get_lucky_award, cb_fun_json, handle, {list_val, ["幸运值奖励"], all}} ,{get_rand_list, cb_fun_json, handle, {list_val, ["随机库"], [id], all}} ,{magnificat_list, cb_fun_json, handle, {type_get_val, ["倍率表"], [round_id,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 = bstr, name = desc, desc = "描述", mod = all} ]}, {["奖励配置"], [ #f_column{type = kv, name = type, kv_type = {?MODULE, get, [type]}, desc = "类型", mod = all} ,#f_column{type = kv, name = type2, kv_type = {?MODULE, get, [type2]}, desc = "消耗类型", mod = all} ,#f_column{type = term, name = limit_open, desc = "开启要求", mod = all} ,#f_column{type = term, name = expend_item, desc = "道具消耗", mod = all} ,#f_column{type = term, name = expend_gold, desc = "资产消耗", mod = all} ,#f_column{type = term, name = add_item, desc = "固定奖励", mod = all} ,#f_column{type = int, name = add_lucky, desc = "增加幸运值", mod = all} ,#f_column{type = int, name = rand_id, desc = "随机库id", mod = all} ,#f_column{type = int, name = count, desc = "召唤次数", val = "0", mod = all} ]}, {["随机库"], [ #f_column{type = kv, name = type, kv_type = {?MODULE, get, [type]}, desc = "类型", mod = all} ,#f_column{type = int, name = pos, desc = "位置", mod = all} ,#f_column{type = int, name = id, desc = "子id", comment = "服务端缓存了子id数据, 后续修改删除子id需要跟服务端沟通", mod = all} ,#f_column{type = int, name = min_lev, desc = "等级最小值", val = "0", comment = "判断玩家等级>=最小值才能抽取", mod = server} ,#f_column{type = int, name = max_lev, desc = "等级最大值", val = "9999", comment = "判断玩家等级<最大值才能抽取", mod = server} ,#f_column{type = bstr, name = name, desc = "物品名字", mod = all} ,#f_column{type = int, name = item_id, desc = "物品bid", mod = all} ,#f_column{type = int, name = item_num, desc = "数量", mod = all} ,#f_column{type = int, name = pro, desc = "权重", mod = server} ,#f_column{type = int, name = notice, desc = "是否传闻", mod = server} ,#f_column{type = int, name = limit_count, desc = "获得次数限制", val = "999999", mod = server} ,#f_column{type = int, name = must_no_count, desc = "抽中后M次不出", val = "0", mod = server} ]}, {["转盘抽取概率"], [ #f_column{type = kv, name = type, kv_type = {?MODULE, get, [type]}, desc = "类型", mod = server} ,#f_column{type = int, name = pos, desc = "位置", mod = server} ,#f_column{type = int, name = pro, desc = "权重", mod = server} ,#f_column{type = int, name = must_no_count, desc = "抽中后M次不出", val = "0", mod = server} ]}, {["幸运值奖励"], [ #f_column{type = kv, name = type, kv_type = {?MODULE, get, [type]}, desc = "类型", mod = all} ,#f_column{type = int, name = id, desc = "id", mod = all} ,#f_column{type = int, name = lucky_val, desc = "幸运值", mod = all} ,#f_column{type = term, name = award, desc = "奖励", mod = all} ]}, {["倍率表"], [ #f_column{type = int, name = id, desc = "ID", mod = all} ,#f_column{type = int, name = round_id, desc = "转盘ID", mod = all} ,#f_column{type = int, name = min, desc = "最少等级", mod = all} ,#f_column{type = int, name = max, desc = "最大等级", mod = all} ,#f_column{type = term, name = award, desc = "最大等级", mod = all} ]} ] }. get(type) -> [ {"幸运探宝", 1}, {"高级探宝", 2} ]; get(type2) -> [ {"单抽", 1}, {"连抽", 2} ].