This commit is contained in:
meixiongfeng 2023-08-10 16:58:35 +08:00
commit 7e63436373
12 changed files with 178 additions and 85 deletions

View File

@ -26331,7 +26331,7 @@
"key": "buried_buried_condi_tasktxt_938",
"text": "当日消耗100点体力"
},
"type": 303,
"type": 213,
"valid": 0,
"head": {
"a": "attr",
@ -26397,7 +26397,7 @@
"key": "buried_buried_condi_tasktxt_941",
"text": "当日消耗30点体力"
},
"type": 303,
"type": 213,
"valid": 0,
"head": {
"a": "attr",
@ -26551,7 +26551,7 @@
"key": "buried_buried_condi_tasktxt_941",
"text": "当日消耗100点体力"
},
"type": 303,
"type": 213,
"valid": 0,
"head": {
"a": "attr",
@ -26705,7 +26705,7 @@
"key": "buried_buried_condi_tasktxt_941",
"text": "当日消耗300点体力"
},
"type": 303,
"type": 213,
"valid": 0,
"head": {
"a": "attr",

View File

@ -1196,29 +1196,34 @@
]
},
{
"id": 300,
"id": 210,
"insert": 1,
"filter": [
"eq"
]
},
{
"id": 301,
"id": 211,
"insert": 1,
"filter": [
"eq"
]
},
{
"id": 302,
"id": 212,
"insert": 1,
"filter": [
"eq"
]
},
{
"id": 303,
"insert": 1,
"id": 213,
"insert": 2,
"filter": []
},
{
"id": 214,
"insert": 2,
"filter": []
}
]

View File

