Commit a5072183 authored by 邱旭's avatar 邱旭

Merge branch 'dev' of http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole into dev

parents 41db816f 40e61fc4
...@@ -292,6 +292,7 @@ export default class MainBase extends eui.UILayer { ...@@ -292,6 +292,7 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync("lineLight" + i + "_png") RES.getResAsync("lineLight" + i + "_png")
} }
var arr = [ var arr = [
"rectLatWhite",
"fesRedBigLight", "fesRedBombSta1", "fesRedCap", "fesRedDown", "fesRedSmallLight", "fesRedUp", "xingxingbi", "fesRedBigLight", "fesRedBombSta1", "fesRedCap", "fesRedDown", "fesRedSmallLight", "fesRedUp", "xingxingbi",
"tinyRedLeft", "tinyRedMid", "tinyRedRight", "tinyRedLeft", "tinyRedMid", "tinyRedRight",
"festivalTargetBg", "festivalTargetBg",
...@@ -455,7 +456,7 @@ export default class MainBase extends eui.UILayer { ...@@ -455,7 +456,7 @@ export default class MainBase extends eui.UILayer {
this.hcHome(), this.hcHome(),
this.hc_userInfo(), this.hc_userInfo(),
// this.getBackReward(), // this.getBackReward(),
this.hcRedBoobBaseInfo(), // this.hcRedBoobBaseInfo(),
]); ]);
MapScene.adData = DataManager.ins.getData('hc_advert'); MapScene.adData = DataManager.ins.getData('hc_advert');
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -66,6 +66,7 @@ import { CurScoreNum } from '../something/uis/CurScoreNum'; ...@@ -66,6 +66,7 @@ import { CurScoreNum } from '../something/uis/CurScoreNum';
import { FestivalTarget } from '../something/uis/FestivalTarget'; import { FestivalTarget } from '../something/uis/FestivalTarget';
import getRedBombAward, { getRedBombTimes } from '../getRedBombAward'; import getRedBombAward, { getRedBombTimes } from '../getRedBombAward';
import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni'; import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni';
import { RectsWaveAni } from '../something/anisCall/RectsWaveAni';
const aniClass = { const aniClass = {
"BoomAni": BoomAni, "BoomAni": BoomAni,
...@@ -700,8 +701,8 @@ export default class MainScene extends Scene { ...@@ -700,8 +701,8 @@ export default class MainScene extends Scene {
//初始化节日元素 //初始化节日元素
initFestivalEle(): boolean { initFestivalEle(): boolean {
//添加节日元素,条件可能会变 //添加节日元素,条件可能会变
if (getRedBombTimes() && if (fesChapterData.indexOf(this.chapter >> 0) > -1 &&
fesChapterData.indexOf(this.chapter >> 0) > -1 && getRedBombTimes() &&
Math.random() > 0.5 && Math.random() > 0.5 &&
this.lattices[festivalIndex] && //格子必须有 this.lattices[festivalIndex] && //格子必须有
(Tool.judgeSetFesEle(this.lattices[festivalIndex]) || !this.lattices[festivalIndex].element) //没有元素也行 (Tool.judgeSetFesEle(this.lattices[festivalIndex]) || !this.lattices[festivalIndex].element) //没有元素也行
...@@ -728,6 +729,7 @@ export default class MainScene extends Scene { ...@@ -728,6 +729,7 @@ export default class MainScene extends Scene {
this.lattices[festivalIndex].element.visible = false; this.lattices[festivalIndex].element.visible = false;
ani.play(p, () => { ani.play(p, () => {
this.lattices[festivalIndex].element.visible = true; this.lattices[festivalIndex].element.visible = true;
RectsWaveAni(this.lattices,this.map)
//检查三消 //检查三消
if (this.threeMatch()) { if (this.threeMatch()) {
this.eliminate(); this.eliminate();
...@@ -2798,7 +2800,7 @@ export default class MainScene extends Scene { ...@@ -2798,7 +2800,7 @@ export default class MainScene extends Scene {
} }
//时间再调 //时间再调
// setTimeout(() => { // setTimeout(() => {
callback(); callback();
// }, 80) // }, 80)
} }
/** /**
......
import getResPath from "../../libs/new_tc/getResPath";
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { createEffect1MovieClip } from "../effect/createEffect1";
import RedBombRule from "./RedBombRule";
import { getRedBombTimes } from "../getRedBombAward"; import { getRedBombTimes } from "../getRedBombAward";
import { loadSvga } from "../loadSvga"; import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath"; import { DataManager } from "../../libs/tw/manager/DataManager";
export default class RedBombAlertPanel extends Panel { export default class RedBombAlertPanel extends Panel {
async start(data) { async start(data) {
...@@ -14,43 +11,66 @@ export default class RedBombAlertPanel extends Panel { ...@@ -14,43 +11,66 @@ export default class RedBombAlertPanel extends Panel {
const times = getRedBombTimes(); const times = getRedBombTimes();
this['tips'].text = `今日还有${times}个红包在其他关卡等你哦~`; this['tips'].text = `今日还有${times}个红包在其他关卡等你哦~`;
if(times <= 0) { if (times <= 0) {
this['tips'].text = `当日红包任务达成,明日再来~`; this['tips'].text = `当日红包任务达成,明日再来~`;
} }
this['group'].alpha=0; this['group'].alpha = 0;
egret.Tween.get(this['group']).wait(1500).to({alpha:1},300); egret.Tween.get(this['group']).wait(1500).to({ alpha: 1 }, 300);
loadSvga(getResPath() + 'resource/assets/svgas/redbomb.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/redbomb.svga').then(async (mv: any) => {
this.addChild(mv); this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => { mv.once(egret.Event.COMPLETE, () => {
mv.stop(); mv.stop();
this.removeChild(mv); this.removeChild(mv);
this.playNoPrizeAni(); //条件再修改,根据后端数据
const data = DataManager.ins.getData('hc_redBombAward').data;
if(data&&data.option){
this.playPrizeAni();
}else{
this.playNoPrizeAni();
}
}, this); }, this);
}); });
} }
playNoPrizeAni(){ playNoPrizeAni() {
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_noprize.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/redbomb_noprize.svga').then(async (mv: any) => {
//去掉文案
egret.Tween.get(this['group']).to({alpha:0},300);
this.addChild(mv); this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => { mv.once(egret.Event.COMPLETE, () => {
mv.stop(); mv.stop();
this.once(egret.TouchEvent.TOUCH_TAP,()=>{this.hidePanel()},this);
}, this); }, this);
}); });
} }
playPrizeAni(){
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_prize.svga').then(async (mv: any) => {
//去掉文案
egret.Tween.get(this['group']).to({alpha:0},300);
this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => {
mv.stop();
this.once(egret.TouchEvent.TOUCH_TAP,()=>{this.hidePanel()},this);
}, this);
setTimeout(()=>{
mv.setImage("img_2349",DataManager.ins.getData('hc_redBombAward').data.option.img)
},100)
});
}
showlog() { showlog() {
} }
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
// this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this); // this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this);
} }
onTapInvite() { onTapInvite() {
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
......
...@@ -122,10 +122,10 @@ export default class Turntable extends Panel { ...@@ -122,10 +122,10 @@ export default class Turntable extends Panel {
console.warn(error) console.warn(error)
} }
NetManager.ins.hc_turnableDojoin((success, res) => { NetManager.ins.hc_turnableDojoin((success, res) => {
NetManager.ins.hc_home(() => { // NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); // SceneCtrl.instance.updateScene();
this['nums'].text = `当前可用元宝:${getHomeData().wealth}`; // this['nums'].text = `当前可用元宝:${getHomeData().wealth}`;
}, window['collectRuleId']); // }, window['collectRuleId']);
Loading.instace.hide(); Loading.instace.hide();
// if(!success) { // if(!success) {
// return; // return;
...@@ -144,6 +144,10 @@ export default class Turntable extends Panel { ...@@ -144,6 +144,10 @@ export default class Turntable extends Panel {
id = data.option.categoryType; id = data.option.categoryType;
} }
this.rotateByPrize(id, () => { this.rotateByPrize(id, () => {
NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene();
this['nums'].text = `当前可用元宝:${getHomeData().wealth}`;
}, window['collectRuleId']);
if(!success) { if(!success) {
switch(true) { switch(true) {
case (code == "600051"): // 元宝不足 case (code == "600051"): // 元宝不足
......
...@@ -269,13 +269,13 @@ export class Tool { ...@@ -269,13 +269,13 @@ export class Tool {
if (!lat || !lat.element) { if (!lat || !lat.element) {
return false return false
} }
//上方元素为石头,或元素为锁定,或者是果冻,或者鸡蛋,或者大节日元素 //上方元素为石头,或元素为锁定,或者是果冻,或者鸡蛋,或者大节日元素
else if (lat.element.type == ElementType.ROCK || else if (lat.element.type == ElementType.ROCK ||
lat.element.hasState(StateType.LOCK) || lat.element.hasState(StateType.LOCK) ||
lat.element.type == ElementType.JELLY || lat.element.type == ElementType.JELLY ||
lat.element.type == ElementType.CHICKEN_EGG || lat.element.type == ElementType.CHICKEN_EGG ||
lat.element.type == ElementType.FESTIVALELE_BIG || lat.element.type == ElementType.FESTIVALELE_BIG //||
lat.element.type == ElementType.FESTIVALELE_SMALL // lat.element.type == ElementType.FESTIVALELE_SMALL
) { ) {
return false return false
} }
......
...@@ -32,7 +32,5 @@ export class FesRedBombShowAni extends egret.DisplayObjectContainer { ...@@ -32,7 +32,5 @@ export class FesRedBombShowAni extends egret.DisplayObjectContainer {
Pool.recover(RecoverName.FESREDBOMBSHOW_ANI, this); Pool.recover(RecoverName.FESREDBOMBSHOW_ANI, this);
callback() callback()
}) })
//波纹动效再说,现在来不及
} }
} }
\ No newline at end of file
import { Lattice } from "../class/Lattice";
import { Tool } from "../Tool";
const whiteRectPool: WhiteRect[] = []
/**
* 格子波纹的动画
* @param lattices
* @param container
* @param callback
*/
export function RectsWaveAni(
lattices: Lattice[],
container: egret.DisplayObjectContainer,
callback?: Function,
centerIndex: number = 40,
) {
var loops: WhiteRect[][] = [];
var rc = Tool.indexToRc(centerIndex);
//格子间距 0到最大的格子
var num = 0;
var maxNum = Math.max(rc[0], rc[1], Tool.rowNum - rc[0] - 1, Tool.colNum - rc[1] - 1)
//所有格子都填上
while (num <= maxNum) {
//每一圈所有格子索引
var indexs: number[] = [];
if (num) {
var rowMax = rc[0] + num;
var rowMin = rc[0] - num;
var colMax = rc[1] + num;
var colMin = rc[1] - num;
var colIndexs = rangeIndexs(
colMin >= 0 ? colMin : 0,
colMax < Tool.colNum ? colMax : Tool.colNum - 1
)
var rowIndexs = rangeIndexs(
rowMin >= 0 ? rowMin : 0,
rowMax < Tool.rowNum ? rowMax : Tool.rowNum - 1,
false
)
//上排,行数一致,列数在之内
if (rowMin >= 0) {
for (var i = 0; i < colIndexs.length; i++) {
var index = Tool.rcToIndex(rowMin, colIndexs[i]);
if (lattices[index]) indexs.push(index)
}
}
//下排
if (rowMax < Tool.rowNum) {
for (var i = 0; i < colIndexs.length; i++) {
var index = Tool.rcToIndex(rowMax, colIndexs[i]);
if (lattices[index]) indexs.push(index)
}
}
//左边
if (colMin >= 0) {
for (var i = 0; i < rowIndexs.length; i++) {
var index = Tool.rcToIndex(rowIndexs[i], colMin);
if (lattices[index]) indexs.push(index)
}
}
//右边
if (colMax < Tool.colNum) {
for (var i = 0; i < rowIndexs.length; i++) {
var index = Tool.rcToIndex(rowIndexs[i], colMax);
if (lattices[index]) indexs.push(index)
}
}
}else{
indexs.push(centerIndex)
}
var loop = []
//根据索引
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
var p = Tool.getPositionByIndex(index);
let rect = whiteRectPool.shift();
if (!rect) rect = new WhiteRect();
rect.alpha = 0;
rect.x = p[0];
rect.y = p[1];
container.addChild(rect);
loop.push(rect);
}
//总
loops.push(loop);
// console.log(indexs)
num++;
}
//动画
let loopsLen = loops.length
for (let m = 0; m < loops.length; m++) {
let loop = loops[m];
let wait = m * 100;
let loopLen = loop.length;
for (let n = 0; n < loop.length; n++) {
let rect = loop[n];
egret.Tween.get(rect)
.wait(wait)
.to({ alpha: 1 }, 150)
.to({ alpha: 0 }, 150)
.call(() => {
//回收
if(rect.parent){
rect.parent.removeChild(rect);
whiteRectPool.push(rect);
}
if (m == loopsLen-1 && n == loopLen-1 && callback) callback();
})
}
}
}
class WhiteRect extends egret.Bitmap {
constructor() {
super();
var texture: egret.Texture = RES.getRes("rectLatWhite_png");
this.texture = texture;
this.anchorOffsetX = texture.textureWidth / 2;
this.anchorOffsetY = texture.textureHeight / 2;
}
}
function rangeIndexs(min: number, max: number, include: boolean = true) {
var nums = [];
if (include) nums.push(min);
var num: number = min;
while (++num < max) nums.push(num);
if (include) nums.push(max);
return nums
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"appItemId":2322, "appItemId":2322,
"categoryType":1, "categoryType":1,
"coinType":1, "coinType":1,
"img":"1", "img":"//yun.dui88.com/images/201910/e6pmpk2pne.png",
"maxValue":2, "maxValue":2,
"minValue":1, "minValue":1,
"name":"测试商品", "name":"测试商品",
......
{"success":true,"code":"0000000000","desc":"OK","timestamp":1573183122904,"data":{"wealth":40,"totalStars":42,"levels":[{"levelNum":1,"maxScore":99999,"stars":3},{"levelNum":2,"maxScore":99999,"stars":3},{"levelNum":3,"maxScore":12030,"stars":3},{"levelNum":4,"maxScore":17710,"stars":3},{"levelNum":5,"maxScore":16260,"stars":3},{"levelNum":6,"maxScore":22110,"stars":2},{"levelNum":7,"maxScore":17740,"stars":2},{"levelNum":8,"maxScore":19950,"stars":3},{"levelNum":9,"maxScore":31360,"stars":3},{"levelNum":10,"maxScore":26470,"stars":3},{"levelNum":11,"maxScore":59190,"stars":3},{"levelNum":12,"maxScore":37400,"stars":3},{"levelNum":13,"maxScore":25870,"stars":2},{"levelNum":14,"maxScore":49810,"stars":3},{"levelNum":15,"maxScore":31930,"stars":3}],"remainProp":[{"type":3,"num":1}],"remainEnargy":5,"askForEnergy":0,"canReceiveTreasureBoxNum":1,"nextRangeStarsNum":30,"isGetAllTreasureBox":false,"refectionCountdown":0}} {
\ No newline at end of file "success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1573183122904,
"data": {
"wealth": 8888,
"totalStars": 42,
"levels": [
{
"levelNum": 1,
"maxScore": 99999,
"stars": 3
},
{
"levelNum": 2,
"maxScore": 99999,
"stars": 3
},
{
"levelNum": 3,
"maxScore": 12030,
"stars": 3
},
{
"levelNum": 4,
"maxScore": 17710,
"stars": 3
},
{
"levelNum": 5,
"maxScore": 16260,
"stars": 3
},
{
"levelNum": 6,
"maxScore": 22110,
"stars": 2
},
{
"levelNum": 7,
"maxScore": 17740,
"stars": 2
},
{
"levelNum": 8,
"maxScore": 19950,
"stars": 3
},
{
"levelNum": 9,
"maxScore": 31360,
"stars": 3
},
{
"levelNum": 10,
"maxScore": 26470,
"stars": 3
},
{
"levelNum": 11,
"maxScore": 59190,
"stars": 3
},
{
"levelNum": 12,
"maxScore": 37400,
"stars": 3
},
{
"levelNum": 13,
"maxScore": 25870,
"stars": 2
},
{
"levelNum": 14,
"maxScore": 49810,
"stars": 3
},
{
"levelNum": 15,
"maxScore": 31930,
"stars": 3
}
],
"remainProp": [
{
"type": 3,
"num": 1
}
],
"remainEnargy": 5,
"askForEnergy": 0,
"canReceiveTreasureBoxNum": 1,
"nextRangeStarsNum": 30,
"isGetAllTreasureBox": false,
"refectionCountdown": 0
}
}
\ No newline at end of file
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
], ],
"id": null "id": null
}, },
"nextTimeNeedCoin": 8888 "nextTimeNeedCoin": 1
}, },
"success": true, "success": true,
"desc": "OK", "desc": "OK",
......
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