新增事件处理 图鉴记录技能id

This commit is contained in:
meixiongfeng 2023-08-15 15:31:17 +08:00
parent 0f5ee04eee
commit eea2ab9e52
2 changed files with 46 additions and 1 deletions

View File

@ -102,7 +102,7 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
stone.Userbuff[buffid] = 1 stone.Userbuff[buffid] = 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, buffid) this.module.modelStonehengeBook.addStonehengeBook(session.GetUserId(), conf.Type, conf.SkillId)
} }
} else { // 参数错误 } else { // 参数错误
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -279,6 +279,48 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
} }
} }
} }
case EventType13: // 扣除背包中指定道具数量
amount := this.module.ModuleItems.QueryItemAmount(session.GetUserId(), strconv.Itoa(int(eventConf.Value2))) // 查询道具的数量
if amount > 0 {
if n := math.Floor(float64(int32(amount)*eventConf.Value1) / 1000); n > 0 {
atn := &cfg.Gameatn{
A: "item",
T: strconv.Itoa(int(eventConf.Value2)),
N: int32(n),
}
if errdata = this.module.ConsumeRes(session, []*cfg.Gameatn{atn}, true); errdata != nil {
return
}
}
}
case EventType24: // 增加背包中指定道具数量
amount := this.module.ModuleItems.QueryItemAmount(session.GetUserId(), strconv.Itoa(int(eventConf.Value2)))
if amount > 0 {
if n := math.Floor(float64(int32(amount)*eventConf.Value1) / 1000); n > 0 {
atn := &cfg.Gameatn{
A: "item",
T: strconv.Itoa(int(eventConf.Value2)),
N: int32(n),
}
if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{atn}, true); errdata != nil {
return
}
}
}
case EventType26: //所有1级buff强化至2级
// 查询所有1级buff
for _, v := range stone.Userbuff {
if conf, e := this.module.configure.GetStoneBuffDataById(v); e != nil {
if conf.BuffLevel == 1 {
// 是否有2级
if nextConf, e := this.module.configure.GetStoneBuffDataById(v + 1); e != nil {
delete(stone.Userbuff, v)
stone.Userbuff[nextConf.BuffId] = 1
}
}
}
}
update["userbuff"] = stone.Userbuff
} }

View File

@ -4,6 +4,7 @@ package stonehenge
const ( const (
EventType10 = 10 // 宝箱事件 EventType10 = 10 // 宝箱事件
EventType11 = 11 // 剧情事件 EventType11 = 11 // 剧情事件
EventType13 = 13 // 扣除背包中指定道具数量
EventType14 = 14 // 战斗事件 EventType14 = 14 // 战斗事件
EventType16 = 16 // 捡垃圾事件 EventType16 = 16 // 捡垃圾事件
EventType17 = 17 // 回血事件 EventType17 = 17 // 回血事件
@ -11,7 +12,9 @@ const (
EventType19 = 19 // 扣血事件 非场景 EventType19 = 19 // 扣血事件 非场景
EventType20 = 20 // 克隆一名英雄 EventType20 = 20 // 克隆一名英雄
EventType23 = 23 // 事件buff强化 EventType23 = 23 // 事件buff强化
EventType24 = 24 // 增加背包中指定道具数量
EventType25 = 25 // buff三选一 EventType25 = 25 // buff三选一
EventType26 = 26 // 所有1级buff强化至2级
EventType28 = 28 // BOSS 战斗 EventType28 = 28 // BOSS 战斗
EventType29 = 29 // 商店强化 EventType29 = 29 // 商店强化
) )