@ -10,10 +10,10 @@
"text": "月末狂欢,冰点特价"
},
"resource": "",
"integral": [
3000
"condition": [
60000004
],
"condition": 60000004,
"condition_or": [],
"lbid": [
{
"a": "attr",
@ -38,10 +38,10 @@
"text": "月末狂欢,冰点特价"
},
"resource": "",
"integral": [
3000
"condition": [
60000005
],
"condition": 60000005,
"condition_or": [],
"lbid": [
{
"a": "attr",
@ -66,10 +66,10 @@
"text": "月末狂欢,冰点特价"
},
"resource": "",
"integral": [
3000
"condition": [
60000006
],
"condition": 60000006,
"condition_or": [],
"lbid": [
{
"a": "attr",
@ -94,10 +94,10 @@
"text": "月末狂欢,冰点特价"
},
"resource": "",
"integral": [
3000
"condition": [
60000007
],
"condition": 60000007,
"condition_or": [],
"lbid": [
{
"a": "attr",
@ -122,10 +122,10 @@
"text": "月末狂欢,冰点特价"
},
"resource": "",
"integral": [
3000
"condition": [
60000008
],
"condition": 60000008,
"condition_or": [],
"lbid": [
{
"a": "attr",
@ -150,10 +150,10 @@
"text": "月末狂欢,冰点特价"
},
"resource": "",
"integral": [
3000
"condition": [
60000009
],
"condition": 60000009,
"condition_or": [],
"lbid": [
{
"a": "attr",
@ -178,10 +178,10 @@
"text": "月末狂欢,冰点特价"
},
"resource": "",
"integral": [
3000
"condition": [
70000001
],
"condition": 70000001,
"condition_or": [],
"lbid": [
{
"a": "attr",

View File

@ -741,11 +741,9 @@ const (
Rtype101 TaskType = 101 //获得X星职业武器N件历史(从创号开始记录每获得1件X星职业武器则进度+1)
Rtype102 TaskType = 102 //阵营饰品强化成功N次历史(从创号开始记录,强化成功进度+1)
Rtype103 TaskType = 103 //获得X星阵营饰品N件历史(从创号开始记录每获得1件X星阵营饰品则进度+1)
//消费N个钻石历史(从创号开始记录,每次消耗钻石增加消耗额的进度)
Rtype104 TaskType = 104
Rtype104 TaskType = 104 //消费N个钻石历史(从创号开始记录,每次消耗钻石增加消耗额的进度)
Rtype105 TaskType = 105 //商店刷新N次(从接到任务开始,每次刷新商店进度+1)
Rtype106 TaskType = 106 //跨服聊天发言N次(从接到任务开始,每次跨服发言成功进度+1)
Rtype108 TaskType = 108 //助战英雄被使用X次(从接到任务开始每被使用1次则进度+1)
Rtype109 TaskType = 109 //加入公会(打开任务时,检查是否加入了公会,加入则完成)
Rtype110 TaskType = 110 //激活X个英雄图鉴(打开任务时,检查英雄图鉴激活数量并计入进度,达到了任务所需个数则完成任务。)
@ -842,6 +840,7 @@ const (
Rtype211 TaskType = 211 // 向指定X城市贩卖价值X虚拟币以上的对应城市急需货物
Rtype212 TaskType = 212 // 接取任务后,商队抵达指定城市
Rtype213 TaskType = 213 // 消耗X体力
Rtype214 TaskType = 214 // 获得x充值积分
)
const (
MailLineEasy int32 = 1 // 简单

View File

@ -596,7 +596,7 @@ func (this *Buried) trigger(session comm.IUserSession, burieds ...*pb.BuriedPara
} else {
this.wtask.BuriedsNotify(session, changes)
this.smithy.BuriedsNotify(session, changes)
this.sociaty.BuriedsNotify(session, changes)
// this.sociaty.BuriedsNotify(session, changes)
}
}

View File

@ -394,17 +394,6 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
this.Warn("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
return
}
// 统计今天消耗的体力
if k == "ps" && v < 0 {
if userexpand, err := this.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
userexpand.ConsumPs += (-v)
this.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
"consumPs": userexpand.ConsumPs,
})
go this.ModuleUiGame.HDPSTodayConsum(session.GetUserId(), userexpand.ConsumPs) //
}
}
}
for k, v := range items {
amount := this.ModuleItems.QueryItemAmount(session.GetUserId(), k)
@ -426,10 +415,6 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
return
}
this.Debug("消耗玩家资源", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "attrs", Value: attrs})
if count, ok := attrs[comm.ResDiamond]; ok {
// this.ModuleBuried.SendToRtask(session, comm.Rtype104, -count)
go this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype104, -count))
}
}
if len(items) > 0 {
_, errdata = this.ModuleItems.AddItems(session, items, bPush)

View File

@ -99,7 +99,9 @@ func (this *PushGiftbag) BuriedsNotify(session comm.IUserSession, condis []*pb.C
info *pb.DBPushGiftbag
user *pb.DBUser
condisMap map[int32]*pb.ConIProgress = make(map[int32]*pb.ConIProgress)
comdisScils []int32 = make([]int32, 0)
targets map[int32]*cfg.GamePushGiftData = make(map[int32]*cfg.GamePushGiftData)
conIProgress *pb.ConIProgress
item []*pb.DBPushGiftbagItem
ok bool
err error
@ -122,24 +124,71 @@ func (this *PushGiftbag) BuriedsNotify(session comm.IUserSession, condis []*pb.C
}
for _, v := range confs {
if _, ok = condisMap[v.Condition]; ok && user.Integral >= int64(v.Integral[0]) && user.Integral <= int64(v.Integral[1]) {
for _, v1 := range v.Condition {
if _, ok = condisMap[v1]; ok {
targets[v.Id] = v
comdisScils = append(comdisScils, v.Condition...)
break
}
}
}
for _, v := range comdisScils {
if _, ok = condisMap[v]; !ok { //条件不全需要查询全部条件
if condis, err = this.ModuleBuried.CheckCondition(session.GetUserId(), comdisScils...); err != nil {
this.Error("校验玩家子任务进度数据 失败", log.Field{Key: "err", Value: err.Error()})
return
}
condisMap = make(map[int32]*pb.ConIProgress)
for _, v := range condis {
condisMap[v.Conid] = v
}
break
}
}
for k, v := range targets {
for _, cid := range v.Condition {
if conIProgress, ok = condisMap[cid]; !ok || conIProgress.State == pb.BuriedItemFinishState_buried_unfinish { //未完成
delete(targets, k)
}
}
for _, cid := range v.ConditionOr {
if conIProgress, ok = condisMap[cid]; ok && conIProgress.State == pb.BuriedItemFinishState_buried_finish { //完成一个即可
ok = true
break
}
ok = false
}
if !ok {
delete(targets, k)
}
}
if len(targets) > 0 {
item = make([]*pb.DBPushGiftbagItem, 0)
for _, target := range targets {
ok = false
for _, v := range info.Item {
if _, ok = targets[v.Id]; ok {
if target.Id == v.Id {
v.Stime = configure.Now().Unix()
} else {
ok = true
break
}
}
if !ok {
item = append(item, &pb.DBPushGiftbagItem{
Id: v.Id,
Id: target.Id,
Stime: configure.Now().Unix(),
})
}
}
if len(item) > 0 {
info.Item = append(info.Item, item...)
}
this.model.Change(session.GetUserId(), map[string]interface{}{
"item": info.Item,
})
session.SendMsg(string(this.GetType()), "chanage", &pb.PushGiftbagChanagePush{Item: info.Item})
}
}

View File

@ -146,6 +146,21 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.StorylineComple
} else if conf.Leveltype == 4 {
item.Level[req.Level] = 1
item.Chapter[conf.Chapter] = configure.Now().Unix()
} else if conf.Leveltype == 5 {
if req.Report != nil {
if errdata, iswin = this.module.battle.CheckBattleReport(session, req.Report); errdata != nil {
return
}
if !iswin {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: "battle no win!",
}
return
}
}
item.Level[req.Level] = 1
} else {
item.Level[req.Level] = 1
}

View File

@ -441,7 +441,6 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
}
return
}
this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype68, -(add)))
}
change.Gold += int64(add)
case comm.ResExp:
@ -546,6 +545,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
return
}
change.Ps += add
userEx.ConsumPs += -add
} else {
if change.Ps+add > ggd.PsUl {
change.Ps = ggd.PsUl
@ -652,6 +652,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
comm.ResFriend: change.Friend,
comm.SociatyCoin: change.Guildcoin,
comm.ArenaCoin: change.Arenacoin,
"consumPs": userEx.ConsumPs,
}
if err := this.modelUser.updateUserAttr(uid, update); err != nil {
@ -696,27 +697,47 @@ func (this *User) AddAttributeValue(session comm.IUserSession, attr string, add
// 用户资源
func (this *User) AddAttributeValues(session comm.IUserSession, attrs map[string]int32, bPush bool) (errdata *pb.ErrorData) {
var (
expChange bool
vipExpChange bool
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
_change *pb.UserResChangedPush
)
for key, add := range attrs {
var _change *pb.UserResChangedPush
_change, errdata = this.change(session, key, add)
if errdata != nil {
return
}
if _change == nil {
continue
if key == comm.ResExp {
expChange = true
} else if key == comm.VipExp {
vipExpChange = true
}
if key == comm.ResPs && add < 0 { //消耗体力
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype213, -add))
}
if key == comm.ResGold && add < 0 { //消耗体力
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype68, -add))
}
if key == comm.ResDiamond && add < 0 { //消耗钻石
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype104, -add))
}
if key == comm.Integral && add > 0 { //积分获取
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype214, add))
}
}
if bPush { //推送玩家账号信息变化消息
session.SendMsg(string(this.GetType()), "reschanged", _change)
}
if key == comm.ResExp {
if expChange {
this.ModuleUser.EventUserChanged(session)
} else if key == comm.VipExp {
}
if vipExpChange {
this.ModuleUser.EventUserVipChanged(session)
}
if len(tasks) > 0 {
go this.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
}
return
}

