浏览代码

修改偷菜数据逻辑

slambb 3 年之前
父节点
当前提交
b62d8ead16

+ 60 - 42
assets/Scene/MyCityScene - 004.fire

@@ -769,7 +769,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 1108.5125168440816
+      "z": 504.0267850025433
     },
     "_scale": {
       "__type__": "cc.Vec3",
@@ -913,7 +913,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 1108.5125168440816
+      "z": 504.0267850025433
     },
     "_scale": {
       "__type__": "cc.Vec3",
@@ -21719,7 +21719,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 182.207,
+      "x": 210.546,
       "y": 82.192,
       "z": 0
     },
@@ -29362,9 +29362,7 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "ab2f10ac-3a45-4437-b693-3abcdc844f47"
-    },
+    "_spriteFrame": null,
     "_type": 1,
     "_sizeMode": 0,
     "_fillType": 0,
@@ -38336,7 +38334,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "personnel",
+    "_name": "Store",
     "_objFlags": 0,
     "_parent": {
       "__id__": 902
@@ -38364,16 +38362,16 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 149,
-      "height": 163
+      "height": 168
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0.5,
+      "x": 0.6,
       "y": 0.5
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": -159,
+      "x": 173.9,
       "y": 0,
       "z": 0
     },
@@ -38393,7 +38391,7 @@
     "_skewY": 0,
     "_is3DNode": false,
     "groupIndex": 0,
-    "_id": "66Ssul6TxA2qnagKcg11GN"
+    "_id": "b2ws85sLJBu6tsW8M/EVbS"
   },
   {
     "__type__": "cc.Sprite",
@@ -38411,7 +38409,7 @@
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
-      "__uuid__": "e73e76e3-e6ac-4389-8e93-5d980f29a7c3"
+      "__uuid__": "d7506095-7767-45b1-930e-c2b8db61fd3b"
     },
     "_type": 1,
     "_sizeMode": 0,
@@ -38425,7 +38423,7 @@
     "_fillRange": 0,
     "_isTrimmedMode": true,
     "_atlas": null,
-    "_id": "1fpvdKglVLZa6wyu7tcYIf"
+    "_id": "4bAiu7tehBB7w/tcpW1y+R"
   },
   {
     "__type__": "cc.Button",
@@ -38510,7 +38508,7 @@
     "_N$target": {
       "__id__": 903
     },
-    "_id": "f3aaNvzf1PS6qHNUamUcg6"
+    "_id": "04F8M+INJPTK/B4UZ9Dc7o"
   },
   {
     "__type__": "cc.ClickEvent",
@@ -38519,7 +38517,7 @@
     },
     "component": "",
     "_componentId": "8778dFlyCdHlabjp5lytrSS",
-    "handler": "onButtonEvent_Personnel_OPen",
+    "handler": "onButtonEvent_Store_OPen",
     "customEventData": ""
   },
   {
@@ -38571,7 +38569,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 9.899999999999991,
+      "x": 19.900000000000013,
       "y": 0,
       "z": 0
     },
@@ -38732,13 +38730,13 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "Store",
+    "_name": "personnel",
     "_objFlags": 0,
     "_parent": {
       "__id__": 902
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 6,
     "_components": [
       {
@@ -38760,16 +38758,16 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 149,
-      "height": 168
+      "height": 163
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0.6,
+      "x": 0.5,
       "y": 0.5
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 163.89999999999998,
+      "x": -148.99999999999997,
       "y": 0,
       "z": 0
     },
@@ -38789,7 +38787,7 @@
     "_skewY": 0,
     "_is3DNode": false,
     "groupIndex": 0,
-    "_id": "b2ws85sLJBu6tsW8M/EVbS"
+    "_id": "66Ssul6TxA2qnagKcg11GN"
   },
   {
     "__type__": "cc.Sprite",
@@ -38807,7 +38805,7 @@
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
-      "__uuid__": "d7506095-7767-45b1-930e-c2b8db61fd3b"
+      "__uuid__": "e73e76e3-e6ac-4389-8e93-5d980f29a7c3"
     },
     "_type": 1,
     "_sizeMode": 0,
@@ -38821,7 +38819,7 @@
     "_fillRange": 0,
     "_isTrimmedMode": true,
     "_atlas": null,
-    "_id": "4bAiu7tehBB7w/tcpW1y+R"
+    "_id": "1fpvdKglVLZa6wyu7tcYIf"
   },
   {
     "__type__": "cc.Button",
@@ -38906,7 +38904,7 @@
     "_N$target": {
       "__id__": 913
     },
-    "_id": "04F8M+INJPTK/B4UZ9Dc7o"
+    "_id": "f3aaNvzf1PS6qHNUamUcg6"
   },
   {
     "__type__": "cc.ClickEvent",
@@ -38915,7 +38913,7 @@
     },
     "component": "",
     "_componentId": "8778dFlyCdHlabjp5lytrSS",
-    "handler": "onButtonEvent_Store_OPen",
+    "handler": "onButtonEvent_Personnel_OPen",
     "customEventData": ""
   },
   {
@@ -38957,7 +38955,7 @@
     "_N$spacingX": 5,
     "_N$spacingY": 0,
     "_N$verticalDirection": 1,
-    "_N$horizontalDirection": 0,
+    "_N$horizontalDirection": 1,
     "_N$affectedByScale": false,
     "_id": "beAXXTzmNJeItrgHU98lY9"
   },
@@ -54342,7 +54340,11 @@
       "__id__": 1260
     },
     "_enabled": true,
-    "_materials": [],
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
@@ -54428,7 +54430,11 @@
       "__id__": 1262
     },
     "_enabled": true,
-    "_materials": [],
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
@@ -54568,7 +54574,11 @@
       "__id__": 1265
     },
     "_enabled": true,
-    "_materials": [],
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
@@ -54596,7 +54606,11 @@
       "__id__": 1259
     },
     "_enabled": true,
-    "_materials": [],
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
@@ -54688,7 +54702,11 @@
       "__id__": 1268
     },
     "_enabled": true,
-    "_materials": [],
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
@@ -62491,7 +62509,7 @@
         "__id__": 1499
       }
     ],
-    "_active": true,
+    "_active": false,
     "_level": 5,
     "_components": [],
     "_prefab": {
@@ -74356,7 +74374,7 @@
         "__id__": 2067
       }
     ],
-    "_active": true,
+    "_active": false,
     "_level": 1,
     "_components": [
       {
@@ -115742,7 +115760,7 @@
         "__id__": 3092
       }
     ],
