|
@@ -18,9 +18,9 @@ cc.Class({
|
|
// LIFE-CYCLE CALLBACKS:
|
|
// LIFE-CYCLE CALLBACKS:
|
|
onLoad () {
|
|
onLoad () {
|
|
this.multiple = {'n': 1, 'e': 0};
|
|
this.multiple = {'n': 1, 'e': 0};
|
|
|
|
+ GameModule.shop = this;
|
|
this.handelUserShops();
|
|
this.handelUserShops();
|
|
this.setUpNotification();
|
|
this.setUpNotification();
|
|
- GameModule.userInfo.shop = this;
|
|
|
|
},
|
|
},
|
|
|
|
|
|
handelUserShops() {
|
|
handelUserShops() {
|
|
@@ -41,9 +41,13 @@ cc.Class({
|
|
setUpNotification() {
|
|
setUpNotification() {
|
|
GameEvent.on('store_buy_coin_updateDiamond', this, (infoDesc) => {
|
|
GameEvent.on('store_buy_coin_updateDiamond', this, (infoDesc) => {
|
|
/// 说明前面没有这个商品
|
|
/// 说明前面没有这个商品
|
|
- if (this._diamondShopCoinTime === 0) {
|
|
|
|
|
|
+ if (this._diamondShopCoinTime <= 0) {
|
|
let objc2 = {'n': 2, 'e': 0};
|
|
let objc2 = {'n': 2, 'e': 0};
|
|
this.multiple = TapTapTool.multiple(this.multiple, objc2);
|
|
this.multiple = TapTapTool.multiple(this.multiple, objc2);
|
|
|
|
+ if (GameModule.skill !== undefined && GameModule.skill !== null) {
|
|
|
|
+ GameModule.skill.updateClickGold();
|
|
|
|
+ GameModule.userInfo.refreshSecondText();
|
|
|
|
+ }
|
|
let objct = {'cdTime': 15 * 60 * 1000, 'infoDesc': infoDesc, 'icon': 900004, 'sId': 12, 'type': 1};
|
|
let objct = {'cdTime': 15 * 60 * 1000, 'infoDesc': infoDesc, 'icon': 900004, 'sId': 12, 'type': 1};
|
|
Global._timeInformations.push(objct);
|
|
Global._timeInformations.push(objct);
|
|
GameEvent.fire(GameNotificationKey.GameUpdateMessageList, 1, true);
|
|
GameEvent.fire(GameNotificationKey.GameUpdateMessageList, 1, true);
|
|
@@ -101,6 +105,10 @@ cc.Class({
|
|
if(shop.shopId == 12) {
|
|
if(shop.shopId == 12) {
|
|
this._diamondShopCoinTime += shop.cdTime / 1000;
|
|
this._diamondShopCoinTime += shop.cdTime / 1000;
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': 2});
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': 2});
|
|
|
|
+ if (GameModule.skill !== undefined && GameModule.skill !== null) {
|
|
|
|
+ GameModule.skill.updateClickGold();
|
|
|
|
+ GameModule.userInfo.refreshSecondText();
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
let shopIndex = this._timeShopIdArr.indexOf(shop.shopId);
|
|
let shopIndex = this._timeShopIdArr.indexOf(shop.shopId);
|
|
/// 如果以前没有过当前商品
|
|
/// 如果以前没有过当前商品
|
|
@@ -109,11 +117,19 @@ cc.Class({
|
|
this._useTimeArr.push(shop.cdTime / 1000);
|
|
this._useTimeArr.push(shop.cdTime / 1000);
|
|
this._mtArr.push(shop.mt);
|
|
this._mtArr.push(shop.mt);
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': shop.mt});
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': shop.mt});
|
|
|
|
+ if (GameModule.skill !== undefined && GameModule.skill !== null) {
|
|
|
|
+ GameModule.skill.updateClickGold();
|
|
|
|
+ GameModule.userInfo.refreshSecondText();
|
|
|
|
+ }
|
|
/// 以前有过,直接增加时间
|
|
/// 以前有过,直接增加时间
|
|
} else {
|
|
} else {
|
|
/// 说明已经停止使用
|
|
/// 说明已经停止使用
|
|
if (this._useTimeArr[shopIndex] <= 0) {
|
|
if (this._useTimeArr[shopIndex] <= 0) {
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': shop.mt});
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': shop.mt});
|
|
|
|
+ if (GameModule.skill !== undefined && GameModule.skill !== null) {
|
|
|
|
+ GameModule.skill.updateClickGold();
|
|
|
|
+ GameModule.userInfo.refreshSecondText();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this._useTimeArr[shopIndex] += shop.cdTime / 1000;
|
|
this._useTimeArr[shopIndex] += shop.cdTime / 1000;
|
|
}
|
|
}
|
|
@@ -124,6 +140,10 @@ cc.Class({
|
|
/// 说明是礼包类型
|
|
/// 说明是礼包类型
|
|
if (shop.type == 4) {
|
|
if (shop.type == 4) {
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': shop.mt});
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': shop.mt});
|
|
|
|
+ if (GameModule.skill !== undefined && GameModule.skill !== null) {
|
|
|
|
+ GameModule.skill.updateClickGold();
|
|
|
|
+ GameModule.userInfo.refreshSecondText();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//// 如果是长按点击的商品
|
|
//// 如果是长按点击的商品
|
|
@@ -165,15 +185,23 @@ cc.Class({
|
|
if (this.multiple.n <= 0) {
|
|
if (this.multiple.n <= 0) {
|
|
this.multiple = {'n': 1, 'e': 0};
|
|
this.multiple = {'n': 1, 'e': 0};
|
|
}
|
|
}
|
|
|
|
+ if (GameModule.skill !== undefined && GameModule.skill !== null) {
|
|
|
|
+ GameModule.skill.updateClickGold();
|
|
|
|
+ GameModule.userInfo.refreshSecondText();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (let i = 0; i < newArr.length; ++i) {
|
|
for (let i = 0; i < newArr.length; ++i) {
|
|
this._useTimeArr[i] -= 1;
|
|
this._useTimeArr[i] -= 1;
|
|
if (this._useTimeArr[0] <= 0) {
|
|
if (this._useTimeArr[0] <= 0) {
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': 1 / this._mtArr[i]});
|
|
this.multiple = TapTapTool.multiple(this.multiple, {'e': 0, 'n': 1 / this._mtArr[i]});
|
|
- if (this.multiple.n <= 0) {
|
|
|
|
|
|
+ if (this.multiple.n <= 0 ) {
|
|
this.multiple = {'n': 1, 'e': 0};
|
|
this.multiple = {'n': 1, 'e': 0};
|
|
}
|
|
}
|
|
|
|
+ if (GameModule.skill !== undefined && GameModule.skill !== null) {
|
|
|
|
+ GameModule.skill.updateClickGold();
|
|
|
|
+ GameModule.userInfo.refreshSecondText();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|