Files
2026-05-23 22:10:14 +08:00

95 lines
5.3 KiB
Erlang

%%%-------------------------------------------------------------------
%%% @author yzq <741287960@qq.com>
%%% @copyright (C) 2018, yzq
%%% @doc
%%% 兑换配置
%%% @end
%%% Created : 5 June 2018 by yzq
%%%-------------------------------------------------------------------
-module(convert_data).
-export([cfg/0]).
-include("data_config.hrl").
-include("common.hrl").
cfg() ->
#data_cfg{
name = convert_data
, lua_name = convert_data
, desc = "兑换配置"
, source = "convert_data.xml"
, target = "convert_data.erl"
, inc = ["common.hrl"]
, callback =
[{{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}}
, {{convert_coin, undefined}, cb_fun, handle, {get_tuple, ["金币兑换"], id, [price, coin]}}
, {{convert_silver_coin, undefined}, cb_fun, handle, {get_tuple, ["银币兑换"], id, [price, silver_coin]}}
, {wish_reward, cb_fun, handle, {get_fun, ["许愿奖励"], "wish_reward(Count) when Count >= ~ts andalso Count =< ~ts -> {~ts, ~ts, ~ts, ~ts};", [min_count, max_count, price, reward, rate, vip]}}
, {{ext_reward, 0}, cb_fun, handle, {get_tuple, ["额外奖励"], [type, dun_id], rate}}
, {ext_list, cb_fun, handle, {tuple_type, ["额外奖励"], type, dun_id}}
, {coin_list, cb_fun, handle, {tuple_type, ["点金"], type, id}}
, {get_coin, cb_fun, handle, {get_record, ["点金"], [type,id], new_map, all}}
, {coin_vip, cb_fun, handle, {get_tuple, ["点金VIP加成"], vip, ratio}}
]
,callback_cli = [
{gold_exchange, cb_fun_lua, handle, {key_val, [ "金币兑换"], [id], all}}
,{sliver_exchange, cb_fun_lua, handle, {key_val, [ "银币兑换"], [id], all}}
,{wish_reward, cb_fun_lua, handle, {key_val, [ "许愿奖励"], [min_count], all}}
,{trade_cost, cb_fun_lua, handle, {key_val, [ "常量配置"], [key], all}}
,{exchange, cb_fun_lua, handle, {type_get_val, ["点金"], [type,id], all}}
]
,callback_json = [
{gold_exchange, cb_fun_json, handle, {key_val, [ "金币兑换"], [id], all}}
,{sliver_exchange, cb_fun_json, handle, {key_val, [ "银币兑换"], [id], all}}
,{wish_reward, cb_fun_json, handle, {key_val, [ "许愿奖励"], [min_count], all}}
,{trade_cost, cb_fun_json, handle, {key_val, [ "常量配置"], [key], all}}
,{exchange, cb_fun_json, handle, {type_get_val, ["点金"], [type,id], all}}
]
, sheet =
[{["金币兑换"],
[
#f_column{desc = "编号", type = int, name = id}
, #f_column{desc = "消耗钻石", type = int, name = price, mod = all}
, #f_column{desc = "兑换金币", type = int, name = coin, mod = all}
]
}
, {["银币兑换"],
[
#f_column{desc = "编号", type = int, name = id}
, #f_column{desc = "消耗钻石", type = int, name = price, mod = all}
, #f_column{desc = "兑换银币", type = int, name = silver_coin, mod = all}
]
}
, {["许愿奖励"],
[#f_column{desc = "次数上限", type = int, name = max_count, mod = all}
, #f_column{desc = "次数下限", type = int, name = min_count, mod = all}
, #f_column{desc = "消耗钻石", type = term, name = price, mod = all}
, #f_column{desc = "兑换奖励", type = term, name = reward, mod = all}
, #f_column{desc = "暴击概率", type = int, name = rate, val = 0, mod = all}
, #f_column{desc = "VIP限制", type = int, name = vip, val = 0, mod = all}
]
}
,{["常量配置"],
[#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 = type, mod = all}
, #f_column{desc = "通关关卡", type = int, name = dun_id, mod = all}
, #f_column{desc = "额外比例", type = int, name = rate, mod = all}
]}
,{["点金"], [
#f_column{desc = "活动类型", type = int, name = type, mod = all}
,#f_column{desc = "档次ID", type = int, name = id, mod = all}
,#f_column{desc = "价格", type = int, name = price, mod = all}
,#f_column{desc = "收益时间(分)", type = int, name = time, mod = all}
,#f_column{desc = "保底金币", type = int, name = coin, mod = all}
,#f_column{desc = "次数上限", type = int, name = num, mod = all}
]}
,{["点金VIP加成"], [
#f_column{desc = "VIP等级", type = int, name = vip, mod = all}
,#f_column{desc = "VIP加成", type = int, name = ratio, mod = all}
]}
]
}.