美食家配置表合并

This commit is contained in:
meixiongfeng 2022-08-31 17:26:44 +08:00
parent 431c95ebb0
commit 057dd305aa
8 changed files with 725 additions and 297 deletions

View File

@ -1,19 +1,44 @@
[
{
"id": 1,
"id": 10011,
"type": 1001,
"skill_type": 1,
"initial": 1,
"level": 1,
"levelname": {
"key": "gourmet_ln1",
"text": "马马虎虎"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1001",
"text": "魔法料理"
"key": "gourmet_ln1",
"text": "魔法厨艺"
},
"picture": "ty_wz_k1",
"consume": [
"needtime": 3600,
"display": 1000,
"probability": 1000,
"delicious_icon": "ty_wz_k1",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln1",
"text": "无"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -24,20 +49,45 @@
"propsgroup": 10001
},
{
"id": 2,
"id": 10012,
"type": 1001,
"skill_type": 1,
"initial": 0,
"level": 2,
"levelname": {
"key": "gourmet_ln2",
"text": "匠心独运"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1001",
"text": "魔法料理"
"key": "gourmet_ln2",
"text": "魔法厨艺"
},
"picture": "ty_wz_k1",
"consume": [
"needtime": 7200,
"display": 1000,
"probability": 500,
"delicious_icon": "ty_wz_k1",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln2",
"text": "极低"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -48,20 +98,45 @@
"propsgroup": 10001
},
{
"id": 3,
"id": 10013,
"type": 1001,
"skill_type": 1,
"initial": 0,
"level": 3,
"levelname": {
"key": "gourmet_ln3",
"text": "孰能生巧"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1001",
"text": "魔法料理"
"key": "gourmet_ln3",
"text": "魔法厨艺"
},
"picture": "ty_wz_k1",
"consume": [
"needtime": 14400,
"display": 1000,
"probability": 20,
"delicious_icon": "ty_wz_k1",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln3",
"text": "中等"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -72,20 +147,45 @@
"propsgroup": 10001
},
{
"id": 4,
"id": 10014,
"type": 1001,
"skill_type": 1,
"initial": 0,
"level": 4,
"levelname": {
"key": "gourmet_ln4",
"text": "可圈可点"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1001",
"text": "魔法料理"
"key": "gourmet_ln4",
"text": "魔法厨艺"
},
"picture": "ty_wz_k1",
"consume": [
"needtime": 28800,
"display": 1000,
"probability": 10,
"delicious_icon": "ty_wz_k1",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln4",
"text": "较高"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -96,20 +196,45 @@
"propsgroup": 10001
},
{
"id": 5,
"id": 10021,
"type": 1002,
"skill_type": 1,
"initial": 1,
"level": 1,
"levelname": {
"key": "gourmet_ln1",
"text": "马马虎虎"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1002",
"text": "功夫料理"
"key": "gourmet_ln1",
"text": "功夫厨艺"
},
"picture": "ty_wz_k2",
"consume": [
"needtime": 3600,
"display": 1000,
"probability": 1000,
"delicious_icon": "ty_wz_k2",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln1",
"text": "无"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -120,20 +245,45 @@
"propsgroup": 10001
},
{
"id": 6,
"id": 10022,
"type": 1002,
"skill_type": 1,
"initial": 0,
"level": 2,
"levelname": {
"key": "gourmet_ln2",
"text": "匠心独运"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1002",
"text": "功夫料理"
"key": "gourmet_ln2",
"text": "功夫厨艺"
},
"picture": "ty_wz_k2",
"consume": [
"needtime": 7200,
"display": 1000,
"probability": 500,
"delicious_icon": "ty_wz_k2",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln2",
"text": "极低"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -144,20 +294,45 @@
"propsgroup": 10001
},
{
"id": 7,
"id": 10023,
"type": 1002,
"skill_type": 1,
"initial": 0,
"level": 3,
"levelname": {
"key": "gourmet_ln3",
"text": "孰能生巧"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1002",
"text": "功夫料理"
"key": "gourmet_ln3",
"text": "功夫厨艺"
},
"picture": "ty_wz_k2",
"consume": [
"needtime": 14400,
"display": 1000,
"probability": 20,
"delicious_icon": "ty_wz_k2",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln3",
"text": "中等"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -168,20 +343,45 @@
"propsgroup": 10001
},
{
"id": 8,
"id": 10024,
"type": 1002,
"skill_type": 1,
"initial": 0,
"level": 4,
"levelname": {
"key": "gourmet_ln4",
"text": "可圈可点"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1002",
"text": "功夫料理"
"key": "gourmet_ln4",
"text": "功夫厨艺"
},
"picture": "ty_wz_k2",
"consume": [
"needtime": 28800,
"display": 1000,
"probability": 10,
"delicious_icon": "ty_wz_k2",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln4",
"text": "较高"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -192,20 +392,45 @@
"propsgroup": 10001
},
{
"id": 9,
"id": 10031,
"type": 1003,
"skill_type": 1,
"initial": 1,
"level": 1,
"levelname": {
"key": "gourmet_ln1",
"text": "马马虎虎"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1003",
"text": "科技料理"
"key": "gourmet_ln1",
"text": "科技厨艺"
},
"picture": "ty_wz_k3",
"consume": [
"needtime": 3600,
"display": 1000,
"probability": 1000,
"delicious_icon": "ty_wz_k3",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln1",
"text": "无"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -216,20 +441,45 @@
"propsgroup": 10001
},
{
"id": 10,
"id": 10032,
"type": 1003,
"skill_type": 1,
"initial": 0,
"level": 2,
"levelname": {
"key": "gourmet_ln2",
"text": "匠心独运"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1003",
"text": "科技料理"
"key": "gourmet_ln2",
"text": "科技厨艺"
},
"picture": "ty_wz_k3",
"consume": [
"needtime": 7200,
"display": 1000,
"probability": 500,
"delicious_icon": "ty_wz_k3",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln2",
"text": "极低"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -240,20 +490,45 @@
"propsgroup": 10001
},
{
"id": 11,
"id": 10033,
"type": 1003,
"skill_type": 1,
"initial": 0,
"level": 3,
"levelname": {
"key": "gourmet_ln3",
"text": "孰能生巧"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1003",
"text": "科技料理"
"key": "gourmet_ln3",
"text": "科技厨艺"
},
"picture": "ty_wz_k3",
"consume": [
"needtime": 14400,
"display": 1000,
"probability": 20,
"delicious_icon": "ty_wz_k3",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln3",
"text": "中等"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -264,20 +539,45 @@
"propsgroup": 10001
},
{
"id": 12,
"id": 10034,
"type": 1003,
"skill_type": 1,
"initial": 0,
"level": 4,
"levelname": {
"key": "gourmet_ln4",
"text": "可圈可点"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1003",
"text": "科技料理"
"key": "gourmet_ln4",
"text": "科技厨艺"
},
"picture": "ty_wz_k3",
"consume": [
"needtime": 28800,
"display": 1000,
"probability": 10,
"delicious_icon": "ty_wz_k3",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln4",
"text": "较高"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -288,20 +588,45 @@
"propsgroup": 10001
},
{
"id": 13,
"id": 10041,
"type": 1004,
"skill_type": 1,
"initial": 1,
"level": 1,
"levelname": {
"key": "gourmet_ln1",
"text": "马马虎虎"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1004",
"text": "月能料理"
"key": "gourmet_ln1",
"text": "月能厨艺"
},
"picture": "ty_wz_k4",
"consume": [
"needtime": 3600,
"display": 1000,
"probability": 1000,
"delicious_icon": "ty_wz_k4",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln1",
"text": "无"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -312,20 +637,45 @@
"propsgroup": 10001
},
{
"id": 14,
"id": 10042,
"type": 1004,
"skill_type": 1,
"initial": 0,
"level": 2,
"levelname": {
"key": "gourmet_ln2",
"text": "匠心独运"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1004",
"text": "月能料理"
"key": "gourmet_ln2",
"text": "月能厨艺"
},
"picture": "ty_wz_k4",
"consume": [
"needtime": 7200,
"display": 1000,
"probability": 500,
"delicious_icon": "ty_wz_k4",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln2",
"text": "极低"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -336,20 +686,45 @@
"propsgroup": 10001
},
{
"id": 15,
"id": 10043,
"type": 1004,
"skill_type": 1,
"initial": 0,
"level": 3,
"levelname": {
"key": "gourmet_ln3",
"text": "孰能生巧"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1004",
"text": "月能料理"
"key": "gourmet_ln3",
"text": "月能厨艺"
},
"picture": "ty_wz_k4",
"consume": [
"needtime": 14400,
"display": 1000,
"probability": 20,
"delicious_icon": "ty_wz_k4",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln3",
"text": "中等"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -360,20 +735,45 @@
"propsgroup": 10001
},
{
"id": 16,
"id": 10044,
"type": 1004,
"skill_type": 1,
"initial": 0,
"level": 4,
"levelname": {
"key": "gourmet_ln4",
"text": "可圈可点"
},
"colour": 0,
"lv_colour": "",
"name": {
"key": "gourmet_1004",
"text": "月能料理"
"key": "gourmet_ln4",
"text": "月能厨艺"
},
"picture": "ty_wz_k4",
"consume": [
"needtime": 28800,
"display": 1000,
"probability": 10,
"delicious_icon": "ty_wz_k4",
"skill_icon": "ty_wz_k1",
"item": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"affix": {
"key": "gourmet_ln4",
"text": "较高"
},
"affix_colour": "",
"delicious_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"skill_consume": [
{
"a": "item",
"t": "10002",
@ -382,5 +782,153 @@
],
"using": 1,
"propsgroup": 10001
},
{
"id": 10051,
"type": 1005,
"skill_type": 2,
"initial": 1,
"level": 1,
"levelname": {
"key": "gourmet_ln1",
"text": "马马虎虎"
},
"lv_colour": "",
"name": {
"key": "gourmet_ln1",
"text": "高效制作"
},
"needtime": -300,
"display": 1000,
"probability": 1000,
"delicious_icon": "",
"skill_icon": "ty_wz_k1",
"item": [],
"affix": {
"key": "gourmet_ln1",
"text": "出餐时间-5分钟"
},
"affix_colour": "",
"delicious_consume": [],
"skill_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"using": 0,
"propsgroup": 0
},
{
"id": 10052,
"type": 1005,
"skill_type": 2,
"initial": 0,
"level": 2,
"levelname": {
"key": "gourmet_ln2",
"text": "匠心独运"
},
"lv_colour": "",
"name": {
"key": "gourmet_ln2",
"text": "高效制作"
},
"needtime": -600,
"display": 1000,
"probability": 500,
"delicious_icon": "",
"skill_icon": "ty_wz_k1",
"item": [],
"affix": {
"key": "gourmet_ln2",
"text": "出餐时间-10分钟"
},
"affix_colour": "",
"delicious_consume": [],
"skill_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"using": 0,
"propsgroup": 0
},
{
"id": 10053,
"type": 1005,
"skill_type": 2,
"initial": 0,
"level": 3,
"levelname": {
"key": "gourmet_ln3",
"text": "孰能生巧"
},
"lv_colour": "",
"name": {
"key": "gourmet_ln3",
"text": "高效制作"
},
"needtime": -900,
"display": 1000,
"probability": 20,
"delicious_icon": "",
"skill_icon": "ty_wz_k1",
"item": [],
"affix": {
"key": "gourmet_ln3",
"text": "出餐时间-15分钟"
},
"affix_colour": "",
"delicious_consume": [],
"skill_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"using": 0,
"propsgroup": 0
},
{
"id": 10054,
"type": 1005,
"skill_type": 2,
"initial": 0,
"level": 4,
"levelname": {
"key": "gourmet_ln4",
"text": "可圈可点"
},
"lv_colour": "",
"name": {
"key": "gourmet_ln4",
"text": "高效制作"
},
"needtime": -1200,
"display": 1000,
"probability": 10,
"delicious_icon": "",
"skill_icon": "ty_wz_k1",
"item": [],
"affix": {
"key": "gourmet_ln4",
"text": "出餐时间-20分钟"
},
"affix_colour": "",
"delicious_consume": [],
"skill_consume": [
{
"a": "item",
"t": "10002",
"n": 1
}
],
"using": 0,
"propsgroup": 0
}
]

View File

@ -44,7 +44,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
// 获取技能等级
skillLv := _gourmet.Skill[foodtype]
// 计算出需要的时间
_skillCfg := this.module.configure.GetGourmetSkillConfigData(foodtype, skillLv)
_skillCfg := this.module.configure.GetGourmetConfigData(foodtype, skillLv)
costTime += _skillCfg.Needtime * order.FoodCount
}
if _gourmet.Foods == nil { // 队列数据为nil 直接将订单数据给ta
@ -77,7 +77,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
if v.FoodCount > 0 {
v.FoodCount--
// 获取生产时间
_skillCfg := this.module.configure.GetGourmetSkillConfigData(v.FoodType, _gourmet.Skill[v.FoodType])
_skillCfg := this.module.configure.GetGourmetConfigData(v.FoodType, _gourmet.Skill[v.FoodType])
_gourmet.CookingFood = &pb.Cooking{
FoodType: v.FoodType,
ETime: time.Now().Unix() + int64(_skillCfg.Needtime),
@ -90,7 +90,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
// 計算耗時
for _, v := range _gourmet.Foods {
if v.FoodCount > 0 {
_skillCfg := this.module.configure.GetGourmetSkillConfigData(v.FoodType, _gourmet.Skill[v.FoodType])
_skillCfg := this.module.configure.GetGourmetConfigData(v.FoodType, _gourmet.Skill[v.FoodType])
v.CookTime = _skillCfg.Needtime * v.FoodCount
}
}

View File

@ -42,17 +42,17 @@ func (this *apiComp) SkillLV(session comm.IUserSession, req *pb.GourmetSkillLvRe
bSpecial = true
}
if this.module.configure.GetGourmetSkillConfigData(req.SkillType, skilllv+1) == nil { // 下一级是否存在
if this.module.configure.GetGourmetConfigData(req.SkillType, skilllv+1) == nil { // 下一级是否存在
code = pb.ErrorCode_GourmetSkillMaxLv
return
}
_skillCfg := this.module.configure.GetGourmetSkillConfigData(req.SkillType, skilllv) // 获取技能配置
_skillCfg := this.module.configure.GetGourmetConfigData(req.SkillType, skilllv) // 获取技能配置
// code = this.module.CheckRes(session, _skillCfg.Consume) // 消耗检测
// if code != pb.ErrorCode_Success {
// return
// }
code = this.module.ConsumeRes(session, _skillCfg.Consume, true) // 消耗检测
code = this.module.ConsumeRes(session, _skillCfg.SkillConsume, true) // 消耗检测
if code != pb.ErrorCode_Success {
return
}

View File

@ -18,8 +18,7 @@ const (
type configureComp struct {
hlock sync.RWMutex
modules.MCompConfigure
_gourmetMap map[int64]*cfg.GameGourmetData
_gourmetSkillMap map[int64]*cfg.GameGourmetSkillData
_gourmetMap map[int64]*cfg.GameGourmetData
}
//组件初始化接口
@ -41,21 +40,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
log.Errorf("get game_pagoda conf err:%v", err)
return
})
this._gourmetSkillMap = make(map[int64]*cfg.GameGourmetSkillData, 0)
configure.RegisterConfigure(game_gourmetskill, cfg.NewGameGourmetSkill, func() {
if v, err := this.GetConfigure(game_gourmetskill); err == nil {
if configure, ok := v.(*cfg.GameGourmetSkill); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._gourmetSkillMap[int64(value.Type<<16)+int64(value.Level)] = value
}
return
}
}
log.Errorf("get game_pagoda conf err:%v", err)
return
})
return
}
@ -66,39 +50,6 @@ func (this *configureComp) GetGourmetConfigData(gourmetType int32, level int32)
return this._gourmetMap[int64(gourmetType<<16)+int64(level)]
}
// 获取美食馆配置数据
func (this *configureComp) GetGourmetSkillConfigData(gourmetType int32, level int32) (data *cfg.GameGourmetSkillData) {
return this._gourmetSkillMap[int64(gourmetType<<16)+int64(level)]
}
// 通过技能id 查询技能配置表
func (this *configureComp) GetGourmetSkillConfigBySkillID(skillId int) (data *cfg.GameGourmetSkillData) {
if v, err := this.GetConfigure(game_gourmetskill); err == nil {
if configure, ok := v.(*cfg.GameGourmetSkill); ok {
data = configure.Get(int32(skillId))
return
}
}
return
}
func (this *configureComp) GetGourmetSkillConfigBySkillType(skillType int) (szSkill []int32) {
szSkill = make([]int32, 0)
if v, err := this.GetConfigure(game_gourmetskill); err == nil {
if configure, ok := v.(*cfg.GameGourmetSkill); ok {
for _, data := range configure.GetDataList() {
if skillType == int(data.SkillType) && data.Initial == 1 {
szSkill = append(szSkill, data.Type)
}
}
return
}
}
return
}
//加载多个配置文件
func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) {
for k, v := range confs {
@ -115,3 +66,19 @@ func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err
func (this *configureComp) GetConfigure(name string) (v interface{}, err error) {
return configure.GetConfigure(name)
}
func (this *configureComp) GetGourmetSkillConfigBySkillType(skillType int32) (data []int32) {
data = make([]int32, 0)
if v, err := this.GetConfigure(game_gourmet); err == nil {
if configure, ok := v.(*cfg.GameGourmet); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
if value.SkillType == skillType && value.Initial == 1 {
data = append(data, value.Type)
}
}
return
}
}
return
}

View File

@ -90,8 +90,8 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet)
skillLv := gourmet.Skill[foodtype]
// 计算出需要的时间
_skillCfg := this.module.configure.GetGourmetSkillConfigData(foodtype, skillLv) // 技能配置表
_gourmetcfg := this.module.configure.GetGourmetConfigData(foodtype, skillLv) // 美食家配置表
_skillCfg := this.module.configure.GetGourmetConfigData(foodtype, skillLv) // 技能配置表
_gourmetcfg := this.module.configure.GetGourmetConfigData(foodtype, skillLv) // 美食家配置表
for i := 0; i < int(order.FoodCount); i++ {
curTime += _skillCfg.Needtime
// 判断是不是第二天
@ -142,7 +142,7 @@ func (this *modelGourmet) CalculationGourmetbySkiiLv(uid string, gourmet *pb.DBG
mapData := make(map[string]interface{}, 0)
for _, v := range gourmet.Foods {
if v.FoodCount > 0 && v.FoodType == skillType {
_skillCfg := this.module.configure.GetGourmetSkillConfigData(skillType, skilllv)
_skillCfg := this.module.configure.GetGourmetConfigData(skillType, skilllv)
if _skillCfg != nil {
v.CookTime = _skillCfg.Needtime * v.FoodCount
mapData["foods"] = gourmet.Foods
@ -159,7 +159,7 @@ func (this *modelGourmet) CalculationSpecialSkillLv(uid string, gourmet *pb.DBGo
mapData := make(map[string]interface{}, 0)
for _, v := range gourmet.Foods {
if v.FoodCount > 0 {
_skillCfg := this.module.configure.GetGourmetSkillConfigData(skillType, skilllv)
_skillCfg := this.module.configure.GetGourmetConfigData(skillType, skilllv)
if _skillCfg != nil {
v.CookTime += _skillCfg.Needtime * v.FoodCount
if v.CookTime < 0 { // 担心配置错误 为负数情况 所以这里做下判断

View File

@ -13,12 +13,22 @@ import "errors"
type GameGourmetData struct {
Id int32
Type int32
SkillType int32
Initial int32
Level int32
Levelname string
Colour int32
LvColour string
Name string
Picture string
Consume []*Gameatn
Needtime int32
Display int32
Probability int32
DeliciousIcon string
SkillIcon string
Item []*Gameatn
Affix string
AffixColour string
DeliciousConsume []*Gameatn
SkillConsume []*Gameatn
Using int32
Propsgroup int32
}
@ -32,22 +42,58 @@ func (*GameGourmetData) GetTypeId() int32 {
func (_v *GameGourmetData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill_type"].(float64); !_ok_ { err = errors.New("skill_type error"); return }; _v.SkillType = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["initial"].(float64); !_ok_ { err = errors.New("initial error"); return }; _v.Initial = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["level"].(float64); !_ok_ { err = errors.New("level error"); return }; _v.Level = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["levelname"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Levelname error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Levelname, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["colour"].(float64); !_ok_ { err = errors.New("colour error"); return }; _v.Colour = int32(_tempNum_) }
{ var _ok_ bool; if _v.LvColour, _ok_ = _buf["lv_colour"].(string); !_ok_ { err = errors.New("lv_colour error"); return } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; if _v.Picture, _ok_ = _buf["picture"].(string); !_ok_ { err = errors.New("picture error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["needtime"].(float64); !_ok_ { err = errors.New("needtime error"); return }; _v.Needtime = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["display"].(float64); !_ok_ { err = errors.New("display error"); return }; _v.Display = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["probability"].(float64); !_ok_ { err = errors.New("probability error"); return }; _v.Probability = int32(_tempNum_) }
{ var _ok_ bool; if _v.DeliciousIcon, _ok_ = _buf["delicious_icon"].(string); !_ok_ { err = errors.New("delicious_icon error"); return } }
{ var _ok_ bool; if _v.SkillIcon, _ok_ = _buf["skill_icon"].(string); !_ok_ { err = errors.New("skill_icon error"); return } }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["consume"].([]interface{}); !_ok_ { err = errors.New("consume error"); return }
if _arr_, _ok_ = _buf["item"].([]interface{}); !_ok_ { err = errors.New("item error"); return }
_v.Consume = make([]*Gameatn, 0, len(_arr_))
_v.Item = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.Consume = append(_v.Consume, _list_v_)
_v.Item = append(_v.Item, _list_v_)
}
}
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["affix"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Affix error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Affix, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; if _v.AffixColour, _ok_ = _buf["affix_colour"].(string); !_ok_ { err = errors.New("affix_colour error"); return } }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["delicious_consume"].([]interface{}); !_ok_ { err = errors.New("delicious_consume error"); return }
_v.DeliciousConsume = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.DeliciousConsume = append(_v.DeliciousConsume, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["skill_consume"].([]interface{}); !_ok_ { err = errors.New("skill_consume error"); return }
_v.SkillConsume = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.SkillConsume = append(_v.SkillConsume, _list_v_)
}
}

View File

@ -1,42 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameGourmetSkill struct {
_dataMap map[int32]*GameGourmetSkillData
_dataList []*GameGourmetSkillData
}
func NewGameGourmetSkill(_buf []map[string]interface{}) (*GameGourmetSkill, error) {
_dataList := make([]*GameGourmetSkillData, 0, len(_buf))
dataMap := make(map[int32]*GameGourmetSkillData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameGourmetSkillData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Id] = _v
}
}
return &GameGourmetSkill{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameGourmetSkill) GetDataMap() map[int32]*GameGourmetSkillData {
return table._dataMap
}
func (table *GameGourmetSkill) GetDataList() []*GameGourmetSkillData {
return table._dataList
}
func (table *GameGourmetSkill) Get(key int32) *GameGourmetSkillData {
return table._dataMap[key]
}

View File

@ -1,91 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameGourmetSkillData struct {
Id int32
Type int32
SkillType int32
Initial int32
Level int32
Levelname string
Colour int32
Name string
Needtime int32
Display int32
Probability int32
Icon string
Item []*Gameatn
Affix string
AffixColour int32
Consume []*Gameatn
}
const TypeId_GameGourmetSkillData = 2062196640
func (*GameGourmetSkillData) GetTypeId() int32 {
return 2062196640
}
func (_v *GameGourmetSkillData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill_type"].(float64); !_ok_ { err = errors.New("skill_type error"); return }; _v.SkillType = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["initial"].(float64); !_ok_ { err = errors.New("initial error"); return }; _v.Initial = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["level"].(float64); !_ok_ { err = errors.New("level error"); return }; _v.Level = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["levelname"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Levelname error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Levelname, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["colour"].(float64); !_ok_ { err = errors.New("colour error"); return }; _v.Colour = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["needtime"].(float64); !_ok_ { err = errors.New("needtime error"); return }; _v.Needtime = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["display"].(float64); !_ok_ { err = errors.New("display error"); return }; _v.Display = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["probability"].(float64); !_ok_ { err = errors.New("probability error"); return }; _v.Probability = int32(_tempNum_) }
{ var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["item"].([]interface{}); !_ok_ { err = errors.New("item error"); return }
_v.Item = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.Item = append(_v.Item, _list_v_)
}
}
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["affix"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Affix error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Affix, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["affix_colour"].(float64); !_ok_ { err = errors.New("affix_colour error"); return }; _v.AffixColour = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["consume"].([]interface{}); !_ok_ { err = errors.New("consume error"); return }
_v.Consume = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.Consume = append(_v.Consume, _list_v_)
}
}
return
}
func DeserializeGameGourmetSkillData(_buf map[string]interface{}) (*GameGourmetSkillData, error) {
v := &GameGourmetSkillData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}