wuwangdong vor 4 Jahren
Ursprung
Commit
5d5d63f5ef

+ 4 - 4
assets/resources/game/coregame/coregame.prefab

@@ -856,8 +856,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 52,
-      "height": 55
+      "width": 100,
+      "height": 100
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1280,8 +1280,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 79,
-      "height": 65
+      "width": 100,
+      "height": 100
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 6 - 3
assets/resources/game/prefab/game.prefab

@@ -4821,7 +4821,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "8aVkwv7IZERajfNUiLwMzL",
+    "fileId": "fc+CNrWZtP+I1mGqj8SElA",
     "sync": false
   },
   {
@@ -5033,7 +5033,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "6fv9K8j0VBtIzVFYuF9RjJ",
+    "fileId": "90lU81Nu9A/Jmcczn+/Ojz",
     "sync": false
   },
   {
@@ -5142,7 +5142,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "03UoLA+k9BfaDHxM0zUVOe",
+    "fileId": "a471mt9MpDh7WotDe3vOwO",
     "sync": false
   },
   {
@@ -10027,6 +10027,9 @@
     },
     "node_sign": {
       "__id__": 31
+    },
+    "node_turnable": {
+      "__id__": 47
     }
   },
   {

+ 1 - 0
assets/script/game/data/module/TurnableData.ts

@@ -37,6 +37,7 @@ export class TurnableData extends Data {
 
         this.leftTimes = this.leftTimes < 1 ? 0 : this.leftTimes - 1;
         gData.gameData.setProp(GameProp.turnable_leftTimes, this.leftTimes);
+        gData.gameData.init_red_point = true;
     }
 
 

+ 50 - 2
assets/script/game/game/AniControl.ts

@@ -236,16 +236,20 @@ export default class AniControl extends cc.Component {
         mk.audio.playEffect("button");
         if (customEvenData == 'bird_1') {
             this.flyBirdFinished_1();
+            let add = this.getRewardByHttp("bird_1");
+
             mk.fly.PlayCoinAnim(1, 5, this.flyBird_1.node, '', () => {
 
                 console.log('--');
             }, -1, 2);
         } else if (customEvenData == 'bird_2') {
             this.flyBirdFinished_2();
-            mk.fly.PlayCoinAnim(1, 5, this.flyBird_2.node, '', null, -1, 2);
+            this.getRewardByHttp("bird_2");
+            //mk.fly.PlayCoinAnim(1, 5, this.flyBird_2.node, '', null, -1, 2);
         } else if (customEvenData == 'dog') {
             this.moveDogFinished();
-            mk.fly.PlayCoinAnim(1, 5, this.dogMove.node, '', null, -1, 2);
+            this.getRewardByHttp("dog");
+            // mk.fly.PlayCoinAnim(1, 5, this.dogMove.node, '', null, -1, 2);
         } else if (customEvenData == 'sheep') {
             mk.ad.videoAdType = VideoAdType.video_init_10;
             mk.ui.openPanel('module/newOpenRedBag/newOpenRedBag');
@@ -254,4 +258,48 @@ export default class AniControl extends cc.Component {
 
         gData.adData.checkShowFullInter(1, InterFullAdType.interstitial2_init_3);
     }
+
+    private async getRewardByHttp(type: string) {
+        let data = { animalType: 1 };
+        let response = await mk.http.sendData('redMoney/addRedMoneyByAnimal', data);
+
+        if (response.errcode != 0) {
+            return;
+        }
+
+
+        let add = response.data.redMoneyAddition;
+        console.log('addCoin===============>', add);
+        if(add > 0)
+        {
+            const several = 3;
+            let intV = Math.floor(add / several);
+            let r = add % several;
+    
+            if (type == 'bird_1') {
+                for (let i = 0; i != several; ++i) {
+                    mk.fly.PlayCoinAnim(1, 1, this.flyBird_1.node, '', null, -1, intV);
+                }
+                if (r > 0) {
+                    mk.fly.PlayCoinAnim(1, 1, this.flyBird_1.node, '', null, -1, r);
+                }
+            } else if (type == 'bird_2') {
+                for (let i = 0; i != several; ++i) {
+                    mk.fly.PlayCoinAnim(1, 1, this.flyBird_2.node, '', null, -1, intV);
+                }
+    
+                if (r > 0) {
+                    mk.fly.PlayCoinAnim(1, 1, this.flyBird_2.node, '', null, -1, r);
+                }
+            } else if (type == 'dog') {
+                for (let i = 0; i != several; ++i) {
+                    mk.fly.PlayCoinAnim(1, 1, this.dogMove.node, '', null, -1, intV);
+                }
+                if (r > 0) {
+                    mk.fly.PlayCoinAnim(1, 1, this.dogMove.node, '', null, -1, r);
+                }
+            }
+        }
+        
+    }
 }

+ 29 - 3
assets/script/game/game/Farmer.ts

@@ -23,7 +23,7 @@ export class Farmer extends cc.Component {
 
         this.clips = this.animation.getClips();
 
-        this.refreshTime = 10;
+        this.refreshTime = 20;
         this.redMoneyNum = 3;
     }
     update(dt) {
@@ -46,9 +46,35 @@ export class Farmer extends cc.Component {
         {
             this.refreshTime -= dt;
         }else{
-            this.refreshTime = 10;
-            mk.fly2.PlayCoinAnim(1, 3, this.fly_node, '', null, -1 ,2);
+            this.refreshTime = 20;
+            this.getRewardByHttp();
         }
     }
+
+    private async getRewardByHttp() {
+        let data = { animalType: 2 };
+        let response = await mk.http.sendData('redMoney/addRedMoneyByAnimal', data);
+
+        if (response.errcode != 0) {
+            return;
+        }
+
+
+        let add = response.data.redMoneyAddition;
+        console.log('addCoinByFarmer===============>', add);
+        if(add > 0)
+        {
+            const several = 3;
+            let intV = Math.floor(add / several);
+            let r = add % several;
+    
+            for (let i = 0; i != several; ++i) {
+                mk.fly.PlayCoinAnim(1, 1, this.fly_node, '', null, -1, intV);
+            }
+            if (r > 0) {
+                mk.fly.PlayCoinAnim(1, 1, this.fly_node, '', null, -1, r);
+            }
+        }       
+    }
 }
 

+ 5 - 0
assets/script/game/game/Game.ts

@@ -9,6 +9,8 @@ export class RedPoinNode {
     node_gradeReward: cc.Node = null;
     @property({ type: cc.Node, displayName: "签到" })
     node_sign: cc.Node = null;
+    @property({type: cc.Node, displayName: '轮盘'})
+    node_turnable: cc.Node = null;
 }
 
 @ccclass
@@ -252,6 +254,7 @@ export default class Game extends cc.Component {
      */
     private initRedPoint() {
         this.nodeRedPoint.node_sign.active = gData.sign.redPoint();
+        this.nodeRedPoint.node_turnable.active = gData.turnable.leftTimes>0;
         let isShow = false;
         let data = gData.gameData.gameData.farmGradeData.farmGradeRewardList;
         if (data) {
@@ -264,6 +267,8 @@ export default class Game extends cc.Component {
             }
         }
         this.nodeRedPoint.node_gradeReward.active = isShow;
+
+        gData.gameData.init_red_point = false;
     }
 
     /**

+ 1 - 1
assets/script/game/module/farmMap/FarmItem.ts

@@ -49,7 +49,7 @@ export default class FarmItem extends cc.Component {
         if (data.picture <= max) {
             this.sp_icon.spriteFrame = await mk.loader.load(plantPath + data.picture, cc.SpriteFrame);
             this.lbl_nameDes.node.active = true;
-            this.lbl_nameDes.string = `Lv.${data.level} ${data.name} ${data.time}秒成熟`;
+            this.lbl_nameDes.string = `${data.name} ${data.time}秒成熟`;
             this.lbl_des.string = `最高收获${data.MenuredBagCoin}红包币`;
 
             let state = gData.gameData.getFarmMapRewardState(this.getIndex());