View File

@ -86,4 +86,9 @@ const (
GameBuffType_SHILED_CAN_ADD = 93
GameBuffType_SPECIAL_SHIELD = 94
GameBuffType_PROB_RESISTBUFF = 95
GameBuffType_HAS_BUFF_MODIFY_EFFECT_RESIST = 96
GameBuffType_ADJUST_PRO_BY_DMG = 97
GameBuffType_BE_DMG_ADD_ONCE_PER_PERSON = 98
GameBuffType_IGNORE_EFFECT_RESIST = 99
GameBuffType_IGNORE_IMMUNITY = 100
)

View File

@ -118,5 +118,6 @@ const (
GamePropertyType_Shield_Per = 106
GamePropertyType_Base_Shield = 107
GamePropertyType_Ext_Shield = 108
GamePropertyType_Max = 109
GamePropertyType_TreCrit = 109
GamePropertyType_Max = 110
)

View File

@ -15,8 +15,8 @@ type GamePushGiftData struct {
Name string
Title string
Resource string
Integral []int32
Condition int32
Condition []int32
ConditionOr []int32
Lbid []*Gameatn
Time int32
Rebate int32
@ -39,18 +39,31 @@ func (_v *GamePushGiftData)Deserialize(_buf map[string]interface{}) (err error)
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["integral"].([]interface{}); !_ok_ { err = errors.New("integral error"); return }
if _arr_, _ok_ = _buf["condition"].([]interface{}); !_ok_ { err = errors.New("condition error"); return }
_v.Integral = make([]int32, 0, len(_arr_))
_v.Condition = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Integral = append(_v.Integral, _list_v_)
_v.Condition = append(_v.Condition, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["condition_or"].([]interface{}); !_ok_ { err = errors.New("condition_or error"); return }
_v.ConditionOr = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.ConditionOr = append(_v.ConditionOr, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["condition"].(float64); !_ok_ { err = errors.New("condition error"); return }; _v.Condition = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool