Bläddra i källkod

修改商品倍数

tang biao 6 år sedan
förälder
incheckning
c9b548a6cb

+ 7 - 7
assets/scene/game.fire

@@ -736,7 +736,7 @@
     "_skewY": 0,
     "_zIndex": 0,
     "groupIndex": 0,
-    "_id": "16XA8IW9VKs5HVz/JhtWSh"
+    "_id": "3eBvq/PtxBJr/zwVxGiIXH"
   },
   {
     "__type__": "cc.Label",
@@ -761,7 +761,7 @@
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
     "_N$overflow": 0,
-    "_id": "9ft2Qt/kNCtIyyd3eocJxN"
+    "_id": "f0l6gedCtMrZxPj7obUk31"
   },
   {
     "__type__": "cc.LabelOutline",
@@ -779,7 +779,7 @@
       "a": 255
     },
     "_width": 3,
-    "_id": "e9BlLJwI9NRZ5I3lGzgbTW"
+    "_id": "75oDm+gjJDaqsILDPW3DaB"
   },
   {
     "__type__": "cc.RichText",
@@ -1834,7 +1834,7 @@
     "_skewY": 0,
     "_zIndex": 0,
     "groupIndex": 0,
-    "_id": "8alcgsoSNLyKNZlcIJHyBu"
+    "_id": "1cb0ehbodKbJ2crUR2qyYR"
   },
   {
     "__type__": "cc.Label",
@@ -1859,7 +1859,7 @@
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
     "_N$overflow": 0,
-    "_id": "7fXY3xL5FJAaXFZEPTjo5Z"
+    "_id": "93nddA6p1JyI1ORFiavz4B"
   },
   {
     "__type__": "cc.RichText",
@@ -2279,7 +2279,7 @@
     "_skewY": 0,
     "_zIndex": 0,
     "groupIndex": 0,
-    "_id": "73EmA6rchGRYc7U/MnnEzT"
+    "_id": "a2qhBF+/NPIIHReY0OcEDD"
   },
   {
     "__type__": "cc.Label",
@@ -2304,7 +2304,7 @@
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
     "_N$overflow": 0,
-    "_id": "daP2RI+gxE1rgNgYo5ey12"
+    "_id": "04X0cJaJJNupceaEZRVG+7"
   },
   {
     "__type__": "cc.RichText",

+ 2 - 2
assets/scene/login.fire

@@ -41,8 +41,8 @@
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 0.37181409295352325,
-      "y": 0.37181409295352325,
+      "x": 0.2893553223388306,
+      "y": 0.2893553223388306,
       "z": 1
     },
     "_quat": {

+ 2 - 2
assets/scripts/common/UserInfo.js

@@ -217,7 +217,7 @@ cc.Class({
         if (this.rateGold.n > 0) {
             // this.gold = TapTapTool.add(this.rateGold, this.gold);
             let add = TapTapTool.multiple(this.rateGold, GameModule.skill.multiple);
-            add = TapTapTool.multiple(add, GameModule.userInfo.shop.multiple);
+            add = TapTapTool.multiple(add, GameModule.shop.multiple);
             this.gold = TapTapTool.add(this.gold, TapTapTool.multiple(add, this.perpetualMt));
             // this.gold += (this.rateGold * GameModule.skill.multiple * this.perpetualMt);
             this.secondRateTextAnimation();
@@ -236,7 +236,7 @@ cc.Class({
         if (this._rateGold.n > 0) {
             this.rateRichText.node.active = true;
             let rate = TapTapTool.multiple(GameModule.skill.multiple, this.perpetualMt);
-            rate = TapTapTool.multiple(rate, GameModule.userInfo.shop.multiple);
+            rate = TapTapTool.multiple(rate, GameModule.shop.multiple);
             let newValue = TapTapTool.multiple(rate, this._rateGold);
             this.rateRichText.string = `<outline color=#ffffff width=3><color=#009100>+${TapTapTool.parseToString(newValue)}</c></outline>`;
             this.rateCoinRichText.string = `<b>${TapTapTool.parseToString(newValue)}</b>`;

+ 3 - 3
assets/scripts/game/Game.js

@@ -223,10 +223,10 @@ cc.Class({
                         let shopData = userShops[i];
                         //// 处理商品信息流重复的问题
                         this.handelSocketShop(shopData);
-                        GameModule.userInfo.shop.handelShop(shopData);
-                        GameModule.userInfo.shop.updateTimeSchedule();
+                        GameModule.shop.handelShop(shopData);
+                        GameModule.shop.updateTimeSchedule();
                         /// 处理信息流信息
-                        GameModule.userInfo.shop.handleShpDataToMessageList(shopData);
+                        GameModule.shop.handleShpDataToMessageList(shopData);
                         
                         /// 增加商品钻石
                         if (shopData.diamond !== undefined && shopData.diamond > 0) {

+ 31 - 3
assets/scripts/game/GameShop.js

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

+ 1 - 1
assets/scripts/game/GameSkill.js

@@ -287,7 +287,7 @@ cc.Class({
         var clickGold = this.getBuildingGold();
         clickGold = clickGold * this.getSkill5Ability();
         let coinTap = TapTapTool.multiple({'n': clickGold, 'e': 0}, this.multiple);
-        coinTap = TapTapTool.multiple(coinTap, GameModule.userInfo.shop.multiple);
+        coinTap = TapTapTool.multiple(coinTap, GameModule.shop.multiple);
         GameModule.userInfo.coinTap = TapTapTool.multiple(coinTap, GameModule.userInfo.perpetualClickMt);
         GameModule.userInfo.refreshSecondText();
     },

+ 2 - 0
assets/scripts/levelHome/LevelHomeItem.js

@@ -235,10 +235,12 @@ cc.Class({
                 secondGold = TapTapTool.multiple(secondGold,roomMt);
                 secondGold = TapTapTool.multiple(secondGold, GameModule.skill.multiple);
                 secondGold = TapTapTool.multiple(secondGold, GameModule.userInfo.perpetualMt);
+                secondGold = TapTapTool.multiple(secondGold, GameModule.shop.multiple);
                 this.rateProgressLabel.string = `${TapTapTool.parseToString(secondGold)}/秒`;
 
                 nextDiffer = TapTapTool.multiple(nextDiffer,roomMt);
                 nextDiffer = TapTapTool.multiple(nextDiffer, GameModule.skill.multiple);
+                nextDiffer = TapTapTool.multiple(nextDiffer, GameModule.shop.multiple);
                 nextDiffer = TapTapTool.multiple(nextDiffer, GameModule.userInfo.perpetualMt);
 
                 this.nextRateLabel.string = `+${TapTapTool.parseToString(nextDiffer)}/秒`;

+ 14 - 7
assets/scripts/star/StarItem.js

@@ -88,7 +88,11 @@ cc.Class({
     undateStarCount() {
         if (this._starData.starCount > 0) {
             this.countNode.active = true;
-            this.countLabel.string = this._starData.starRoomCount + '/' + this._starData.starCount;
+            if (this._starData.starRoomCount <= this._starData.starCount) {
+                this.countLabel.string = this._starData.starRoomCount + '/' + this._starData.starCount;
+            } else {
+                this.countLabel.string = this._starData.starCount + '/' + this._starData.starCount;
+            }
         } else {
             this.countNode.active = false;
         }
@@ -124,25 +128,28 @@ cc.Class({
                 /// 如要明星的个数为解锁条件
                 if (this._starData.itemId == 101) {
                     /// 如果明星数量足够
+                    let newBuyStarCount = buyStarCount <= needCount ? buyStarCount : needCount;
                     if (buyStarCount >= needCount) {
-                        this.subTitleRichText1.string = "<img src='star_true'/><color=#2E2E2E>" + this._starInfo.desc + " (" + buyStarCount + "/" + needCount + ")" + "</c>";
+                        this.subTitleRichText1.string = "<img src='star_true'/><color=#2E2E2E>" + this._starInfo.desc + " (" + newBuyStarCount + "/" + needCount + ")" + "</c>";
                     } else {
                         this._isStarLocked = true;
-                        this.subTitleRichText1.string = "<img src='star_false'/><color=#2E2E2E>" + this._starInfo.desc + " (" + buyStarCount + "/" + needCount + ")" + "</c>";
+                        this.subTitleRichText1.string = "<img src='star_false'/><color=#2E2E2E>" + this._starInfo.desc + " (" + newBuyStarCount + "/" + needCount + ")" + "</c>";
                     }
                 } else if (this._starData.itemId == 102) {
+                    let newStarTypeCount = this._starTypeCount <= needCount ? this._starTypeCount : needCount;
                     if (this._starTypeCount >= needCount) {
-                        this.subTitleRichText1.string = "<img src='star_true'/><color=#2E2E2E>" + this._starInfo.desc + " (" + this._starTypeCount + "/" + needCount + ")" + "</c>";
+                        this.subTitleRichText1.string = "<img src='star_true'/><color=#2E2E2E>" + this._starInfo.desc + " (" + newStarTypeCount + "/" + needCount + ")" + "</c>";
                     } else {
                         this._isStarLocked = true;
-                        this.subTitleRichText1.string = "<img src='star_fale'/><color=#2E2E2E>" + this._starInfo.desc + " (" + this._starTypeCount + "/" + needCount + ")" + "</c>";
+                        this.subTitleRichText1.string = "<img src='star_fale'/><color=#2E2E2E>" + this._starInfo.desc + " (" + newStarTypeCount + "/" + needCount + ")" + "</c>";
                     }
                 } else {
+                    let newAreaStarCount = this._starData.areaStarCount <= needCount ? this._starData.areaStarCount : needCount;
                     if (this._starData.areaStarCount >= needCount) {
-                        this.subTitleRichText1.string = "<img src='star_true'/><color=#2E2E2E>" + this._starInfo.desc + " (" + this._starData.areaStarCount + "/" + needCount + ")" + "</c>";
+                        this.subTitleRichText1.string = "<img src='star_true'/><color=#2E2E2E>" + this._starInfo.desc + " (" + newAreaStarCount + "/" + needCount + ")" + "</c>";
                     } else {
                         this._isStarLocked = true;
-                        this.subTitleRichText1.string = "<img src='star_false'/><color=#2E2E2E>" + this._starInfo.desc + " (" + this._starData.areaStarCount + "/" + needCount + ")" + "</c>";
+                        this.subTitleRichText1.string = "<img src='star_false'/><color=#2E2E2E>" + this._starInfo.desc + " (" + newAreaStarCount + "/" + needCount + ")" + "</c>";
                     }
                 }
             } else {

+ 1 - 1
assets/scripts/utils/Global.js

@@ -14,7 +14,7 @@ window.Global = {
 
     debug: true,
 
-    ver: 112, //游戏版本号发版时需要核对
+    ver: 113, //游戏版本号发版时需要核对
     
     isCheck: false,
 

+ 2 - 2
settings/builder.json

@@ -37,11 +37,11 @@
   "title": "taptapstar",
   "webOrientation": "auto",
   "wechatgame": {
-    "REMOTE_SERVER_ROOT": "https://pub.dwstatic.com/wxgame/taptapstar",
+    "REMOTE_SERVER_ROOT": "https://pub.dwstatic.com/wxgame/taptapstar_test",
     "appid": "wx36581990a2e76fba",
     "isSubdomain": false,
     "orientation": "portrait",
-    "subContext": "wechatgame-subcontext"
+    "subContext": ""
   },
   "xxteaKey": "7480184a-3b45-4d",
   "zipCompressJs": true