%%%--------------------------------------
%%% @Author  : zmh
%%% @Created : 20200311
%%% @Description: 幻光系统
%%%--------------------------------------

-define(SQL_PLAYER_VISUS_GET, <<"SELECT `id`, `grade`,`lv`,`state`,`display` FROM `player_visus` WHERE rid=~p">>).
-define(SQL_PLAYER_VISUS_INSERT,<<"REPLACE INTO `player_visus` (`rid`,`id`,`grade`,`lv`,`state`,`display`) VALUES (~p,~p,~p,~p,~p,~p)">>).


-define(PLAYER_VISUS_SKILL_LOAD, <<"SELECT `skill_id` FROM `player_visus_skill` WHERE `role_id`=~p">>).
-define(PLAYER_VISUS_SKILL_SAVE, <<"REPLACE INTO `player_visus_skill` (`role_id`,`skill_id`) VALUES (~p,~p)">>).

-define(SQL_ROLE_VISUS_GET, <<"SELECT `refresh_time`, `login_days` FROM `role_visus` WHERE rid=~p">>).
-define(SQL_ROLE_VISUS_INS, <<"REPLACE INTO `role_visus` (`rid`,`refresh_time`,`login_days`) VALUES (~p,~p,~p)">>).

-record(role_visus, {

	refresh_time = 0, 		%% 上一次统计登录时间
    login_days = 0,         %% 累计登录天数

	attr    = [], %%总属性汇总
	display = 0,
	combat  = 0,
	visus   = []  %%汇总
    ,skill_id = 0 %% 当前使用的技能Id
}).

%%数据结构
-record(cell_visus, {
	id    = 0,         %%子类型
	grade = 0,         %%强度
	lv    = 0,
	display = 0,
	combat = 0,        %%战力
	state = 0,         %%0是可激活1已激活
	attr  = []         %%属性汇总
}).


%%配置数据结构
-record(base_visus, {
	id = 0,
	name = 0,
	item = 0,
	condition = [],
	desc   = "",
	figure = 0,
	skill = {0,0}
}).

%%配置数据结构
-record(base_visus_lv, {
	id = 0,
	grade = 0,
	next_grade = 0,     %%下一阶
	lv = 0,
	next_lv = 0,        %%下一等级
	attrs = [],   		%%属性
	spe_attrs = [],     %%特殊属性
	cost  = [],   		%%操作消耗
	rate  = 0    		%%概率
}).
