弹出礼包:添加同类型拦截参数
This commit is contained in:
@@ -22,6 +22,7 @@ interface PopUpShopPackageInDb {
|
||||
items: PopUpShopItemInDb[]; // 礼包
|
||||
duration: number; // 礼包弹出之后,持续时间,单位小时
|
||||
keyItem: PopUpShopKeyItemIbDb[]; // 关键资源限制,refreshDay内可以获得Y个
|
||||
checkPushingItem: number; // 是否在有同类型礼包的时候弹新礼包
|
||||
refreshTimeType: number; // 刷新时间类型,0-不复现 1-自然日 2-自然周 3-自然月 4-从beginTime开始固定天 5-按pvp赛季
|
||||
refreshDay: number; // 上面刷新时间的具体天数,refreshTimeType=0-3都不会使用这个参数,refreshTimeType=4时这个表示固定几天
|
||||
pushCnt: number; // 在自然日cd之内,总推送次数,不复现的填0,不限制这个使用其他限制的填-1(如passCnt填次数的时候,这里填-1)
|
||||
@@ -149,6 +150,7 @@ export class PopUpShopPackage {
|
||||
id: number; // 弹出礼包id
|
||||
conditionType: number; // 条件类型
|
||||
canLvUp: number; // 是否可升降
|
||||
checkPushingItem: number; // 是否在同类型礼包
|
||||
duration: number; // 礼包弹出之后,持续时间,单位小时
|
||||
refreshTimeType: number; // 刷新时间类型,0-不复现 1-自然日 2-自然周 3-自然月 4-从beginTime开始固定天
|
||||
refreshDay: number; // 复现自然日cd,不复现的填0,从弹出礼包那一天的凌晨5点开始计数
|
||||
@@ -175,6 +177,7 @@ export class PopUpShopPackage {
|
||||
this.conditionType = data.conditionType;
|
||||
this.canLvUp = data.canLvUp;
|
||||
this.duration = data.duration;
|
||||
this.checkPushingItem = data.checkPushingItem;
|
||||
this.refreshTimeType = data.refreshTimeType;
|
||||
this.refreshDay = data.refreshDay;
|
||||
this.pushCnt = data.pushCnt;
|
||||
@@ -221,7 +224,8 @@ export class PopUpShopPackage {
|
||||
let item = this.findItemByProductID(itemData.productID);
|
||||
if(item) {
|
||||
item.setPlayerRecords(data, itemData);
|
||||
this.isPushing = true;
|
||||
console.log('#### item.isPushing', item.isPushing)
|
||||
if(item.isPushing) this.isPushing = true;
|
||||
}
|
||||
}
|
||||
} else if (data.beginTime < now && data.endTime < now) { // 已经结束了的
|
||||
@@ -251,9 +255,9 @@ export class PopUpShopPackage {
|
||||
console.log('######### 3.5.1', this.conditionType, conditionType, this.conditionType != conditionType)
|
||||
if(this.conditionType != conditionType) return false;
|
||||
// 2. 判断同类型是否是已经有在持续中的
|
||||
console.log('######### 3.5.2', this.refreshTimeType, this.isPushing, this.refreshTimeType != 0 && this.isPushing)
|
||||
if(this.refreshTimeType != 0 && this.isPushing) return false;
|
||||
// // 3. 自然日内推送次数
|
||||
console.log('######### 3.5.2', this.checkPushingItem, this.isPushing);
|
||||
if(this.checkPushingItem && this.isPushing) return false;
|
||||
// 3. 自然日内推送次数
|
||||
console.log('######### 3.5.3', this.canLvUp, this.pushCnt, this.hasPushCnt, this.pushCnt != -1, this.hasPushCnt >= this.pushCnt)
|
||||
if(this.canLvUp == 1 && this.pushCnt != -1 && this.hasPushCnt >= this.pushCnt) return false;
|
||||
// 4. 连续无视次数
|
||||
@@ -388,7 +392,9 @@ export class PopShopItem {
|
||||
this.beginTime = data.beginTime.getTime();
|
||||
this.endTime = data.endTime.getTime();
|
||||
this.hasBoughtCnt = item.hasBoughtCnt;
|
||||
this.isPushing = true;
|
||||
if(this.hasBoughtCnt < this.buyCnt) {
|
||||
this.isPushing = true;
|
||||
}
|
||||
}
|
||||
|
||||
public addPushCnt() {
|
||||
|
||||
Reference in New Issue
Block a user