This commit is contained in:
meixiongfeng 2023-08-08 19:00:15 +08:00
parent 8a310420c5
commit 76f3f39a6c

View File

@ -237,11 +237,26 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
update["gotarr"] = data.Gotarr update["gotarr"] = data.Gotarr
bChange = true bChange = true
} }
if data.Val == 0 {
var pos int32
_sub := int32((configure.Now().Unix()-activity.Stime)/(24*3600)) + 1
_days := this.configure.GetHDCelebrationData()
for index, v := range _days {
for i := 0; i < int(v); i++ {
pos++
if _sub == pos {
data.Val = int32(index) + 1 // 计算val 值
update["val"] = data.Val
break
}
}
}
data.Val = 1
}
if conf, err := this.configure.GetHDCelebration(data.Val); err == nil { if conf, err := this.configure.GetHDCelebration(data.Val); err == nil {
if conf.Systemtype == systemtype { if conf.Systemtype == systemtype {
data.Gotarr[bosstype] += 1 data.Gotarr[systemtype] += 1
// 天数 // 天数
var idays int32 var idays int32
for i, v1 := range conf.Bosstype { for i, v1 := range conf.Bosstype {
@ -253,7 +268,7 @@ func (this *Activity) HDCelebration(session comm.IUserSession, systemtype int32,
// 更新信息 // 更新信息
update["gotarr"] = data.Gotarr update["gotarr"] = data.Gotarr
bChange = true bChange = true
if data.Gotarr[bosstype] <= idays { if data.Gotarr[systemtype] <= idays {
bDouble = true bDouble = true
} }
} }