Files
fc/server/tools/gen_data/cfg/days_rank_data.erl
T

118 lines
8.6 KiB
Erlang
Raw Normal View History

2026-05-23 22:10:14 +08:00
%%----------------------------------------------------
%% 数据配置文件
%% 七天排行
%% @author liwl
%%----------------------------------------------------
-module(days_rank_data).
-export([cfg/0]).
-include("data_config.hrl").
-include("common.hrl").
cfg() ->
TimeComment0 = "{open_day, Day} | {open_day, Day, OffSetSec} 开服时间
{merge_day, Day} | {merge_day, Day, OffSetSec} 合服时间
{{Year,Month,Day},{Hour,Minu,Sec}} 指定日期
",
#data_cfg{
name = days_rank_data
,lua_name = days_rank_data
,desc = "七天排行配置数据"
,source = "days_rank_data.xml"
,target = "days_rank_data.erl"
,inc = ["quest.hrl"]
,callback =
[{{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}}
, {list, cb_fun, handle, {record_type, ["排行榜"], is_cluster, new_map, [id, start_time, end_time]}}
, {get, cb_fun, handle, {get_record, ["排行榜"], id, new_map, all}}
, {type_id, cb_fun, handle, {get_tuple, ["排行榜"], rank_type, id}}
, {ids, cb_fun, handle, {tuple_type, ["排行榜"], is_cluster, id}}
, {get_quest, cb_fun, handle, {get_record, ["七天排行任务"], id, quest_data, [id, progress]}}
, {get_quest_rank_id, cb_fun, handle, {get_tuple, ["七天排行任务"], id, rank_id}}
, {get_quest_ids, cb_fun, handle, {tuple_type, ["七天排行任务"], rank_id, id}}
, {get_quest_rewards, cb_fun, handle, {get_tuple, ["七天排行任务"], id, rewards}}
, {explore, cb_fun, handle, {get_tuple, ["神界探索度"], id, val}}
, {reward, cb_fun, handle, {get_fun, ["排行榜奖励"], "reward({~ts, Idx}) when Idx >= ~ts andalso Idx =< ~ts -> #{\n name => ~ts, \n rewards => ~ts, \n subject => ~ts, \n content => ~ts\n};", [id, low, high, name, rewards, subject, content]}}
]
,callback_cli = [
{rank_data_const, cb_fun_lua, handle, {key_val, ["常量配置"], [key], all}}
,{rank_data, cb_fun_lua, handle, {type_val, ["排行榜奖励"], [id], all}}
,{rank_list,[{data_reverse, 1}],cb_fun_lua,handle, {type_val,["排行榜"],[id],[id,name,rank_type,tips_rule,jump,ico,tips_str,evt_type,extend]}}
,{rank_quest, cb_fun_lua, handle, {type_val, ["七天排行任务"], [rank_id], [id, desc, rewards, effect_list, target_desc]}}
,{rank_quest_id, cb_fun_lua, handle, {key_val, ["七天排行任务"], [id], all}}
]
,callback_json = [
{rank_data_const, cb_fun_json, handle, {key_val, ["常量配置"], [key], all}}
,{rank_data, cb_fun_json, handle, {type_val, ["排行榜奖励"], [id], all}}
,{rank_list,[{data_reverse, 1}], cb_fun_json, handle, {type_val,["排行榜"],[id],[id,name,rank_type,tips_rule,jump,ico,tips_str,evt_type,extend]}}
,{rank_quest, cb_fun_json, handle, {type_val, ["七天排行任务"], [rank_id], [id, desc, rewards, effect_list, target_desc]}}
,{rank_quest_id, cb_fun_json, handle, {key_val, ["七天排行任务"], [id], all}}
]
,sheet =
[
{["常量配置"],
[#f_column{desc = "", type = atom, name = key, primary = true, mod = all}
, #f_column{desc = "", type = term, name = val, add_list_sign=false, mod = all}
, #f_column{desc = "描述", type = str, name = desc, mod = all}
]}
, {["排行榜"],
[#f_column{desc = "编号", type = int, name = id}
, #f_column{desc = "名称", type = bstr, name = name, mod = all}
, #f_column{desc = "排行榜类型", type = kv, kv_type = rank_type, name = rank_type, mod = all}
, #f_column{desc = "临时排行榜", type = kv, kv_type = bool, name = is_temp, val = 0}
, #f_column{desc = "开始时间", type = term, name = start_time, add_list_sign = false, comment = TimeComment0, width = 200}
, #f_column{desc = "结束时间", type = term, name = end_time, add_list_sign = false, comment = TimeComment0, width = 200}
, #f_column{desc = "详细规则", type = bstr, name = tips_rule, mod = client}
, #f_column{desc = "跳转排行榜类型", type = int, name = jump, mod = client}
, #f_column{desc = "排行榜图标", type = int, name = ico, mod = client}
, #f_column{desc = "说明文本", type = bstr, name = tips_str, mod = client}
, #f_column{desc = "是否跨服", type = kv, kv_type = bool, name = is_cluster, val = 0}
, #f_column{desc = "主城图标", type = int, name = main_ico}
, #f_column{desc = "事件标签", type = bstr, name = evt_type, mod = client}
, #f_column{desc = "参数", type = term, name = extend, mod = client}
]}
, {["七天排行任务"],
[#f_column{desc = "编号", type = int, name = rank_id}
, #f_column{desc = "任务id", type = int, name = id, mod = all}
, #f_column{desc = "任务描述", type = bstr, name = desc, mod = client}
, #f_column{desc = "达成条件", type = func, name = progress, width = 360, spilt_str = ";", type_func = {quest_data, progress},
fields = [
#f_column{desc = "服务端事件", type = term, name = label, add_list_sign = false}
, #f_column{desc = "客户端标签", type = str, name = cli_label, mod = client}
, #f_column{desc = "目标值", type = int, name = target, mod = all}
, #f_column{desc = "目标需求值", type = int, name = target_val, mod = all}
, #f_column{desc = "服务端附加参数", type = term, name = param, add_list_sign = false}
, #f_column{desc = "客户端附加参数", type = term, name = param, add_list_sign = false, mod = client}
],
valid_list = [
{atom, integer, integer},
{atom, integer, integer, term},
{atom, atom, integer, integer, term}
],
comment = "{事件标签, 目标值, 目标需求值, 附加参数} 或 {服务端事件标签, 服务端事件标签, 目标值, 目标需求值, 附加参数}\n"
"事件标签/服务端事件标签/客户端事件标签:英文字符串;\n"
"目标值:整数\n"
"目标需求值:整数\n"
"附加参数需要用“[]”包括,其中每一项需要用“{}”包括:[{monitor}, {type, 1}]\n"
"多个任务目标用“;”(分号)分隔,例如: {evt_get_item, 10001, 1, [{monitor}]};{evt_use_item, 10001, 1, [{type, 1}]}",
mod = all
}
, #f_column{desc = "奖励内容", type = term, name = rewards, comment = "奖励格式:{物品基础Id, 数量}, {物品基础Id, 数量}", width = 360, mod = all}
, #f_column{desc = "特效物品", type = term, name = effect_list, mod = client}
, #f_column{desc = "进度文本", type = bstr, name = target_desc, mod = client}
]}
, {["排行榜奖励"],
[#f_column{desc = "编号", type = int, name = id, mod = all}
, #f_column{desc = "名称", type = bstr, name = name}
, #f_column{desc = "高排名", type = int, name = high, mod = all}
, #f_column{desc = "低排名", type = int, name = low, mod = all}
, #f_column{desc = "奖励", type = term, name = rewards, width = 300, comment = "{道具id, 数量}, {道具id, 数量}",mod = all}
, #f_column{desc = "邮件标题", type = bstr, name = subject, width = 360}
, #f_column{desc = "邮件内容", type = bstr, name = content, width = 360}
, #f_column{desc = "特效物品", type = term, name = effect_list, mod = client}
]}
, {["神界探索度"],
[#f_column{desc = "层ID", type = int, name = id, mod = all}
, #f_column{desc = "探索度", type = int, name = val, mod = all}
]}
]
}.