英雄转换碎片
This commit is contained in:
parent
16388621e7
commit
4f6aafdcde
@ -561,6 +561,10 @@ const (
|
|||||||
Rtype155 TaskType = 155 //调整助战英雄n次
|
Rtype155 TaskType = 155 //调整助战英雄n次
|
||||||
Rtype156 TaskType = 156 //完成工会任务n次
|
Rtype156 TaskType = 156 //完成工会任务n次
|
||||||
Rtype157 TaskType = 157 //战斗在xx系统中完成xx事件
|
Rtype157 TaskType = 157 //战斗在xx系统中完成xx事件
|
||||||
|
Rtype158 TaskType = 158 //主线第X章关卡总星数达到N星
|
||||||
|
Rtype159 TaskType = 159 //主线第X章关卡全部达到三星
|
||||||
|
Rtype160 TaskType = 160 //主线总星数达到X星
|
||||||
|
Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -886,10 +886,9 @@ func (this *ModelHero) resetTalentProperty(hero *pb.DBHero) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 创建一条英雄信息,如果有这个英雄 则转换成对应的碎片
|
// 创建一条英雄信息,如果有这个英雄 则转换成对应的碎片
|
||||||
func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, count int32) (hero *pb.DBHero, err error) {
|
func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, count int32) (hero *pb.DBHero, bFirst bool, err error) {
|
||||||
heros := make([]*pb.DBHero, 0)
|
heros := make([]*pb.DBHero, 0)
|
||||||
uid := session.GetUserId()
|
uid := session.GetUserId()
|
||||||
bNew := false // 新活得的英雄
|
|
||||||
if this.moduleHero.IsCross() {
|
if this.moduleHero.IsCross() {
|
||||||
if dbModel, err := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
if dbModel, err := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
|
||||||
this.moduleHero.Errorln(err)
|
this.moduleHero.Errorln(err)
|
||||||
@ -905,14 +904,18 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, obj := range heros {
|
for _, obj := range heros {
|
||||||
if obj.HeroID == heroCfgId { // z
|
if obj.HeroID == heroCfgId {
|
||||||
bNew = true
|
hero = obj
|
||||||
|
bFirst = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !bNew { // 没有当前英雄
|
if hero != nil { // 没有当前英雄
|
||||||
count -= 1
|
count -= 1
|
||||||
hero, err = this.initHeroOverlying(uid, heroCfgId, 1)
|
hero, err = this.initHeroOverlying(uid, heroCfgId, 1)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转碎片处理
|
// 转碎片处理
|
||||||
|
@ -77,9 +77,12 @@ func (this *Hero) Start() (err error) {
|
|||||||
|
|
||||||
//创建单个叠加英雄
|
//创建单个叠加英雄
|
||||||
func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, num int32) (hero *pb.DBHero, code pb.ErrorCode) {
|
func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, num int32) (hero *pb.DBHero, code pb.ErrorCode) {
|
||||||
var err error
|
var (
|
||||||
hero, err = this.modelHero.createHero(session, heroCfgId, num)
|
err error
|
||||||
if err == nil {
|
bFirst bool
|
||||||
|
)
|
||||||
|
hero, bFirst, err = this.modelHero.createHero(session, heroCfgId, num)
|
||||||
|
if err == nil && bFirst {
|
||||||
//go func(uid string, heroCfgId string) { // 携程处理 图鉴数据
|
//go func(uid string, heroCfgId string) { // 携程处理 图鉴数据
|
||||||
if db.IsCross() {
|
if db.IsCross() {
|
||||||
this.moduleFetter.SendRpcAddHero(session, heroCfgId)
|
this.moduleFetter.SendRpcAddHero(session, heroCfgId)
|
||||||
@ -295,9 +298,9 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]
|
|||||||
this.ModuleUser.ChangeUserExpand(session.GetUserId(), initUpdate)
|
this.ModuleUser.ChangeUserExpand(session.GetUserId(), initUpdate)
|
||||||
firstGet = append(firstGet, heroCfgId)
|
firstGet = append(firstGet, heroCfgId)
|
||||||
}
|
}
|
||||||
|
changeList = append(changeList, hero)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changeList = append(changeList, hero)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if bPush && len(changeList) > 0 { //推送
|
if bPush && len(changeList) > 0 { //推送
|
||||||
|
Loading…
Reference in New Issue
Block a user