|
|
@@ -105,13 +105,17 @@ export class FarmCountDown extends cc.Component {
|
|
|
this.normalGroup.active = false;
|
|
|
let can = false;
|
|
|
if (gData.gameData.playerProp.completeFarmTaskTimes >= 1 && Math.random() < 0.2) {
|
|
|
- if (this.productConfig.tab == ProductType.nzw && gData.gameData.RawInsectCurArr[0] < parseInt(gData.gameData.RawInsectArr[0])) {
|
|
|
- can = true;
|
|
|
- gData.gameData.RawInsectCurArr[0]++;
|
|
|
+ if (this.productConfig.tab == ProductType.nzw) {
|
|
|
+ if (gData.gameData.RawInsectCurArr[0] < parseInt(gData.gameData.RawInsectArr[0])) {
|
|
|
+ can = true;
|
|
|
+ gData.gameData.RawInsectCurArr[0]++;
|
|
|
+ }
|
|
|
}
|
|
|
- else if (this.productConfig.tab == ProductType.dw && gData.gameData.RawInsectCurArr[1] < parseInt(gData.gameData.RawInsectArr[1])) {
|
|
|
- can = true;
|
|
|
- gData.gameData.RawInsectCurArr[1]++;
|
|
|
+ else if (this.productConfig.tab == ProductType.dw) {
|
|
|
+ if (gData.gameData.RawInsectCurArr[1] < parseInt(gData.gameData.RawInsectArr[1])) {
|
|
|
+ can = true;
|
|
|
+ gData.gameData.RawInsectCurArr[1]++;
|
|
|
+ }
|
|
|
}
|
|
|
else if (gData.gameData.RawInsectCurArr[2] < parseInt(gData.gameData.RawInsectArr[2])) {
|
|
|
can = true;
|