|
|
@@ -9,7 +9,7 @@ export class RedPoinNode {
|
|
|
node_gradeReward: cc.Node = null;
|
|
|
@property({ type: cc.Node, displayName: "签到" })
|
|
|
node_sign: cc.Node = null;
|
|
|
- @property({type: cc.Node, displayName: '轮盘'})
|
|
|
+ @property({ type: cc.Node, displayName: '轮盘' })
|
|
|
node_turnable: cc.Node = null;
|
|
|
}
|
|
|
|
|
|
@@ -59,7 +59,7 @@ export default class Game extends cc.Component {
|
|
|
ani_add: cc.Animation = null;
|
|
|
@property({ type: cc.Node, displayName: '任务红包手' })
|
|
|
node_hand: cc.Node = null;
|
|
|
- @property({type: cc.Sprite, displayName: '等级名字'})
|
|
|
+ @property({ type: cc.Sprite, displayName: '等级名字' })
|
|
|
sp_gradeName: cc.Sprite = null;
|
|
|
|
|
|
|
|
|
@@ -225,10 +225,9 @@ export default class Game extends cc.Component {
|
|
|
// }else
|
|
|
{
|
|
|
this.lbl_task.string = `<b><color=#8D4D32>进行${count}次生产</c><color=#7EB80E>(${com}/${count})</color></b>`
|
|
|
- if(com >= count)
|
|
|
- {
|
|
|
+ if (com >= count) {
|
|
|
this.node_hand.active = true;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.node_hand.active = false;
|
|
|
}
|
|
|
}
|
|
|
@@ -248,25 +247,21 @@ export default class Game extends cc.Component {
|
|
|
this.sp_levelPer.fillRange = curExp / needExp;
|
|
|
}
|
|
|
|
|
|
- let nameIndex= 1;
|
|
|
- if(gData.gameData.playerProp.farmGradeData)
|
|
|
- {
|
|
|
+ let nameIndex = 1;
|
|
|
+ if (gData.gameData.playerProp.farmGradeData) {
|
|
|
let data = gData.gameData.playerProp.farmGradeData.farmGradeRewardList;
|
|
|
- if(data)
|
|
|
- {
|
|
|
+ if (data) {
|
|
|
let len = data.length;
|
|
|
- for(let i = 0; i != len; ++i)
|
|
|
- {
|
|
|
- if(gData.gameData.playerProp.farmExpValue >= data[i].expMax)
|
|
|
- {
|
|
|
+ for (let i = 0; i != len; ++i) {
|
|
|
+ if (gData.gameData.playerProp.farmExpValue >= data[i].expMax) {
|
|
|
nameIndex = i + 1;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
gData.gameData.playerProp.farmGradeName = nameIndex;
|
|
|
|
|
|
- this.sp_gradeName.spriteFrame = await mk.loader.load('module/gradeReward/texture/name' + nameIndex, cc.SpriteFrame);
|
|
|
+ this.sp_gradeName.spriteFrame = await mk.loader.load('module/gradeReward/texture/name' + nameIndex, cc.SpriteFrame);
|
|
|
|
|
|
gData.gameData.init_expLevel = false;
|
|
|
}
|
|
|
@@ -276,7 +271,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;
|
|
|
+ this.nodeRedPoint.node_turnable.active = gData.turnable.leftTimes > 0;
|
|
|
let isShow = false;
|
|
|
let data = gData.gameData.playerProp.farmGradeData.farmGradeRewardList;
|
|
|
if (data) {
|
|
|
@@ -466,12 +461,15 @@ export default class Game extends cc.Component {
|
|
|
public doFlyExpAni(exp: number, startPos: cc.Node, data) {
|
|
|
let pos = this.lbl_farmLevel.node.parent.convertToWorldSpaceAR(this.lbl_farmLevel.node.getPosition());
|
|
|
mk.fly.PlayCoinAnim(2, 3, startPos, pos, () => {
|
|
|
- gData.gameData.playerProp.gradeLevel = data.farmLevel;
|
|
|
+ if (gData.gameData.playerProp.gradeLevel < data.farmLevel) {
|
|
|
+ gData.gameData.playerProp.gradeLevel = data.farmLevel;
|
|
|
+ gData.gameData.checkGradeUpUnLock();
|
|
|
+ }
|
|
|
gData.gameData.playerProp.farmExpValue = data.userExp;
|
|
|
gData.gameData.playerProp.farmGradeData = data.userFarmGrageRewardInfo;
|
|
|
// gData.gameData.init_add = true;
|
|
|
gData.gameData.init_red_point = true;
|
|
|
- this.playAdd();
|
|
|
+ this.playAdd(exp);
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -484,7 +482,8 @@ export default class Game extends cc.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private playAdd() {
|
|
|
+ private playAdd(exp) {
|
|
|
+ this.ani_add.node.getComponent(cc.Label).string = `+${exp}`;
|
|
|
this.ani_add.node.active = true;
|
|
|
this.ani_add.play();
|
|
|
// gData.gameData.init_add = false;
|