Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
ed181eea96
@ -593,7 +593,6 @@ type (
|
|||||||
GetHdInfoByHdId(oid string) (result *pb.DBHuodong, err error) // 通过活动id 获取活动信息
|
GetHdInfoByHdId(oid string) (result *pb.DBHuodong, err error) // 通过活动id 获取活动信息
|
||||||
GetAllHdInfo() (hdList map[int32][]*pb.DBHuodong) // 获取所有活动信息
|
GetAllHdInfo() (hdList map[int32][]*pb.DBHuodong) // 获取所有活动信息
|
||||||
GetHdInfoByItype(itype int32) (result []*pb.DBHuodong, err error) //
|
GetHdInfoByItype(itype int32) (result []*pb.DBHuodong, err error) //
|
||||||
UpdateActivitySlider(session IUserSession) // 修改活动进度
|
|
||||||
|
|
||||||
// 庆典活动
|
// 庆典活动
|
||||||
HDCelebration(session IUserSession, systemtype int32, bosstype int32) bool
|
HDCelebration(session IUserSession, systemtype int32, bosstype int32) bool
|
||||||
|
@ -84,6 +84,17 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
|
|||||||
|
|
||||||
addExp += attenuation[i]
|
addExp += attenuation[i]
|
||||||
}
|
}
|
||||||
|
itemConf, err1 := this.module.ModuleTools.GetGrormetLlame(req.Items)
|
||||||
|
if err1 != nil {
|
||||||
|
this.module.Errorf("赠送菜品配置没找到:%s", req.Items)
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
|
Message: err1.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
addExp *= itemConf
|
||||||
_heroObj.Givecount += req.Counts
|
_heroObj.Givecount += req.Counts
|
||||||
// 校验是否是自己喜欢的食物
|
// 校验是否是自己喜欢的食物
|
||||||
_c, err := this.module.configure.GetFavorability(_heroObj.Heroid, _heroObj.Favorlv)
|
_c, err := this.module.configure.GetFavorability(_heroObj.Heroid, _heroObj.Favorlv)
|
||||||
@ -98,7 +109,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
|
|||||||
for _, v := range _c.LikesFood { // 喜欢的食物
|
for _, v := range _c.LikesFood { // 喜欢的食物
|
||||||
if v == req.Items {
|
if v == req.Items {
|
||||||
likeStates = 1
|
likeStates = 1
|
||||||
addExp = int32(math.Floor(float64(addExp*this.module.ModuleTools.GetGlobalConf().FavorabilityLikes*req.Counts) / 1000))
|
addExp = int32(math.Floor(float64(addExp/1000) * float64(this.module.ModuleTools.GetGlobalConf().FavorabilityLikes) / 1000))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,7 +117,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
|
|||||||
for _, v := range _c.DislikingFood { //不喜欢
|
for _, v := range _c.DislikingFood { //不喜欢
|
||||||
if v == req.Items {
|
if v == req.Items {
|
||||||
likeStates = 2
|
likeStates = 2
|
||||||
addExp = int32(math.Floor(float64(addExp*this.module.ModuleTools.GetGlobalConf().FavorabilityDislikes*req.Counts) / 1000))
|
addExp = int32(math.Floor(float64(addExp/1000) * float64(this.module.ModuleTools.GetGlobalConf().FavorabilityDislikes) / 1000))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,20 +132,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
|
|||||||
if errdata = this.module.CheckRes(session, res); errdata != nil { // 道具不够直接返回
|
if errdata = this.module.CheckRes(session, res); errdata != nil { // 道具不够直接返回
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
itemConf, err1 := this.module.ModuleTools.GetGrormetLlame(req.Items)
|
|
||||||
//itemConf, err1 := this.module.configure.GetItemConfigureData(req.Items) // 获取食物的
|
|
||||||
if err1 != nil {
|
|
||||||
this.module.Errorf("赠送菜品配置没找到:%s", req.Items)
|
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
|
||||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
|
||||||
Message: err1.Error(),
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
addExp *= itemConf
|
_heroObj.Favorexp += addExp
|
||||||
_heroObj.Favorexp += addExp / 1000
|
|
||||||
|
|
||||||
// 折算出等级
|
// 折算出等级
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user