Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
1f4ac80e88
@ -105,8 +105,7 @@ type (
|
||||
CleanData(uid string)
|
||||
// 获取指定星级等级的英雄
|
||||
GetSpecifiedHero(session IUserSession, heroConfId string, star, lv int32) (errdata *pb.ErrorData)
|
||||
// 英雄加经验
|
||||
//AddHeroExp(session IUserSession, heroObjID string, exp int32) (curAddExp int32, errdata *pb.ErrorData)
|
||||
|
||||
// 英雄加经验
|
||||
AddHerosExp(session IUserSession, heroObjs []string, exp int32) (curAddExp []int32, errdata *pb.ErrorData)
|
||||
// 英雄练功
|
||||
|
@ -312,44 +312,6 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]
|
||||
return
|
||||
}
|
||||
|
||||
// func (this *Hero) AddHeroExp(session comm.IUserSession, heroObjID string, exp int32) (curAddExp int32, errdata *pb.ErrorData) {
|
||||
// var (
|
||||
// _hero *pb.DBHero
|
||||
// _changeHero []*pb.DBHero // 变化的英雄
|
||||
// )
|
||||
|
||||
// if heroObjID == "" {
|
||||
// return
|
||||
// }
|
||||
// if this.IsCross() {
|
||||
// _hero = &pb.DBHero{}
|
||||
// if model, err := this.GetDBModelByUid(session.GetUserId(), this.modelHero.TableName); err == nil {
|
||||
// if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil {
|
||||
// this.Errorf("err:%v", err)
|
||||
// return
|
||||
// }
|
||||
// curAddExp, errdata = this.modelHero.AddCardExp(session, _hero, exp, model)
|
||||
// if errdata != nil {
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// _hero, errdata = this.GetHeroByObjID(session.GetUserId(), heroObjID)
|
||||
// if errdata != nil {
|
||||
// return
|
||||
// }
|
||||
|
||||
// curAddExp, errdata = this.modelHero.AddCardExp(session, _hero, exp, nil)
|
||||
// if errdata != nil {
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// _changeHero = append(_changeHero, _hero) // 升级后的英雄 hero id 不变
|
||||
|
||||
// session.SendMsg(string(this.GetType()), "change", &pb.HeroChangePush{List: _changeHero})
|
||||
// return
|
||||
// }
|
||||
|
||||
// 英雄练功
|
||||
func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongfu bool, kongfuUid string) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
|
@ -148,16 +148,19 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
||||
return
|
||||
}
|
||||
// 加经验
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if cfgHunting.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
changExp[v.Oid] = cfgHunting.Heroexp
|
||||
if cfgHunting.Heroexp > 0 {
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
changExp[v.Oid] = cfgHunting.Heroexp
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, cfgHunting.Heroexp)
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, cfgHunting.Heroexp)
|
||||
|
||||
errdata = this.module.ModifyHuntingData(session.GetUserId(), mapData)
|
||||
userExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs)
|
||||
session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{
|
||||
|
@ -148,15 +148,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
|
||||
}
|
||||
|
||||
// 加英雄经验
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if conf.HeroExp > 0 && !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
if conf.HeroExp > 0 {
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, conf.HeroExp)
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, conf.HeroExp)
|
||||
|
||||
consumPs = info.Ps[req.Level]
|
||||
if userExp, errdata = this.module.ModuleUser.ConsumePsAddExp(session, consumPs); errdata != nil {
|
||||
|
@ -198,15 +198,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
|
||||
}
|
||||
}
|
||||
// 加英雄经验
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if stageConf.HeroExp > 0 && !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
if stageConf.HeroExp > 0 {
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, stageConf.HeroExp)
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, stageConf.HeroExp)
|
||||
|
||||
rsp.HeroExp = stageConf.HeroExp
|
||||
rsp.UserExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs)
|
||||
|
@ -95,15 +95,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
||||
return
|
||||
}
|
||||
// 加经验
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if conf.Exp > 0 && !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
if conf.Exp > 0 {
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, conf.Exp)
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, conf.Exp)
|
||||
|
||||
pagoda.Data[conf.Tab] += 1
|
||||
pagoda.PagodaId = conf.Key
|
||||
|
@ -94,15 +94,17 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
|
||||
}
|
||||
return
|
||||
}
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if conf.Exp > 0 && !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
if conf.Exp > 0 {
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, conf.Exp)
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, conf.Exp)
|
||||
|
||||
race.Race[conf.Restriction].Curfloor += 1
|
||||
race.Race[conf.Restriction].Defeat += 1
|
||||
|
@ -177,21 +177,24 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
||||
return
|
||||
}
|
||||
|
||||
errdata = this.module.ModifyVikingData(session.GetUserId(), mapData)
|
||||
if errdata = this.module.ModifyVikingData(session.GetUserId(), mapData); errdata != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// 加经验
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if vikingCfg.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
}
|
||||
if v.Ishelp {
|
||||
bHelp = true
|
||||
if vikingCfg.Heroexp > 0 {
|
||||
var heroObjs []string
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if !v.Ishelp { // 助战英雄不加经验
|
||||
heroObjs = append(heroObjs, v.Oid)
|
||||
} else {
|
||||
bHelp = true
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, vikingCfg.Heroexp)
|
||||
}
|
||||
this.module.ModuleHero.AddHerosExp(session, heroObjs, vikingCfg.Heroexp)
|
||||
|
||||
userExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs)
|
||||
session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{
|
||||
|
Loading…
Reference in New Issue
Block a user