%%%------------------------------------
%%% @Module  : live_skill.hrl
%%% @Author  : zzy
%%% @Created : 2018-10-17
%%% @Description: 生活技能
%%%------------------------------------

-define(COOK_OPEN_LV,   160).   %%烹饪开放等级

-define(TYPE_FISH_SKILL,  1).  %%钓鱼技能
-define(TYPE_WOOD_SKILL,  2).  %%伐木技能
-define(TYPE_IRON_SKILL,  3).  %%采石技能
-define(TYPE_STONE_SKILL, 4).  %%采矿技能
-define(TYPE_COOK_SKILL,  5).  %%烹饪技能
-define(TYPE_EQUIP_SKILL, 6).  %%打造技能

-define(EQUIP_DATA_TYPE, [1, 2, 3]). %%家具材料类型（发成物品，家具转为家园内部数据）

%%ps记录
-record(status_live_skill,{
		skill_list = [],
		cook_list = [],        %%食谱激活的食物类型id[食物类型id]
		equip_list = []		   %%打造纸激活的打造类型id[打造类型id]
	}).

%%生活技能
-record(live_skill, {
		skill_type = 0,		%%技能类型
		lv = 0,				%%等级
		exp = 0     		%%熟练度
	}).

%% ---------------------------------------------------------------------------
%% 配置定义
%% ---------------------------------------------------------------------------
%%食物种类配置
-record(base_cook_type, {
		type_id = 0,
		kind = 0,
		name = "",
		need_lv = 0,
		good_id = 0,
		time = 0,
		add_exp = 0,
		cost_live = 0,
		cost = []
	}).

%%食物配置
-record(base_food,{
		food_id = 0,
		type_id = 0,
		name = "",
		need_lv = 0,
		weight = []
	}).

%%家具种类配置
-record(base_furniture_type, {
		type_id = 0,
		kind = 0,
		name = "",
		need_lv = 0,
		good_id = 0,
		time = 0,
		add_exp = 0,
		cost_live = 0,
		cost_res = [],		%% 资源消耗
		cost = []
	}).

%%家具表
-record(base_furniture, {
		furniture_id = 0,
		type_id = 0,
		name = "",
		need_lv = 0,
		prosperity = 0,		 %% 繁荣度
		area = [],
		map_id = 0,          %% 放置面 1 地面 2 右侧墙 3 左侧墙
		weight = []
	}).

%% ---------------------------------------------------------------------------
%% sql定义
%% ---------------------------------------------------------------------------
-define(sql_replace_live_skill_info, "replace into `role_live_skill_info`(role_id, cook_list, equip_list) VALUES (~p, '~s', '~s')  ").
-define(sql_select_live_skill_info,  "select cook_list, equip_list from `role_live_skill_info` where `role_id`= ~p ").

%%只存放烹饪和打造
-define(sql_replace_live_skill, "replace into `role_live_skill`(role_id, skill_type, lv, exp) VALUES (~p, ~p, ~p, ~p)  ").
-define(sql_select_live_skill,  "select skill_type, lv, exp from `role_live_skill` where `role_id`= ~p ").