Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
bdefb36245
@ -167,5 +167,14 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt
|
|||||||
Hero: stone.Hero,
|
Hero: stone.Hero,
|
||||||
Room: stone.Rooms,
|
Room: stone.Rooms,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var szTask []*pb.BuriedParam
|
||||||
|
for _, v := range szEvent { // 首次触发指定ID的事件
|
||||||
|
if c, e := this.module.configure.GetStoneEventDataById(v); e != nil {
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype223, c.EventType, 1))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
|
|||||||
eventConf *cfg.GameStoneEventData
|
eventConf *cfg.GameStoneEventData
|
||||||
reward []*pb.UserAtno
|
reward []*pb.UserAtno
|
||||||
curbuff int32
|
curbuff int32
|
||||||
|
newbuff int32 // 新获得的buff
|
||||||
)
|
)
|
||||||
update = make(map[string]interface{})
|
update = make(map[string]interface{})
|
||||||
if errdata = this.EventCheck(session, req); errdata != nil {
|
if errdata = this.EventCheck(session, req); errdata != nil {
|
||||||
@ -96,15 +97,17 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
|
|||||||
if lenSelect == 0 || lenSelect <= pos {
|
if lenSelect == 0 || lenSelect <= pos {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
buffid := stone.Rooms.Selectbuff[pos]
|
newbuff = stone.Rooms.Selectbuff[pos]
|
||||||
// 加入收藏
|
// 加入收藏
|
||||||
if conf, err := this.module.configure.GetStoneBuffDataById(buffid); err == nil {
|
if conf, err := this.module.configure.GetStoneBuffDataById(newbuff); err == nil {
|
||||||
stone.Userbuff[buffid] = 1
|
stone.Userbuff[newbuff] = 1
|
||||||
stone.Rooms.Selectbuff = []int32{}
|
stone.Rooms.Selectbuff = []int32{}
|
||||||
update["userbuff"] = stone.Userbuff
|
update["userbuff"] = stone.Userbuff
|
||||||
this.module.modelStonehengeBook.addStonehengeBook(session.GetUserId(), conf.Type, conf.SkillId)
|
this.module.modelStonehengeBook.addStonehengeBook(session.GetUserId(), conf.Type, conf.SkillId)
|
||||||
}
|
|
||||||
stone.Selectcount++ // 记录三选一的次数
|
stone.Selectcount++ // 记录三选一的次数
|
||||||
|
} else {
|
||||||
|
newbuff = 0
|
||||||
|
}
|
||||||
|
|
||||||
} else { // 参数错误
|
} else { // 参数错误
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -127,6 +130,10 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
|
|||||||
bWin := false
|
bWin := false
|
||||||
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||||
if errdata != nil {
|
if errdata != nil {
|
||||||
|
// 战斗失败埋点处理
|
||||||
|
var szTask []*pb.BuriedParam
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype225, 1))
|
||||||
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !bWin { // 战斗失败直接返回
|
if !bWin { // 战斗失败直接返回
|
||||||
@ -410,5 +417,76 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
|
|||||||
Userbuff: stone.Userbuff,
|
Userbuff: stone.Userbuff,
|
||||||
Curbuff: curbuff,
|
Curbuff: curbuff,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 埋点处理
|
||||||
|
var szTask []*pb.BuriedParam
|
||||||
|
for k := range stone.Rooms.Eventid { // 首次触发指定ID的事件
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype215, k))
|
||||||
|
}
|
||||||
|
var totalhp int32
|
||||||
|
//上阵英雄都为指定职业
|
||||||
|
if eventConf.EventType == EventType28 { // 必须是战斗类型才可以触发
|
||||||
|
var job int32
|
||||||
|
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||||
|
if h, err := this.module.ModuleTools.GetHeroConfig(v.HeroID); err != nil {
|
||||||
|
if job == 0 {
|
||||||
|
job = h.Job
|
||||||
|
}
|
||||||
|
if job != h.Job {
|
||||||
|
job = 0
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maxHp := v.Property[battle.AttributesTransBase("hp")]
|
||||||
|
totalhp += v.Currhp * 1000 / maxHp
|
||||||
|
}
|
||||||
|
if job != 0 { // 上阵英雄都为指定职业
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype216, job, stone.StageID)) //上阵英雄都为指定职业,击败石阵秘境中指定关卡的首领
|
||||||
|
}
|
||||||
|
for _, v := range stone.Webuff {
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype217, v, stone.StageID))
|
||||||
|
}
|
||||||
|
for _, v := range stone.Enemybuff {
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype217, v, stone.StageID))
|
||||||
|
}
|
||||||
|
// Rtype218 统计类型
|
||||||
|
var buffType map[int32]int32
|
||||||
|
buffType = make(map[int32]int32, 0)
|
||||||
|
for _, v := range stone.Webuff {
|
||||||
|
if conf, err := this.module.configure.GetStoneBuffDataById(v); err != nil {
|
||||||
|
buffType[conf.Type]++
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
for _, v := range stone.Enemybuff {
|
||||||
|
if conf, err := this.module.configure.GetStoneBuffDataById(v); err != nil {
|
||||||
|
buffType[conf.Type]++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for k, v := range buffType {
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype218, k, v, stone.StageID)) //携带指定类型、≥指定数量的buff,击败石阵秘境中指定关卡的首领
|
||||||
|
}
|
||||||
|
// 累计击败石阵秘境任意关卡的首领N次
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype219, stone.StageID))
|
||||||
|
|
||||||
|
//击败指定关卡的首领时,背包中指定道具数量≥指定数量
|
||||||
|
//this.module.ModuleItems.CleanItems()
|
||||||
|
//击败石阵秘境中指定关卡的首领时,每名上阵英雄血量≤比例(千分比)
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype224, totalhp, stone.StageID))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 强化商店
|
||||||
|
if eventConf.EventType == EventType29 {
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype220, 1)) // 强化buff 埋点
|
||||||
|
}
|
||||||
|
// 累计获得指定类型buff
|
||||||
|
if eventConf.EventType == EventType25 {
|
||||||
|
if newbuff != 0 {
|
||||||
|
if conf, err := this.module.configure.GetStoneBuffDataById(newbuff); err == nil {
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype221, conf.Type, 1)) //累计获得N个指定类型的buff
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,8 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.StonehengeFinishR
|
|||||||
stone.Addweight = make(map[int32]int32, 0)
|
stone.Addweight = make(map[int32]int32, 0)
|
||||||
update["addweight"] = stone.Addweight
|
update["addweight"] = stone.Addweight
|
||||||
|
|
||||||
|
// 清除指定类型道具 item,10000036 该货币在关卡结算时,清空
|
||||||
|
this.module.ModuleItems.CleanItemById(session, "10000036") // 策划强烈要求这样写
|
||||||
this.module.modelStonehenge.ChangeStonehengeData(session.GetUserId(), update)
|
this.module.modelStonehenge.ChangeStonehengeData(session.GetUserId(), update)
|
||||||
session.SendMsg(string(this.module.GetType()), "finish", &pb.StonehengeFinishResp{
|
session.SendMsg(string(this.module.GetType()), "finish", &pb.StonehengeFinishResp{
|
||||||
Data: stone,
|
Data: stone,
|
||||||
|
@ -163,5 +163,15 @@ func (this *apiComp) GotoRoom(session comm.IUserSession, req *pb.StonehengeGotoR
|
|||||||
Room: stone.Rooms,
|
Room: stone.Rooms,
|
||||||
Portal: req.Portal,
|
Portal: req.Portal,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 埋点
|
||||||
|
var szTask []*pb.BuriedParam
|
||||||
|
for _, v := range szEvent { // 首次触发指定ID的事件
|
||||||
|
if c, e := this.module.configure.GetStoneEventDataById(v); e != nil {
|
||||||
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype223, c.EventType, 1))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user