-    "_active": false,
+    "_active": true,
     "_level": 1,
     "_components": [
       {
@@ -139323,7 +139341,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 400,
-      "height": 63.6
+      "height": 38.4
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -139670,7 +139688,7 @@
       "__id__": 5
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 4,
     "_components": [
       {
@@ -139868,7 +139886,7 @@
       "__id__": 5
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 4,
     "_components": [
       {
@@ -140066,7 +140084,7 @@
       "__id__": 5
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 4,
     "_components": [
       {
@@ -140264,7 +140282,7 @@
       "__id__": 5
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 4,
     "_components": [
       {
@@ -140493,7 +140511,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 190,
+      "x": -194.036,
       "y": -5,
       "z": 0
     },
@@ -140691,7 +140709,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 285,
+      "x": -99.036,
       "y": -5,
       "z": 0
     },

+ 0 - 5
assets/Script/Network/netUtils.ts

@@ -66,11 +66,6 @@ var utils = {
         //一键偷取全部果实
         stealAllFruit: 'comPlayerGoods/stealAllFruit',
 
-        /**
-         * 偷菜时候,收取对方用户果实
-         */
-        stealFruit: 'comPlayerGoods/stealFruit',
-
         //出售果实
         saleFruit: 'comPlayerGoods/saleFruit',
         //赠送果实

+ 3 - 2
assets/Script/UI/ManageBuildings.js

@@ -379,8 +379,9 @@ cc.Class({
         // if(0 != GlobalD.Dapp.UserInfo.agent_level){
         //     this.spawnDressUp();
         // }
-        //先初始化网络数据
-        this.SpawnHouse();
+        //先初始化网络数据 
+        // remove version: todo 去除旧的生成建筑逻辑
+        // this.SpawnHouse();
         // cc.log('初始化场景建筑');
         let BuildingStateArray = GlobalD.GameData.GetBuildingStateArray();
         for (let i = 0; i < BuildingStateArray.length; i++) {

+ 1 - 36
assets/Script/build/LeaseFarmlandInfo.js

@@ -232,42 +232,7 @@ cc.Class({
         })
 
         this.stealHarvestNode.on(cc.Node.EventType.TOUCH_START, () => {
-            if (!this.bSelfLand) {
-                console.log("点击偷菜按钮收取");
-                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "请点击偷菜按钮收取!", 1);
-                return;
-            }
-            if (GlobalD.GameData.isOnAddFruit) return;
-            console.log("点击收获");
-            GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "收获中..", 5);
-            let data = { otherLandId: this.leaseLandInfo.configLandId, otherUserId: GlobalD.GameData.OtherUserInfo.userId };
-            //果实收入仓库,重置土地种植信息
-            GlobalD.GameData.onStealFruit(data, (value) => {
-                console.log(value);
-                if (0 === value.code) {
-                    //收成后处理相关状态
-                    this.stealHarvestNode.active = false;
-                    //更新仓库列表
-                    this._buildingView.onUpdateList();
-                    // "收获成功!"
-                    GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "收获成功!", 1);
-
-                    this.isShowHarvest = false;
-                    this.isShowIndex = 0;
-                    if (this.timeInterval) {
-                        clearInterval(this.timeInterval);
-                        this.timeInterval = null;
-                    }
-                } else if (706 === value.code) {
-                    //土地到期,没有更新刷新的处理刷新
-                    GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), value.msg, 1);
-                    //重置锁定状态显示
-                    this.onLockLand();
-
-                } else {
-                    GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), value.msg, 1);
-                }
-            });
+            GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "请点击偷菜按钮收取!", 1);
         })
     },
 

+ 25 - 34
assets/Script/public/GameData.js

@@ -166,22 +166,22 @@ cc.Class({
 
             // 自动存储数据
             /**
-             * todo 如果退出游戏,触发一次存储。
+             * remove version: todo 去除自动存储
              */
-            this.AutoSaveData = function () {
-                this.pushData(true);
-            };
-            this.schedule(this.AutoSaveData, 15);
+            // this.AutoSaveData = function () {
+            //     this.pushData(true);
+            // };
+            // this.schedule(this.AutoSaveData, 15);
         } else {
             // 清除
             cc.log("本地数据重新开始,并且不初始化");
             // this.onClearAllData();
             this.Init();
             this.InitSceneInfo();
-            this.AutoSaveData = function () {
-                this.pushData(false);
-            };
-            this.schedule(this.AutoSaveData, 10);
+            // this.AutoSaveData = function () {
+            //     this.pushData(false);
+            // };
+            // this.schedule(this.AutoSaveData, 10);
         }
     },
 
@@ -211,8 +211,8 @@ cc.Class({
      */
     InitSceneInfo() {
         //根据顺序生成
-        //初始化时间ui
-        cc.find("GameNode/ManageTimer").getComponent('ManageTimer').Init();
+        //remove version:todo  去除初始化时间ui
+        // cc.find("GameNode/ManageTimer").getComponent('ManageTimer').Init();
         //初始化金钱ui,gold,diamond, cnt,snb,
         cc.find("GameNode/ManageGolden").getComponent('ManageGolden').InitManageGlodenUI();
         //领取ui
@@ -237,18 +237,24 @@ cc.Class({
         /**
          * 原本游戏设定是先生产道路,现在为了方便处理等房屋生产后,再处理公路
          * dapp设定: 如果固定土地冲突,删除对应的公路
+         * remove version:todo 去除生成公路
          */
-        this.onSpawnHighway();
+        // this.onSpawnHighway();
         //初始化生成人物
         /**
         * dapp设定: 如果固定土地位置冲突,把人物生成位置放置到主路
         * onSpawnWorkerAIFromStoredData 此函数处理
+        * 
         */
-        cc.find('GameNode/ManageWorker').getComponent('ManageWorker').InitWorkerAI();
-
-        let _BFirstLoadGame = this.readData ? this.readData.BFirstLoadGame : 0;
+        // remove version:todo 去除生成公人
+        // cc.find('GameNode/ManageWorker').getComponent('ManageWorker').InitWorkerAI();
+        /**
+         * remove version:todo 去除新手教程
+         */
         //初始化新手教学
-        GlobalD.ManageTask.InitTask(_BFirstLoadGame);
+        // let _BFirstLoadGame = this.readData ? this.readData.BFirstLoadGame : 0;
+        // GlobalD.ManageTask.InitTask(_BFirstLoadGame);
+
         this.ManageUI.getComponent('ManageUI').Init();
     },
     InitNextworkData() {
@@ -912,7 +918,7 @@ cc.Class({
 
     //清除所有的数据
     onClearAllData() {
-        this.unschedule(this.AutoSaveData);
+        // this.unschedule(this.AutoSaveData);
         //任务索引
         cc.sys.localStorage.removeItem('userdata');
         //跳回登录场景
@@ -1023,7 +1029,7 @@ cc.Class({
         }
         this.isExchangeSeed = true;
         //先暂停存储
-        this.unschedule(this.AutoSaveData);
+        // this.unschedule(this.AutoSaveData);
 
         utils.post(utils.api.exchangeSeeds, { diamondAmount: diamondAmount, seedId: 8 }, (flag, value) => {
             console.log("兑换flag", flag);
@@ -1043,7 +1049,7 @@ cc.Class({
 
             this.isExchangeSeed = false;
             //重新开启存储
-            this.schedule(this.AutoSaveData, 15);
+            // this.schedule(this.AutoSaveData, 15);
         })
     },
     /**
@@ -1223,21 +1229,6 @@ cc.Class({
         })
     },
 
-
-    //偷取用户果实
-    onStealFruit(data, callback) {
-        if (this.isOnAddFruit) {
-            console.log("偷取果实过快!");
-            return;
-        }
-        this.isOnAddFruit = true;
-        utils.post(utils.api.stealFruit, data, (flag, value) => {
-            this.isOnAddFruit = false;
-            if (flag)
-                callback(value);
-        })
-    },
-
     //出售果实
     onSaleFruit(data, callback) {
         if (this.isOnSaleFruit) {

+ 9 - 12
assets/Script/public/ManageAI.js

@@ -89,19 +89,16 @@ cc.Class({
 
     // },
 
-    start() {
+    // remove version: todo 去除生成ai
+    // start() {
+    //     //生成AI
+    //     this.callback = function () {
+    //         this.onSpawnAI();
+    //     }
+    //     this.schedule(this.callback, this.spawnAiInterval);
+    //     this.spawnAiSpeed = 100;
 
-        //生成AI
-        this.callback = function () {
-            this.onSpawnAI();
-        }
-        this.schedule(this.callback, this.spawnAiInterval);
-
-
-        //测试用
-        this.spawnAiSpeed = 100;
-
-    },
+    // },
 
     //按顺序设置游客购物的商店
     _SetTouristAITarget() {

+ 1 - 1
assets/Script/public/ManageUI.js

@@ -677,7 +677,7 @@ cc.Class({
     this.onSetTouchStatus(this.BuildView, true)
     this.BuildView.getComponent('BuildingView').onSwitchBuildingContent(
       this.Evn.getComponent(cc.Button),
-      0
+      4
     )
   },
   //商城界面