Files
fc/server/tools/gen_data/cfg/planes_data.erl
T
2026-05-23 22:10:14 +08:00

282 lines
19 KiB
Erlang
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%%----------------------------------------------------
%% 数据配置文件
%% @author linguohui
%%----------------------------------------------------
-module(planes_data).
-export([
cfg/0
,get/1
]).
-include("data_config.hrl").
-include("common.hrl").
cfg() ->
#data_cfg{
name = planes_data
,lua_name = planes_data
,js_name = planes_data
,desc = "配置数据"
,source = "planes_data.xml"
,target = "planes_data.erl"
,splitv = 1
,head_rows = 1
,inc = ["planes.hrl"]
,callback = [
{{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}}
,{get_map_id, cb_fun, handle, {get_fun, ["副本信息"], "get_map_id({~ts, ~ts}) -> {~ts, ~ts};", [floor, difficulty, first_map_id, map_id]}}
,{get_event_id, cb_fun, handle, {tuple_list, ["层数信息"], [map_id, line, tile1, tile2, tile3, tile4, tile5]}}
,{{get_events, undefined}, cb_fun, handle, {get_tuple, ["事件组"], evt_gid, ids}}
,{get_evt, cb_fun, handle, {get_record, ["事件"], id, planes_evt_data, [id, type, ext, reward_list, exchange_id, group_id]}}
,{get_event_type, cb_fun, handle, {get_tuple, ["事件"], id, type}}
,{get_floor_reward, cb_fun, handle, {get_fun, ["通关奖励"], "get_floor_reward({~ts, ~ts, Lev}) when Lev >= ~ts andalso Lev =< ~ts -> ~ts;", [floor, difficulty, lev_low, lev_high, reward]}}
,{{get_group, undefined}, cb_fun, handle, {get_tuple, ["事件"], id, group_id}}
,{get_reward, cb_fun, handle, {get_fun, ["奖励信息"], "get_reward({~ts, Lev}) when Lev >= ~ts andalso Lev =< ~ts -> {~ts, ~ts};", [id, min, max, type, ext]}}
,{get_robot_ids, cb_fun, handle, {get_fun, ["怪物机器人库_1", "怪物机器人库_2", "怪物机器人库_3"], "get_robot_ids({~ts, Power}) when Power >= ~ts andalso Power =< ~ts -> ~ts;", [id, min, max, robot]}}
,{get_guard_ext, cb_fun, handle, {get_fun, ["战力段对应守卫强度"], "get_guard_ext({~ts, Power}) when Power >= ~ts andalso Power =< ~ts -> ~ts;", [id, min, max, ext]}}
,{get_monster_ids, cb_fun, handle, {get_fun, ["守卫机器人库"], "get_monster_ids({~ts, ~ts, Power}) when Power >= ~ts andalso Power =< ~ts -> ~ts;", [floor, difficulty, min, max, robot]}}
,{get_buffs, cb_fun, handle, {tuple_list, ["buff库"], [group_id, buff_id, weight, is_return, weight_ext]}}
,{get_buff, cb_fun, handle, {get_tuple, ["buff信息"], buff_id, [range, ext, floors]}}
,{get_buff_client, cb_fun, handle, {get_tuple, ["buff信息"], buff_id, [quality, add_power, floors]}}
,{{get_session, undefined}, cb_fun, handle, {get_tuple, ["第一次对话"], condition, id}}
,{get_buff_attr, cb_fun, handle, {get_tuple, ["加属性Buff数据"], id, attr_ext}}
,{get_businessman, cb_fun, handle, {tuple_list, ["商人"], [min, max, pos, id, weight]}}
,{get_businessman_item, cb_fun, handle, {get_tuple, ["商人"], id, [base_id, num, price, type]}}
%% ,{get_all_loan_partner, cb_fun, handle, {tuple_type, ["租借机器人"], bid, [id, power, bid]}}
%% ,{get_all_robot_id_power, cb_fun, handle, {tuple_list, ["租借机器人"], [id, power]}}
%% ,{get_loan_partner, cb_fun, handle, {get_record, ["租借机器人"], id, new_map, all}}
,{get_match_power_type, cb_fun, handle, {tuple_list, ["英雄池抽取配置"], [id, min_power, max_power, max_num, star]}}
,{get_macth_limit_match_power, cb_fun, handle, {get_fun, ["英雄池匹配范围配置"], "get_macth_limit_match_power(Power) when Power >= ~ts andalso Power =< ~ts -> ~ts;", [min_power, max_power, macth_limit_match_power]}}
,{get_macth_limit_match_power_robot, cb_fun, handle, {get_fun, ["保底机器人匹配配置"], "get_macth_limit_match_power_robot(Power) when Power >= ~ts andalso Power =< ~ts -> ~ts;", [min_power, max_power, macth_limit_match_power]}}
,{get_match_group_rand_list, cb_fun, handle, {tuple_type, ["英雄库区分"], [group_id, group], [bid, pro]}}
,{get_match_pos_rand_list, cb_fun, handle, {get_tuple, ["英雄池位置匹配配置"], pos, groups}}
,{get_event_name, cb_fun, handle, {get_tuple, ["事件"], id, name}}
,{get_guard_match, cb_fun, handle, {get_fun, ["守卫跨服配置"], "get_guard_match(WorldLev) when WorldLev >= ~ts andalso WorldLev =< ~ts -> {~ts,~ts};", [min_lev, max_lev, min_val, max_val]}}
,{{get_buff_group, undefined}, cb_fun, handle, {get_tuple, ["buff信息"], buff_id, group}}
]
,callback_cli = [
{const, cb_fun_lua, handle, {key_val, ["常量配置"], key, [val, desc]}}
% ,{dun_map, cb_fun_lua, handle, {type_get_val, ["层数信息"], [id, floor], [map_res_id]}}
% ,{dun_info, cb_fun_lua, handle, {type_get_last_row, ["层数信息"], [floor], [name, dun_res_id]}}
% ,{max_dun_num, cb_fun_lua, handle, {type_get_max, ["层数信息"], [id], floor}}
,{customs, cb_fun_lua, handle, {key_val, ["副本信息"], map_id, all}}
,{evt_info, cb_fun_lua, handle, {key_val, ["事件"], id, all}}
,{shop_info, cb_fun_lua, handle, {key_val, ["商人"], id, all}}
,{reward_info, cb_fun_lua, handle, {list_val, ["奖励信息"], id, [min, max, reward]}}
% ,{dialogue, cb_fun_lua, handle, {key_val, ["奖励Npc"], id, [dialogue, answer]}}
% ,{drama, cb_fun_lua, handle, {key_val, ["第一次对话"], id, [dialogue]}}
% ,{board, cb_fun_lua, handle, {key_val, ["广告牌"], id, all}}
,{buff, cb_fun_lua, handle, {key_val, ["buff信息"], buff_id, [buff_id, name, desc, quality, range, res_id]}}
]
,callback_json = [
{const, cb_fun_json, handle, {key_val, ["常量配置"], key, [val, desc]}}
% ,{dun_map, cb_fun_json, handle, {type_get_val, ["层数信息"], [id, floor], [map_res_id]}}
% ,{dun_info, cb_fun_json, handle, {type_get_last_row, ["层数信息"], [floor], [name, dun_res_id]}}
% ,{max_dun_num, cb_fun_json, handle, {type_get_max, ["层数信息"], [id], floor}}
,{customs, cb_fun_json, handle, {key_val, ["副本信息"], map_id, all}}
,{evt_info, cb_fun_json, handle, {key_val, ["事件"], id, all}}
,{shop_info, cb_fun_json, handle, {key_val, ["商人"], id, all}}
,{reward_info, cb_fun_json, handle, {list_val, ["奖励信息"], id, [min, max, reward]}}
% ,{dialogue, cb_fun_json, handle, {key_val, ["奖励Npc"], id, [dialogue, answer]}}
% ,{drama, cb_fun_json, handle, {key_val, ["第一次对话"], id, [dialogue]}}
% ,{board, cb_fun_json, handle, {key_val, ["广告牌"], id, all}}
,{buff, cb_fun_json, handle, {key_val, ["buff信息"], buff_id, [buff_id, name, desc, quality, range, res_id]}}
]
,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 = map_id, desc = "地图id", mod = all}
,#f_column{type = int, name = line, desc = "行数", mod = all}
,#f_column{type = int, name = tile1, desc = "格子1", val = 0}
,#f_column{type = int, name = tile2, desc = "格子2", val = 0}
,#f_column{type = int, name = tile3, desc = "格子3", val = 0}
,#f_column{type = int, name = tile4, desc = "格子4", val = 0}
,#f_column{type = int, name = tile5, desc = "格子5", val = 0}
]}
,{["副本信息"], [
#f_column{type = int, name = floor, desc = "层数", mod = all}
,#f_column{type = kv, kv_type = {?MODULE, get, [difficulty]}, name = difficulty, desc = "难度", mod = all}
,#f_column{type = int, name = first_map_id, desc = "首次地图id", mod = all}
,#f_column{type = int, name = map_id, desc = "地图id", mod = all}
,#f_column{type = bstr, name = res_id, desc = "地图资源", mod = client}
]}
,{["通关奖励"], [
#f_column{type = int, name = floor, desc = "层数", mod = all}
,#f_column{type = kv, kv_type = {?MODULE, get, [difficulty]}, name = difficulty, desc = "难度", mod = all}
,#f_column{type = int, name = lev_low, desc = "等级下限", mod = all}
,#f_column{type = int, name = lev_high, desc = "等级上限", mod = all}
,#f_column{type = term, name = reward, desc = "通关奖励"}
]}
,{["事件组"], [
#f_column{type = int, name = evt_gid, desc = "事件组ID"}
,#f_column{type = term, name = ids, desc = "{事件ID, 权重, 次数}"}
]}
,{["事件"], [
#f_column{type = int, name = id, desc = "事件ID", mod = all}
,#f_column{type = bstr, name = name, desc = "事件名称", mod = client}
,#f_column{type = kv, kv_type = {?MODULE, get, [type]}, name = type, desc = "事件类型", mod = all}
,#f_column{type = term, name = ext, desc = "额外参数", mod = all}
,#f_column{type = int, name = group_id, desc = "多选一对应组别", val = 0, mod = all}
,#f_column{type = int, name = exchange_id, desc = "转换事件Id", val = 0, mod = all}
,#f_column{type = term, name = reward_list, desc = "奖励列表", mod = all}
,#f_column{type = term, name = res_1, desc = "事件完成前的资源", mod = client, comment = "1为图片,2为特效,不填则不显示"}
,#f_column{type = term, name = res_2, desc = "事件完成后的资源", mod = client, comment = "1为图片,2为特效,不填则不显示"}
,#f_column{type = term, name = offset, desc = "事件资源偏移值", mod = client, comment = "x,yx为横向偏移,y为纵向偏移"}
,#f_column{type = term, name = reward, desc = "奖励展示", mod = all}
,#f_column{type = int, name = reversal, desc = "是否翻转", comment = "填1为翻转,否则不翻转",mod = all}
,#f_column{type = kv, name = is_hide , kv_type = bool, desc = "不活跃是否隐藏", mod = client}
]}
,{["战力段对应守卫强度"], [
#f_column{type = int, name = 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 = ext, desc = "守卫参数", mod = all}
]}
,{["奖励信息"], [
#f_column{type = int, name = id, desc = "奖励Id", mod = all}
,#f_column{type = kv, kv_type = {?MODULE, get, [reward_type]}, name = type, desc = "奖励类型"}
,#f_column{type = term, name = ext, desc = "额外参数"}
,#f_column{type = bstr, name = desc, desc = "备注"}
,#f_column{type = int, name = min, desc = "等级下限", mod = all}
,#f_column{type = int, name = max, desc = "等级上限", mod = all}
,#f_column{type = term, name = reward, desc = "奖励展示", mod = client}
]}
,{["守卫机器人库"], [
#f_column{type = int, name = floor, desc = "层数", mod = all}
,#f_column{type = kv, kv_type = {?MODULE, get, [difficulty]}, name = difficulty, desc = "难度", 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 = robot, desc = "机器人匹配{id, weight}", mod = all}
]}
,{["怪物机器人库_1"], [
#f_column{type = int, name = 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 = robot, desc = "机器人匹配{id, weight}", mod = all}
]}
,{["怪物机器人库_2"], [
#f_column{type = int, name = 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 = robot, desc = "机器人匹配{id, weight}", mod = all}
]}
,{["怪物机器人库_3"], [
#f_column{type = int, name = 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 = robot, desc = "机器人匹配{id, weight}", mod = all}
]}
,{["buff信息"], [
#f_column{type = int, name = buff_id, desc = "Buff", mod = all}
,#f_column{type = bstr, name = name, desc = "名字", mod = client}
,#f_column{type = bstr, name = desc, desc = "描述", mod = client}
,#f_column{type = kv, name = quality, kv_type = {?MODULE, get, [quality]}, desc = "品质", mod = all}
,#f_column{type = term, name = range, desc = "生效范围", mod = all, val = "[]"}
,#f_column{type = term, name = ext, desc = "效果参数", mod = all}
,#f_column{type = bstr, name = res_id, desc = "图标", mod = client}
,#f_column{type = int, name = add_power, desc = "战力加成", mod = mod, val = 0}
,#f_column{type = term, name = floors, desc = "生效层数", mod = all, val = "[]"}
,#f_column{type = term, name = group, desc = "加成组", mod = all, add_list_sign = false}
]}
,{["buff库"], [
#f_column{type = int, name = group_id, desc = "", mod = all}
,#f_column{type = int, name = buff_id, desc = "buff", mod = all}
,#f_column{type = int, name = weight, desc = "随机权重", mod = all}
,#f_column{type = kv, name = is_return, kv_type = bool, desc = "是否放回", mod = all}
,#f_column{type = term, name = weight_ext, desc = "权重加成", mod = all, val = "[]"}
]}
,{["加属性Buff数据"], [
#f_column{type = int, name = id, desc = "ID", mod = all}
,#f_column{type = term, name = attr_ext, desc = "属性参数", mod = all}
]}
,{["第一次对话"], [
#f_column{type = term, name = condition, desc = "对话触发条件", mod = all}
,#f_column{type = int, name = id, desc = "对话Id", mod = all}
,#f_column{type = term, name = dialogue, desc = "对话", mod = client}
]}
,{["商人"], [
#f_column{type = int, name = id, desc = "id", mod = all}
,#f_column{type = int, name = pos, desc = "格子位置", mod = server}
,#f_column{type = int, name = min, desc = "等级下限", mod = server}
,#f_column{type = int, name = max, desc = "等级上限", mod = server}
,#f_column{type = int, name = base_id, desc = "物品id", mod = all}
,#f_column{type = int, name = num, desc = "物品数量", mod = all}
,#f_column{type = int, name = weight, desc = "权重", mod = server}
,#f_column{type = int, name = price, desc = "价格", mod = all}
,#f_column{type = kv, name = type, kv_type = gain_label, desc = "支付类型", mod = all}
,#f_column{type = int, name = discount, desc = "折扣标签", val = 0, mod = all}
]}
,{["英雄池抽取配置"], [
#f_column{type = int, name = star, desc = "对应星级", mod = all}
,#f_column{type = int, name = id, desc = "区间id", mod = all}
,#f_column{type = int, name = min_power, desc = "战力下限", val = "0", mod = all}
,#f_column{type = int, name = max_power, desc = "战力上限", val = "999999999", mod = all}
,#f_column{type = int, name = max_num, desc = "抽取数量", mod = all}
]}
,{["英雄池匹配范围配置"], [
#f_column{type = int, name = min_power, desc = "匹配战力下限", val = "0", mod = all}
,#f_column{type = int, name = max_power, desc = "匹配战力上限", val = "999999999", mod = all}
,#f_column{type = term, name = macth_limit_match_power, desc = "战力匹配筛选范围", mod = all}
]}
,{["保底机器人匹配配置"], [
#f_column{type = int, name = min_power, desc = "匹配战力下限", val = "0", mod = all}
,#f_column{type = int, name = max_power, desc = "匹配战力上限", val = "999999999", mod = all}
,#f_column{type = term, name = macth_limit_match_power, desc = "战力匹配筛选范围", mod = all}
]}
,{["英雄库区分"], [
#f_column{type = int, name = group_id, desc = "组ID", mod = all}
,#f_column{type = int, name = group, desc = "库ID", mod = all}
,#f_column{type = int, name = bid, desc = "伙伴bid", mod = all}
,#f_column{type = int, name = pro, desc = "基础权重", mod = all}
]}
,{["英雄池位置匹配配置"], [
#f_column{type = int, name = pos, desc = "位置", mod = all}
,#f_column{type = term, name = groups, desc = "英雄库权重", mod = all}
]}
,{["守卫跨服配置"], [
#f_column{type = int, name = min_lev, desc = "世界等级下限", mod = all}
,#f_column{type = int, name = max_lev, desc = "世界等级上限", mod = all}
,#f_column{type = int, name = min_val, desc = "向下扩展服", mod = all}
,#f_column{type = int, name = max_val, desc = "向上扩展服", mod = all}
]}
]
}.
get(type) ->
[
{"空事件", 0}
,{"怪物", 1}
,{"守卫", 2}
,{"英雄恢复(回复泉水)", 3}
,{"英雄恢复(复活十字架)", 4}
,{"英雄租借", 5}
,{"遗物", 6}
,{"商人", 7}
];
get(reward_type) ->
[
{"获得物品", 1}
,{"掉落奖励", 2}
];
get(quality) ->
[
{"", 1}
,{"", 2}
,{"", 3}
];
get(buff_type) ->
[
{"加Buff", 1}
,{"加被动", 2}
];
get(difficulty) ->
[
{"普通", 1}
,{"困难", 2}
];
get(_) ->
[].