104 lines
6.7 KiB
Erlang
104 lines
6.7 KiB
Erlang
|
|
%%%-------------------------------------------------------------------
|
||
|
|
%%% @author liwl <assistabc@qq.com>
|
||
|
|
%%% @copyright (C) 2017, liwl
|
||
|
|
%%% @doc
|
||
|
|
%%% 成就
|
||
|
|
%%% @end
|
||
|
|
%%% Created : 9 May 2017 by liwl <assistabc@qq.com>
|
||
|
|
%%%-------------------------------------------------------------------
|
||
|
|
-module(feat_data).
|
||
|
|
-export([cfg/0, get/1]).
|
||
|
|
-include("data_config.hrl").
|
||
|
|
|
||
|
|
cfg() ->
|
||
|
|
#data_cfg{
|
||
|
|
name = feat_data
|
||
|
|
,lua_name = feat_data
|
||
|
|
,desc = "成就数据"
|
||
|
|
,splitv = 2
|
||
|
|
,source = "feat_data.xml"
|
||
|
|
,target = "feat_data.erl"
|
||
|
|
,inc = ["common.hrl", "quest.hrl", "gain.hrl", "condition.hrl"]
|
||
|
|
,callback = [
|
||
|
|
{list, cb_fun, handle, {list, ["成就数据"]}}
|
||
|
|
,{lev, cb_fun, handle, {tuple_type, ["成就数据"], lev, id}}
|
||
|
|
,{{suffix_quest, "undefined"}, cb_fun, handle, {get_tuple, ["成就数据"], id, suffix_quest}}
|
||
|
|
,{{dungeon_feat, "[]"}, cb_fun, handle, {tuple_type, ["成就数据"], dungeon_id, id}}
|
||
|
|
,{get, cb_fun, handle, {get_record, ["成就数据"], id, quest_data, all}}
|
||
|
|
,{get_reward, cb_fun, handle, {get_tuple, ["成就点数奖励"], id, all}}
|
||
|
|
]
|
||
|
|
,callback_cli = [
|
||
|
|
{get, cb_fun_lua, handle, {key_val, ["成就数据"], id, [id, name, lev, desc, progress, extra, commit_rewards, res, hide, first_label, ach_point]}}
|
||
|
|
,{get_reward, cb_fun_lua, handle, {key_val, ["成就点数奖励"], id, all}}
|
||
|
|
]
|
||
|
|
,callback_json = [
|
||
|
|
{get, cb_fun_json, handle, {key_val, ["成就数据"], id, [id, name, lev, desc, progress, extra, commit_rewards, res, hide, first_label, ach_point]}}
|
||
|
|
,{get_reward, cb_fun_json, handle, {key_val, ["成就点数奖励"], id, all}}
|
||
|
|
]
|
||
|
|
,sheet = [
|
||
|
|
{["成就数据"],
|
||
|
|
[#f_column{type = int, primary = true, name = id, desc = "ID", mod = all}
|
||
|
|
, #f_column{type = bstr, name = name, desc = "名称", mod = all}
|
||
|
|
, #f_column{type = kv, name = type, kv_type = {?MODULE, get, [type]}, desc = "类型", mod = all}
|
||
|
|
, #f_column{type = int, name = lev, min = 1, max = 1000, desc = "等级", mod = all}
|
||
|
|
, #f_column{desc = "前置任务", type = term, name = pre_quest, valid_list = [undefined, all, integer], val = 0,
|
||
|
|
add_list_sign = false, comment = "[10001, 10002]表示需完成其中一个前置任务 \n[0, 10001, 10002]表示需要完成所有的制定任务"
|
||
|
|
}
|
||
|
|
, #f_column{desc = "后置任务", type = term, name = suffix_quest, add_list_sign = false}
|
||
|
|
, #f_column{type = kv, name = val_from_prev, desc = "继承前置任务值", kv_type = bool}
|
||
|
|
, #f_column{type = kv, name = hide, desc = "是否隐藏", kv_type = bool, mod = client}
|
||
|
|
, #f_column{type = int, name = dungeon_id, desc = "关卡限制"}
|
||
|
|
, #f_column{type = rec, name = condition, width = 360, spilt_str = ";", rec = condition, desc = "接受条件限制",
|
||
|
|
fields = [#f_column{type = kv, name = label, kv_type = cond_label, desc = "条件标签"}
|
||
|
|
, #f_column{type = kv, name = op, kv_type = cond_op, desc = "比较运算符"}
|
||
|
|
, #f_column{type = term, name = val, add_list_sign = false, desc = "条件要求值"}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
, #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 = extra, add_list_sign = false, comment = "每一项需要用“{}”包括:[{type, 1}, {id, 1}]", def_cli_val = "{}", mod = all}
|
||
|
|
, #f_column{type = bstr, name = desc, desc = "描述", mod = all}
|
||
|
|
, #f_column{desc = "成就奖励", type = term, name = commit_rewards, comment = "奖励格式:{物品基础Id, 数量}, {物品基础Id, 数量}", width = 360, mod = all}
|
||
|
|
, #f_column{type = int, name = end_time, desc = "过期时间(秒)", comment = "0或不填表示永久", mod = server}
|
||
|
|
, #f_column{desc = "展示图标", type = bstr, name = res, width = 360, mod = client}
|
||
|
|
, #f_column{desc = "百分比人数", type = int, name = people_num, mod = client}
|
||
|
|
, #f_column{desc = "一级标签类型", type = bstr, name = first_label, mod = client}
|
||
|
|
, #f_column{desc = "成就点数", type = int, name = ach_point, mod = all}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
, {["成就点数奖励"],
|
||
|
|
[#f_column{desc = "奖励id", type = int, name = id, mod = all}
|
||
|
|
, #f_column{desc = "值", type = int, name = val, mod = all}
|
||
|
|
, #f_column{desc = "奖励", type = term, name = rewards, mod = all}
|
||
|
|
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}.
|
||
|
|
|
||
|
|
get(type) ->
|
||
|
|
[
|
||
|
|
{"默认类型", 0},
|
||
|
|
{"默認類型", 0}
|
||
|
|
].
|