猫咪闪促优化
This commit is contained in:
parent
f14c0ba5d2
commit
52fbce102f
@ -312,6 +312,15 @@ func GetUnlockLv() int {
|
||||
return gamedata.GetIntValue(data, "Value")
|
||||
}
|
||||
|
||||
func GetCatSaleCD() int64 {
|
||||
data, err := gamedata.GetDataByKey(CFG_LIMITED_TIME_EVENT_CONST, "Event_Cooldown_7days")
|
||||
if err != nil {
|
||||
log.Debug("GetCatSaleCD err:%v", err)
|
||||
return 0
|
||||
}
|
||||
return int64(gamedata.GetIntValue(data, "Value"))
|
||||
}
|
||||
|
||||
func GetFirstEvent() int {
|
||||
data, err := gamedata.GetDataByKey(CFG_LIMITED_TIME_EVENT_CONST, "First_Event")
|
||||
if err != nil {
|
||||
|
||||
@ -50,6 +50,7 @@ type LimitedTimeEventMod struct {
|
||||
First bool
|
||||
FirstReward bool
|
||||
CatDaySale bool // 是否参与猫咪大甩卖活动
|
||||
LastCatDaySale int64 // 上次开启猫咪大甩卖时间
|
||||
}
|
||||
|
||||
type LTEInfo struct {
|
||||
@ -205,6 +206,9 @@ func (l *LimitedTimeEventMod) Trigger(Lv int) (int, []int, []int) {
|
||||
// 增加限时事件
|
||||
func (l *LimitedTimeEventMod) AddEvent(EventId, Duration int) int64 {
|
||||
v, ok := l.EventList[EventId]
|
||||
if EventId == EVENT_TYPE_CAT_DAY_SALE {
|
||||
l.LastCatDaySale = GoUtil.Now()
|
||||
}
|
||||
if ok && v.StartT+v.Remian > GoUtil.Now() {
|
||||
// 事件未过期
|
||||
v.Remian += int64(Duration)
|
||||
@ -366,6 +370,10 @@ func (l *LimitedTimeEventMod) SelectProgressReward(Id, Lv, Energy int) ([]*item.
|
||||
if Energy < limitedTimeEventCfg.GetHighRollerNeedEnergy() {
|
||||
delete(RandMap, limitedTimeEventCfg.GetJackpotIdByType(EVENT_TYPE_HIGH_ROLLER))
|
||||
}
|
||||
if GoUtil.Now()-l.LastCatDaySale < limitedTimeEventCfg.GetCatSaleCD() {
|
||||
// 参与猫咪大甩卖活动时,猫咪大甩卖事件不进池子
|
||||
delete(RandMap, limitedTimeEventCfg.GetJackpotIdByType(EVENT_TYPE_CAT_DAY_SALE))
|
||||
}
|
||||
n := 0
|
||||
r := make([]int, 0)
|
||||
LastOption := l.LastOption
|
||||
|
||||
Loading…
Reference in New Issue
Block a user