Files

166 lines
12 KiB
Erlang
Raw Permalink Normal View History

2026-05-23 22:10:14 +08:00
%%----------------------------------------------------
%% 数据配置文件
%% @author whjing2011@gmail.com
%%----------------------------------------------------
-module(zs_war_data).
-export([cfg/0]).
-include("data_config.hrl").
-include("common.hrl").
cfg() ->
#data_cfg{
name = zs_war_data
,lua_name = zs_war_data
,desc = "配置数据"
,source = "zs_war_data.xml"
,target = "zs_war_data.erl"
,inc = ["zs_war.hrl"]
,callback = [
{{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}}
,{{get_group,1}, cb_fun, handle, {get_fun, ["分组"], "get_group(Lev) when Lev >= ~ts andalso Lev =< ~ts -> ~ts;", [min_lev, max_lev, group]}}
,{group_data, cb_fun, handle, {get_record, ["分组"], group, new_map, all}}
,{get_robot, cb_fun, handle, {get_fun, ["机器人"], "get_robot({~ts,Power}) when Power >= ~ts andalso Power =< ~ts -> ~ts;", [group, min_power, max_power, {rec,new_map,all}]}}
,{list_skill, cb_fun, handle, {tuple_type, ["战场技能"], camp, id}}
,{get_skill, cb_fun, handle, {get_record, ["战场技能"], id, zs_war_skill_data, all}}
,{{get_score, 0}, cb_fun, handle, {get_tuple, ["战斗结算"], [group, type], score}}
,{{combat_hurt, 0}, cb_fun, handle, {get_tuple, ["战斗结算"], [group, type], hurt}}
,{{combat_items1, "[]"}, cb_fun, handle, {get_tuple, ["战斗结算"], [group, type], items1}}
,{{combat_items2, "[]"}, cb_fun, handle, {get_tuple, ["战斗结算"], [group, type], items2}}
,{{cont_win_score, 0}, cb_fun, handle, {get_fun, ["连胜积分加成"], "cont_win_score({~ts,~ts,Win}) when Win >= ~ts andalso Win =< ~ts -> ~ts;", [group, type, min_win, max_win, score]}}
,{{cont_win_notice, undefined}, cb_fun, handle, {get_fun, ["连胜积分加成"], "cont_win_notice({~ts,~ts,Win}) when Win >= ~ts andalso Win =< ~ts -> ~ts;", [group, type, min_win, max_win, {rec, new_map, all}]}}
,{{buff_effect, 0}, cb_fun, handle, {get_fun, ["BUFF加成"], "buff_effect({~ts,~ts,Num}) when Num >= ~ts andalso Num =< ~ts -> ~ts;", [group, type, min, max, effect]}}
,{{buff_hurt, 0}, cb_fun, handle, {get_fun, ["BUFF加成"], "buff_hurt({~ts,~ts,Num}) when Num >= ~ts andalso Num =< ~ts -> ~ts;", [group, type, min, max, hurt]}}
,{{buff_attr, "[]"}, [{nonull,[attr]}], cb_fun, handle, {get_fun, ["BUFF加成"], "buff_attr({~ts,~ts,Num}) when Num >= ~ts andalso Num =< ~ts -> ~ts;", [group, type, min, max, attr]}}
,{{buff_msg, undefined}, [{nonull,[msg]}], cb_fun, handle, {get_fun, ["BUFF加成"], "buff_msg({~ts,~ts,Num}) when Num >= ~ts andalso Num =< ~ts -> ~ts;", [group, type, min, max, msg]}}
,{{rank_items,"#{}"}, cb_fun, handle, {get_fun, ["排名奖励"], "rank_items({~ts,Rank}) when Rank >= ~ts andalso Rank =< ~ts -> ~ts;", [group, min, max, {rec, new_map, all}]}}
,{list_acc_reward, cb_fun, handle, {tuple_type, ["累计奖励"], [group, type], num}}
,{acc_items, cb_fun, handle, {get_record, ["累计奖励"], [group, type, num], new_map, all}}
,{list_guard, cb_fun, handle, {tuple_type, ["守卫"], group, id}}
,{get_guard, cb_fun, handle, {get_record, ["守卫"], [group,id], zs_war_guard_data, all}}
]
,callback_cli = [
{pos, cb_fun_lua, handle, {type_get_val, ["格子"], [row, col], pos}}
,{const, cb_fun_lua, handle, {key_val, ["常量配置"], [key], all}}
,{explain, cb_fun_lua, handle, {key_val, ["玩法说明"], [id], all}}
,{skill, cb_fun_lua, handle, {key_val, ["战场技能"], [id], [id, name, icon, desc, free, loss]}}
,{num_rewards, cb_fun_lua, handle, {type_val, ["累计奖励"], [group], all}}
,{rank_rewards, cb_fun_lua, handle, {type_val, ["奖励展示"], [group], all}}
,{group, cb_fun_lua, handle, {key_val, ["分组"], [group], [name]}}
]
,callback_json = [
{pos, cb_fun_json, handle, {type_get_val, ["格子"], [row, col], pos}}
,{const, cb_fun_json, handle, {key_val, ["常量配置"], [key], all}}
,{explain, cb_fun_json, handle, {key_val, ["玩法说明"], [id], all}}
,{skill, cb_fun_json, handle, {key_val, ["战场技能"], [id], [id, name, icon, desc, free, loss]}}
,{num_rewards, cb_fun_json, handle, {type_val, ["累计奖励"], [group], all}}
,{rank_rewards, cb_fun_json, handle, {type_val, ["奖励展示"], [group], all}}
,{group, cb_fun_json, handle, {key_val, ["分组"], [group], [name]}}
]
,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 = group, desc = "分组"}
,#f_column{type = int, name = min_lev, desc = "等级下限"}
,#f_column{type = int, name = max_lev, desc = "等级上限"}
,#f_column{type = bstr, name = name, desc = "名称"}
,#f_column{type = term, name = win_items, desc = "胜利奖励"}
,#f_column{type = term, name = lose_items, desc = "失败奖励"}
,#f_column{type = term, name = draw_items, desc = "平局奖励"}
]}
,{["机器人"], [
#f_column{type = int, name = group, desc = "分组"}
,#f_column{type = int, name = min_power, desc = "战力下限"}
,#f_column{type = int, name = max_power, desc = "战力上限"}
,#f_column{type = term, name = attr_correction, desc = "属性修正"}
,#f_column{type = term, name = lev_correction, desc = "等级修正"}
,#f_column{type = term, name = a_robot_list, desc = "A方机器人"}
,#f_column{type = term, name = b_robot_list, desc = "B方机器人"}
]}
,{["战场技能"], [
#f_column{type = kv, name = camp, desc = "阵营", kv_type = [{"A方",1},{"B方",2}]}
,#f_column{type = int, name = id, desc = "技能ID"}
,#f_column{type = bstr, name = name, desc = "名称"}
,#f_column{type = int, name = cd, desc = "CD时间"}
,#f_column{type = term, name = loss, desc = "消耗"}
,#f_column{type = int, name = free, desc = "免费次数"}
,#f_column{type = term, name = effect, desc = "效果"}
,#f_column{type = bstr, name = desc, desc = "描述", mod = client}
,#f_column{type = int, name = icon, desc = "技能图标", mod = client}
,#f_column{type = bstr, name = effect_id, desc = "技能特效", mod = client}
]}
,{["战斗结算"], [
#f_column{type = int, name = group, desc = "分组"}
,#f_column{type = kv, name = type, desc = "类型", kv_type = [{"胜利",1},{"失败",2},{"平局",3},{"终点",4}]}
,#f_column{type = int, name = score, desc = "积分"}
,#f_column{type = int, name = hurt, desc = "建筑伤害"}
,#f_column{type = term, name = items1, desc = "战斗结算奖励"}
,#f_column{type = term, name = items2, desc = "限制后战斗结算奖励"}
]}
,{["连胜积分加成"], [
#f_column{type = int, name = group, desc = "分组"}
,#f_column{type = kv, name = type, desc = "类型", kv_type = [{"连胜",1},{"中结连胜",2}]}
,#f_column{type = int, name = min_win, desc = "胜利下限"}
,#f_column{type = int, name = max_win, desc = "胜利上限"}
,#f_column{type = int, name = score, desc = "积分"}
,#f_column{type = int, name = notice_type, desc = "公告类型"}
,#f_column{type = bstr, name = msg1, desc = "公告1"}
,#f_column{type = bstr, name = msg2, desc = "公告2"}
]}
,{["BUFF加成"], [
#f_column{type = int, name = group, desc = "分组"}
,#f_column{type = kv, name = type, kv_type = [{"连胜",1},{"连败",2}], desc = "类型"}
,#f_column{type = int, name = min, desc = "次数下限"}
,#f_column{type = int, name = max, desc = "次数上限"}
,#f_column{type = int, name = effect, desc = "特效"}
,#f_column{type = int, name = hurt, desc = "建筑伤害加成"}
,#f_column{type = term, name = attr, desc = "属性加成"}
,#f_column{type = bstr, name = msg, desc = "效果飘字"}
]}
,{["守卫"], [
#f_column{type = int, name = id, desc = "ID"}
,#f_column{type = int, name = group, desc = "分组", mod = desc}
,#f_column{type = int, name = camp, desc = "阵营"}
,#f_column{type = int, name = bid, desc = "单位ID"}
,#f_column{type = int, name = pos_x, desc = "X格子"}
,#f_column{type = int, name = pos_y, desc = "Y格子"}
,#f_column{type = int, name = max_hp, desc = "血量上限"}
,#f_column{type = int, name = diff_hp, desc = "阵营变身血量差条件"}
,#f_column{type = term, name = role_attr, desc = "个人变身加成"}
,#f_column{type = term, name = camp_attr, desc = "阵营变身加成"}
,#f_column{type = int, name = time, desc = "变身持续时间"}
,#f_column{type = int, name = cd, desc = "下次变身出现冷却时间"}
]}
,{["排名奖励"], [
#f_column{type = int, name = group, desc = "分组"}
,#f_column{type = int, name = min, desc = "排名下限"}
,#f_column{type = int, name = max, desc = "排名上限"}
,#f_column{type = int, name = ratio, desc = "积分转化折扣"}
,#f_column{type = term, name = items, desc = "固定奖励"}
]}
,{["奖励展示"], [
#f_column{type = int, name = group, desc = "分组", mod = client}
,#f_column{type = bstr, name = desc, desc = "描述", mod = client}
,#f_column{type = term, name = items, desc = "奖励", mod = client}
]}
,{["累计奖励"], [
#f_column{type = int, name = group, desc = "分组"}
,#f_column{type = kv, name = type, desc = "类型", kv_type = [{"胜利次数",1},{"战斗场次",2}], mod = all}
,#f_column{type = int, name = num, desc = "数量", mod = all}
,#f_column{type = term, name = items, desc = "奖励", mod = all}
]}
,{["格子"], [
#f_column{type = int, name = row, desc = "", mod = client}
,#f_column{type = int, name = col, desc = "", mod = client}
,#f_column{type = term, name = pos, desc = "坐标", add_list_sign=false, mod = client}
]}
,{["玩法说明"], [
#f_column{type = int, name = id, desc = "标签", primary = true, mod = client}
,#f_column{type = str, name = title, desc = "标签名", mod = client}
,#f_column{type = str, name = desc, desc = "内容", mod = client}
]}
]
}.