Commit b76a017a authored by wildfirecode's avatar wildfirecode

1

parent 5a097179
......@@ -8,7 +8,7 @@ import Loading from "../libs/new_wx/components/Loading";
class FriendWxShare extends ComponentBase {
start() {
const data = getHomeData();
this['lvTxt'].text = data.levels.length ==0 ? 1 : data.levels.length;
this['lvTxt'].text = data.levels.length == 0 ? 1 : data.levels.length;
this['avatar'].mask = this['avatarMask'];
const { data: user } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = user.avatar;
......
......@@ -1977,7 +1977,7 @@ export default class MainScene extends Scene {
if (!this.jellyBrokenMark) {
jellyMonsterAIResult = await jellyMonsterAI(this);//0说明怪物没有地方可吐了
console.log('干刚才吐了几个', jellyMonsterAIResult);
if(jellyMonsterAIResult > 0) //吐了果冻相当于破了个果冻,那么不再蔓延
if (jellyMonsterAIResult > 0) //吐了果冻相当于破了个果冻,那么不再蔓延
this.jellyBrokenMark = true;
}
......
export default () => {
//每次只有一个怪物吹气泡
return new Promise((r) => {
r();
});
}
\ No newline at end of file
......@@ -439,7 +439,7 @@ export default class MapScene extends Scene {
updateSign() {
const { signInfoVO } = DataManager.ins.getData('getSignInfo');
if (signInfoVO&&signInfoVO.continueDay < 7) { //表示明天还可以签到
if (signInfoVO && signInfoVO.continueDay < 7) { //表示明天还可以签到
this['sign_s1'].visible = signInfoVO.todaySigned == 0;
this['sign_s2'].visible = !this['sign_s1'].visible;
} else {
......
......@@ -45,14 +45,14 @@ export default class HbCutTime extends Panel {
}
private hbRainBaseInfo(updateData?) {
if(updateData && updateData.data){
if (updateData && updateData.data) {
this.data.res = updateData;
}
const success = updateData ? updateData.success : this.data.res.success;
const res = updateData || this.data.res;
const data = (updateData && updateData.data) || this.data.res.data;
if(!success) {
if (!success) {
this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
......@@ -60,7 +60,7 @@ export default class HbCutTime extends Panel {
}
this.cutTimer = this.cutTimer || new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', async () => {
const getData = await this.getData(); //重新获取数据
if(getData.success) {
if (getData.success) {
this.hbRainBaseInfo(getData);
} else {
this.hidePanel(); //没有数据关闭窗口
......@@ -69,9 +69,9 @@ export default class HbCutTime extends Panel {
});
const sysTime = res.timestamp; // 当前系统时间
let time;
if(data.currentSession) {
if (data.currentSession) {
time = data.currentSession.endTime - sysTime + 3000;
if(data.canJoin) {
if (data.canJoin) {
this.ok_btn.source = 'hbCutTime_btn_enable_png';
NetManager.ins.showLog(getlogItem(58));
this.btnEffect();
......@@ -81,18 +81,18 @@ export default class HbCutTime extends Panel {
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
this.tipImage.source = 'hbCutTime_cutLine_enable_png';
if(!this.cutTimer.start(time)) {
if (!this.cutTimer.start(time)) {
this.cutTimer.stop();
this.cutTimer.start(time);
}
} else if(data.nextSession) {
} else if (data.nextSession) {
egret.Tween.removeTweens(this.ok_btn);
this.ok_btn.scaleX = this.ok_btn.scaleY = 1;
time = data.nextSession.startTime - sysTime + 3000;
this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
this.tipImage.source = 'hbCutTime_cutLine_disable_png';
if(!this.cutTimer.start(time)) {
if (!this.cutTimer.start(time)) {
this.cutTimer.stop();
this.cutTimer.start(time);
}
......@@ -105,8 +105,8 @@ export default class HbCutTime extends Panel {
private btnEffect() {
egret.Tween.removeTweens(this.ok_btn);
egret.Tween.get(this.ok_btn).to({scaleX: 0.9, scaleY: 1.1}, 200, egret.Ease.quadInOut).call(() => {
egret.Tween.get(this.ok_btn).to({scaleX: 1, scaleY: 1}, 200, egret.Ease.quadInOut).call(() => {
egret.Tween.get(this.ok_btn).to({ scaleX: 0.9, scaleY: 1.1 }, 200, egret.Ease.quadInOut).call(() => {
egret.Tween.get(this.ok_btn).to({ scaleX: 1, scaleY: 1 }, 200, egret.Ease.quadInOut).call(() => {
egret.Tween.get(this.ok_btn).to({
scaleX: 0.9618,
scaleY: 1.0618
......@@ -123,7 +123,7 @@ export default class HbCutTime extends Panel {
}
destroy() {
if(this.cutTimer) {
if (this.cutTimer) {
this.cutTimer.stop();
}
super.destroy();
......@@ -163,11 +163,11 @@ export default class HbCutTime extends Panel {
onTouchOK() {
NetManager.ins.clickLog(getlogItem(58));
try {
if(window['getRST']) window['getRST']();
} catch(error) {
if (window['getRST']) window['getRST']();
} catch (error) {
console.warn(error)
}
PanelCtrl.instance.show('HbGame', {needScore: this.data.res.data.currentSession.limitScore});
PanelCtrl.instance.show('HbGame', { needScore: this.data.res.data.currentSession.limitScore });
}
protected get closeBtns(): eui.Button[] {
......
......@@ -65,10 +65,10 @@ export default class HbGame extends Panel {
// 加分
private addScore(score: number) {
this.score += score;
egret.Tween.get(this.scoreGroup).to({scaleX: 1.3, scaleY: 1.3}, 100).call(() => {
egret.Tween.get(this.scoreGroup).to({ scaleX: 1.3, scaleY: 1.3 }, 100).call(() => {
this.scoreLabelStr += score;
this.scoreLabel.text = `${this.scoreLabelStr}`;
egret.Tween.get(this.scoreGroup).to({scaleX: 1, scaleY: 1}, 100);
egret.Tween.get(this.scoreGroup).to({ scaleX: 1, scaleY: 1 }, 100);
});
}
......@@ -82,8 +82,8 @@ export default class HbGame extends Panel {
private hbDoJoin() {
let session = DataManager.ins.getData(NetName.HBRAIN_BASEINFO).data.currentSession.sessionIndex;
try {
if(window['getRST']) window['getRST']();
} catch(error) {
if (window['getRST']) window['getRST']();
} catch (error) {
console.warn(error)
}
NetManager.ins.hbRainDoJoin((success, res) => {
......@@ -92,51 +92,51 @@ export default class HbGame extends Panel {
}, window['collectRuleId']);
const data = res.data;
const code = res.code;
if(!success) {
switch(true) {
if (!success) {
switch (true) {
case (code == "600015"): // 网络错误 //命中风控参与规则
PanelCtrl.instance.show("HbNoPrize", {type: 2});
PanelCtrl.instance.show("HbNoPrize", { type: 2 });
break;
case (code == "600016"): // 游戏分数提交失败~如有疑问,请联系客服 // 苏宁风控 命中
PanelCtrl.instance.show("HbNoPrize", {type: 2});
PanelCtrl.instance.show("HbNoPrize", { type: 2 });
break;
case (code == "600054"): // 红包雨活动暂未开启
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600055"): // 红包雨场次配置异常
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600056"): // 当前红包雨场次不存在
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600057"): // 当前红包雨场次已结束
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600058"): // 分数未达到目标
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600059"): // 红包炸弹活动暂未开启
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600060"): // 当前场次参与次数达到上限
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600061"): // 红包炸弹配置异常
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
case (code == "600062"): // 红包炸弹已经全部领取
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
default:
PanelCtrl.instance.show("HbNoPrize", {type: 1});
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
break;
}
return;
}
if(!data || !data.option || data.categoryType == 1) {
PanelCtrl.instance.show("HbNoPrize", {type: 1});
if (!data || !data.option || data.categoryType == 1) {
PanelCtrl.instance.show("HbNoPrize", { type: 1 });
} else {
let _data = Utils.deepClone(data);
_data.score = this.score;
......@@ -165,11 +165,11 @@ export default class HbGame extends Panel {
let totalTime: number = this.totalTime;
let lastT = new Date().getTime();
let dt = 0;
egret.startTick(function(timeStamp: number): boolean {
egret.startTick(function (timeStamp: number): boolean {
dt = (new Date().getTime() - lastT) / 1000;
cTime += dt;
if(cTime > totalTime){
if (cTime > totalTime) {
cTime = 0;
}
angle = 360 * cTime / totalTime;
......@@ -197,13 +197,13 @@ export default class HbGame extends Panel {
private timeCallFun() {
this.cutTimeLabel.text = `${--this.time}`;
if(this.time <= 0) {
if (this.time <= 0) {
this.gameOver();
}
if(this.time == 3) {
if (this.time == 3) {
let _y = this.cutTimerGroup.y;
egret.Tween.get(this.cutTimerGroup, {loop: true}).to({y: _y + 10}, 100).call(() => {
egret.Tween.get(this.cutTimerGroup).to({y: _y}, 100);
egret.Tween.get(this.cutTimerGroup, { loop: true }).to({ y: _y + 10 }, 100).call(() => {
egret.Tween.get(this.cutTimerGroup).to({ y: _y }, 100);
})
}
}
......@@ -220,18 +220,18 @@ export default class HbGame extends Panel {
obj.anchorOffsetY = 377 / 2;
this.readyGroup.visible = true;
obj.source = "hbGame_3_png", obj.scaleX = obj.scaleY = _scaleMin, obj.alpha = 1;
egret.Tween.get(obj).to({scaleX: 1, scaleY: 1, alpha: 1}, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
egret.Tween.get(obj).to({ scaleX: 1, scaleY: 1, alpha: 1 }, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({ scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1 }, t2).call(() => {
obj.source = "hbGame_2_png", obj.scaleX = obj.scaleY = _scaleMin, obj.alpha = 1;
egret.Tween.get(obj).to({scaleX: 1, scaleY: 1, alpha: 1}, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
egret.Tween.get(obj).to({ scaleX: 1, scaleY: 1, alpha: 1 }, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({ scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1 }, t2).call(() => {
obj.source = "hbGame_1_png", obj.scaleX = obj.scaleY = _scaleMin, obj.alpha = 1;
egret.Tween.get(obj).to({scaleX: 1, scaleY: 1, alpha: 1}, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
egret.Tween.get(obj).to({ scaleX: 1, scaleY: 1, alpha: 1 }, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({ scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1 }, t2).call(() => {
this.readyGroup.visible = false;
this.startGame();
egret.Tween.get(this.timeBtn).to({y: 8}, 100).call(() => {
egret.Tween.get(this.timeBtn).to({y: 0}, 100);
egret.Tween.get(this.timeBtn).to({ y: 8 }, 100).call(() => {
egret.Tween.get(this.timeBtn).to({ y: 0 }, 100);
});
})
});
......@@ -243,7 +243,7 @@ export default class HbGame extends Panel {
private readyTipsEffect() {
this.readyGroup.alpha = 0;
egret.Tween.get(this.readyGroup).to({alpha: 1}, 300).call(() => this.readyTimeEffect());
egret.Tween.get(this.readyGroup).to({ alpha: 1 }, 300).call(() => this.readyTimeEffect());
}
protected onSkinComplete() {
......
......@@ -11,9 +11,9 @@ import { NetManager } from "../../../libs/tw/manager/NetManager";
* 红包雨奖励
*/
export default class HbPrize extends Panel {
public ok_btn:eui.Button;
public closeBtn:eui.Button;
public tipLabel:eui.Label;
public ok_btn: eui.Button;
public closeBtn: eui.Button;
public tipLabel: eui.Label;
constructor(data) {
super();
......@@ -31,10 +31,10 @@ export default class HbPrize extends Panel {
}
updateOption(option: any) {
const { categoryType, img, num, propType,realValue } = option;// 2次数 3道具 4元宝 5实物 6优惠券 7虚拟商品
const { categoryType, img, num, propType, realValue } = option;// 2次数 3道具 4元宝 5实物 6优惠券 7虚拟商品
this['propnums'].text = 'x1';
if(num)
if (num)
this['propnums'].text = 'x' + num;
switch (categoryType) {
case 2:
......@@ -81,7 +81,7 @@ export default class HbPrize extends Panel {
onTouchOK() {
NetManager.ins.clickLog(getlogItem(59));
if((getHomeData().levels.length + 1) > window['last_level']) {
if ((getHomeData().levels.length + 1) > window['last_level']) {
changeMapScene();
super.hidePanel();
return;
......
......@@ -25,7 +25,7 @@ export default class RainMgr {
this.timer.stop(); // 停止计时器
// 隐藏全部掉落物品
for(let v of this.rainGroup.$children) {
for (let v of this.rainGroup.$children) {
v.visible = false;
}
}
......@@ -43,16 +43,16 @@ export default class RainMgr {
// 添加掉落物品
private addRain() {
let num = Utils.RandomInt(3, 6);
for(let i = 0; i < num; i++) {
for (let i = 0; i < num; i++) {
let newRainObj = this.rainPool.get();
if(!newRainObj) {
if (!newRainObj) {
newRainObj = new RainObj({
key: RainData.key[~~(Math.random() * RainData.key.length)],
rainGroup: this.rainGroup,
pool:this.rainPool,
pool: this.rainPool,
});
}
setTimeout(()=>{
setTimeout(() => {
newRainObj.addStage((this.rainGroup.width) / num * i + 100, Utils.RandomInt(6, 9) / 10);
}, Utils.RandomInt(0, 8) * 100);
}
......@@ -60,16 +60,16 @@ export default class RainMgr {
private addPool() {
this.rainPool = new Pooling();
for(let v of RainData.key) {
for (let v of RainData.key) {
let num = 1;
if(v == 'hongbao'){
if (v == 'hongbao') {
num = 45;
}
for(let i = 0; i < num; i++) {
for (let i = 0; i < num; i++) {
let newObj = new RainObj({
key: v,
rainGroup: this.rainGroup,
pool:this.rainPool,
pool: this.rainPool,
});
this.rainPool.push(newObj);
}
......
......@@ -16,7 +16,7 @@ export class RegTriangle extends RegPolygon {
constructor(length, view) {
super(length, view);
this.type="regTriangle";
this.type = "regTriangle";
this.pointLength = this.length * sqrt3 / 3;
this.sideLength = this.length * sqrt3 / 6;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment