Commit 02ce9d89 authored by zjz1994's avatar zjz1994

节日暂存

parent 06af51f8
......@@ -241,7 +241,7 @@
"name": "helpGroup"
},
{
"keys": "virprizebg_png,lightdi_png,wormhole_png,startscenebg_jpg,adsmask_png,nsad2_png,nsad1_png,hbchuanguan2_png,redAlert_btn1_png",
"keys": "virprizebg_png,lightdi_png,wormhole_png,startscenebg_jpg,adsmask_png,nsad2_png,nsad1_png,hbchuanguan2_png,redAlert_btn1_png,loadingbgfes_png,titimg1_png,titimg2_png,titimg3_png,titimg4_png",
"name": "preload"
}
],
......@@ -5426,6 +5426,31 @@
"name": "redAlert_btn1_png",
"type": "image",
"url": "assets/redbombalert/redAlert_btn1.png"
},
{
"name": "loadingbgfes_png",
"type": "image",
"url": "assets/startScene/loadingbgfes.png"
},
{
"name": "titimg1_png",
"type": "image",
"url": "assets/redbombalert/titimg1.png"
},
{
"name": "titimg2_png",
"type": "image",
"url": "assets/redbombalert/titimg2.png"
},
{
"name": "titimg3_png",
"type": "image",
"url": "assets/redbombalert/titimg3.png"
},
{
"name": "titimg4_png",
"type": "image",
"url": "assets/redbombalert/titimg4.png"
}
]
}
\ No newline at end of file
......@@ -31,12 +31,12 @@
</e:Group>
<e:Image id="settingBtn" y="1" source="setting_png" horizontalCenter="0"/>
</e:Group>
<e:Group id="redrainbg" width="750" height="1624" visible="false">
<e:Group id="redrainbg" width="750" height="1624">
<e:Image source="redrainbg_jpg"/>
<e:Label id="tips" text="正在加载中,请稍后" y="826.33" textColor="0x244B00" horizontalCenter="0" size="24" visible="false"/>
<e:Label id="percentTxt" text="63%" y="943.33" textColor="0x244B00" horizontalCenter="0.5"/>
<e:Group x="140" y="857.27">
<e:Image source="loadingbg_png" y="0" x="0"/>
<e:Image y="3.99" x="5.33" source="loadingbgfes_png"/>
<e:Group id="maskwrapper" x="14.56" y="7.14">
<e:Group id="container4" x="0" y="0">
<e:Group id="container3" x="0" y="0"/>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="RedBombAlertSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group id="group" y="470" horizontalCenter="0" visible="false">
<e:Image source="redbombalert文案_png" y="0" horizontalCenter="0"/>
<e:Label id="tips" text="今日还有2个红包在其他关卡等你哦~" y="79" textColor="0xffe9c0" x="0"/>
<e:Group id="group" y="470" horizontalCenter="0">
<e:Image id="titimg1" y="0" horizontalCenter="0" source="titimg1_png" visible="false"/>
<e:Image id="titimg2" y="0" horizontalCenter="0" source="titimg2_png" visible="false"/>
<e:Image id="titimg3" y="0" horizontalCenter="0" source="titimg3_png" visible="false"/>
<e:Image id="titimg4" y="0" horizontalCenter="0" source="titimg4_png" visible="false"/>
<e:Label id="tips" text="今日还有2个红包在其他关卡等你哦~" y="79" textColor="0xffe9c0" horizontalCenter="0"/>
</e:Group>
<e:Group id="btn" y="985" horizontalCenter="0">
<e:Image id="btn1" y="0" source="redAlert_btn1_png" horizontalCenter="0" visible="false"/>
......
......@@ -291,7 +291,7 @@ export default class MainScene extends Scene {
//节日元素目标
festivalTarget: FestivalTarget;
//节日小元素需要个数
festivalTargetNum: number = fesELeSmallNum;
festivalTargetNum: number = 4;//fesELeSmallNum;
//所有元素的消耗数量,需要传给后端
hasEliminatedElements: number[];
//得分的动画,首先特效组合的单独算分,然后把所有符合的放入,在波及的特效触发时不算分
......@@ -456,6 +456,7 @@ export default class MainScene extends Scene {
}
resetMainScene(){
this.festivalTargetNum =4;
this.emptys = new Array();
this.warningCop = new Array();
this.eliminatedElements = new Array();
......@@ -1548,6 +1549,10 @@ export default class MainScene extends Scene {
async initFestivalEle() {
//添加节日元素,条件可能会变
console.log("节日元素判定",fesChapterData,this.chapter,getRedBombTimes(),window['fresp'],this.lattices[festivalIndex]);
var guidelevels = [1, 2, 3, 5, 8, 9, 10, 12, 17, 25, 41, 61, 101, 121, 226, 301,331, 377, 406, 426, 453, 501, 556, 601,661];
if(guidelevels.indexOf(this.chapter)!=-1){
return false;
}
if(
fesChapterData.indexOf(this.chapter >> 0) > -1 &&
getRedBombTimes() &&
......
......@@ -17,14 +17,33 @@ export default class RedBombAlertPanel extends Panel {
private alertHeight = 100; // TODO 高度修改
showimgtype:number = 1;
async start(data) {
super.start();
//1.作战成功,2.恭喜找到隐藏红包,3.恭喜找到今日所有隐藏红包,4.哎呀~红包溜走了
const date = new Date();
date.setHours(0, 0, 0, 0);
const nowTimerStr = date.getTime() + '';
const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId);
const nowTimerStr4 = date.getTime() + '';
const oldTimerStr4 = localStorage.getItem('nowTimer4Str' + window['CFG'].consumerId);
if(nowTimerStr4!=oldTimerStr4){
this.showimgtype = 1;
localStorage.setItem('nowTimer4Str' + window['CFG'].consumerId, nowTimerStr4);
}else{
this.showimgtype = 2;
}
const times = getRedBombTimes() - 1;
this['tips'].text = `今日还有${times}个红包在其他关卡等你哦~`;
if(times <= 0) {
this['tips'].text = `当日红包任务达成,明日再来~`;
this.showimgtype = 3;
this['tips'].text = `明天还有更多红包等你哦~`;
}
this.changeShowTitImg(this.showimgtype);
this['group'].alpha = 0;
egret.Tween.get(this['group']).wait(1500).to({alpha: 1}, 300);
......@@ -44,6 +63,13 @@ export default class RedBombAlertPanel extends Panel {
}, this);
});
}
changeShowTitImg(type:number){
this['titimg1'].visible = false;
this['titimg2'].visible = false;
this['titimg3'].visible = false;
this['titimg4'].visible = false;
this['titimg'+type].visible = true;
}
playNoPrizeAni() {
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_noprize.svga').then(async (mv: any) => {
......@@ -52,6 +78,14 @@ export default class RedBombAlertPanel extends Panel {
egret.Tween.get(this['group']).to({alpha: 0}, 300);
this.addChild(mv);
setTimeout(() => {
if(this.showimgtype==1||this.showimgtype==2){
this.showimgtype = 4;
this.changeShowTitImg(this.showimgtype);
this['group'].alpha = 1;
this['tips'].text = `快去另一个关卡找找吧`;
}
this.btn.visible = true;
this['btn2'].visible = true;
this['btn1'].visible = false;
......
......@@ -28,7 +28,7 @@ const chickenNum: number = 4;
//节日大红包的小红包数量
export const fesELeSmallNum: number = 4;
export let fesELeSmallNum: number = 4;
export class AiControl {
private static _ins: AiControl
......
......@@ -37,8 +37,8 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
this.addChild(showImage);
var texture: egret.Texture = RES.getRes("rightMark_png");
this.zeroMark = new egret.Bitmap(texture);
this.zeroMark.x = 23;
this.zeroMark.y = 50;
this.zeroMark.x = 30;
this.zeroMark.y = 47;
this.zeroMark.visible = false;
this.addChild(this.zeroMark);
this.countNum = new TargetNumber();
......
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