Commit bd6bb07f authored by 邱旭's avatar 邱旭

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

parents 6fe5106f cf502021
......@@ -68,6 +68,7 @@ import HbNoPrize from "../../src/panels/HongbaoRain/HbNoPrize";
import HbGame from "../../src/panels/HongbaoRain/HbGame";
import getRedBombAward from "../../src/getRedBombAward";
import BombTipsPanel from "../../src/panels/BombTipsPanel";
import RedBombRule from "../../src/panels/RedBombRule";
export default class MainBase extends eui.UILayer {
constructor() {
......@@ -125,6 +126,7 @@ export default class MainBase extends eui.UILayer {
['friend', { cls: FriendPanel }],
['ad', { cls: ADPanel }],
['BombTipsPanel', { cls: BombTipsPanel }],
['RedBombRule', { cls: RedBombRule }],
];
const scenes = [
......
{
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml",
"resource/skins/AvatarSkin.exml",
"resource/skins/BackSkin.exml",
"resource/skins/BagItem2Skin.exml",
"resource/skins/BagItemSkin.exml",
"resource/skins/BagQuitSkin.exml",
"resource/skins/BagSkin.exml",
"resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml",
"resource/skins/Box2Skin.exml",
"resource/skins/BoxSkin.exml",
"resource/skins/Buy1Skin.exml",
"resource/skins/Buy2Skin.exml",
"resource/skins/Buy3Skin.exml",
"resource/skins/ExchangeSkin.exml",
"resource/skins/FailSkin.exml",
"resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml",
"resource/skins/FriendShareSkin.exml",
"resource/skins/FriendSkin.exml",
"resource/skins/H52Skin.exml",
"resource/skins/H5Skin.exml",
"resource/skins/HbCutTimeSkin.exml",
"resource/skins/HbGameSkin.exml",
"resource/skins/HbNoPrizeSkin.exml",
"resource/skins/HbPrizeSkin.exml",
"resource/skins/HbRuleSkin.exml",
"resource/skins/IconButtonSkin.exml",
"resource/skins/InviteCutTimePanelSkin.exml",
"resource/skins/InviteItemSkin.exml",
"resource/skins/InvitePrizePanelSkin.exml",
"resource/skins/InviteRulePanelSkin.exml",
"resource/skins/InviteRuleSkin.exml",
"resource/skins/InviteSkin.exml",
"resource/skins/Main2Skin.exml",
"resource/skins/MapBottomSkin.exml",
"resource/skins/MapRepeatSkin.exml",
"resource/skins/MapSkin.exml",
"resource/skins/MapTopSkin.exml",
"resource/skins/NoPrizeSkin.exml",
"resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml",
"resource/skins/PlaySkin.exml",
"resource/skins/Prize2Skin.exml",
"resource/skins/PrizeSkin.exml",
"resource/skins/QuitSkin.exml",
"resource/skins/RankFriendListSkin.exml",
"resource/skins/RankItemSkin.exml",
"resource/skins/RankSkin.exml",
"resource/skins/RedBagActivitySkin.exml",
"resource/skins/RedBagAlertSkin.exml",
"resource/skins/RedBombTipsSkin.exml",
"resource/skins/ReliveSkin.exml",
"resource/skins/RuleSkin.exml",
"resource/skins/ScratchItemSkin.exml",
"resource/skins/ScratchPrizeSkin.exml",
"resource/skins/ScratchRuleSkin.exml",
"resource/skins/ScratchSkin.exml",
"resource/skins/Share2Skin.exml",
"resource/skins/Share3Skin.exml",
"resource/skins/ShareSkin.exml",
"resource/skins/ShareTipsSkin.exml",
"resource/skins/ShopSkin.exml",
"resource/skins/ShowOffSkin.exml",
"resource/skins/SignItemSkin.exml",
"resource/skins/SignPrizeSkin.exml",
"resource/skins/SignSkin.exml",
"resource/skins/StarSkin.exml",
"resource/skins/StartPanelSkin.exml",
"resource/skins/StartSkin.exml",
"resource/skins/TargetItemSkin.exml",
"resource/skins/TaskItemSkin.exml",
"resource/skins/TaskPrizeSkin.exml",
"resource/skins/TaskSkin.exml",
"resource/skins/Toast2Skin.exml",
"resource/skins/ToastSkin.exml",
"resource/skins/RedBombTipsSkin.exml",
"resource/skins/TurnRuleSkin.exml",
"resource/skins/TurntableNoPrizeSkin.exml",
"resource/skins/TurntablePrize2Skin.exml",
"resource/skins/TurntablePrizeSkin.exml",
"resource/skins/TurntableSkin.exml",
"resource/skins/VScrollBarSkin.exml"
],
"path": "resource/default.thm.json"
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml",
"resource/skins/AvatarSkin.exml",
"resource/skins/BackSkin.exml",
"resource/skins/BagItem2Skin.exml",
"resource/skins/BagItemSkin.exml",
"resource/skins/BagQuitSkin.exml",
"resource/skins/BagSkin.exml",
"resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml",
"resource/skins/Box2Skin.exml",
"resource/skins/BoxSkin.exml",
"resource/skins/Buy1Skin.exml",
"resource/skins/Buy2Skin.exml",
"resource/skins/Buy3Skin.exml",
"resource/skins/ExchangeSkin.exml",
"resource/skins/FailSkin.exml",
"resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml",
"resource/skins/FriendShareSkin.exml",
"resource/skins/FriendSkin.exml",
"resource/skins/H52Skin.exml",
"resource/skins/H5Skin.exml",
"resource/skins/HbCutTimeSkin.exml",
"resource/skins/HbGameSkin.exml",
"resource/skins/HbNoPrizeSkin.exml",
"resource/skins/HbPrizeSkin.exml",
"resource/skins/HbRuleSkin.exml",
"resource/skins/IconButtonSkin.exml",
"resource/skins/InviteCutTimePanelSkin.exml",
"resource/skins/InviteItemSkin.exml",
"resource/skins/InvitePrizePanelSkin.exml",
"resource/skins/InviteRulePanelSkin.exml",
"resource/skins/InviteRuleSkin.exml",
"resource/skins/InviteSkin.exml",
"resource/skins/Main2Skin.exml",
"resource/skins/MapBottomSkin.exml",
"resource/skins/MapRepeatSkin.exml",
"resource/skins/MapSkin.exml",
"resource/skins/MapTopSkin.exml",
"resource/skins/NoPrizeSkin.exml",
"resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml",
"resource/skins/PlaySkin.exml",
"resource/skins/Prize2Skin.exml",
"resource/skins/PrizeSkin.exml",
"resource/skins/QuitSkin.exml",
"resource/skins/RankFriendListSkin.exml",
"resource/skins/RankItemSkin.exml",
"resource/skins/RankSkin.exml",
"resource/skins/RedBagActivitySkin.exml",
"resource/skins/RedBagAlertSkin.exml",
"resource/skins/RedBombTipsSkin.exml",
"resource/skins/ReliveSkin.exml",
"resource/skins/RuleSkin.exml",
"resource/skins/ScratchItemSkin.exml",
"resource/skins/ScratchPrizeSkin.exml",
"resource/skins/ScratchRuleSkin.exml",
"resource/skins/ScratchSkin.exml",
"resource/skins/Share2Skin.exml",
"resource/skins/Share3Skin.exml",
"resource/skins/ShareSkin.exml",
"resource/skins/ShareTipsSkin.exml",
"resource/skins/ShopSkin.exml",
"resource/skins/ShowOffSkin.exml",
"resource/skins/SignItemSkin.exml",
"resource/skins/SignPrizeSkin.exml",
"resource/skins/SignSkin.exml",
"resource/skins/StarSkin.exml",
"resource/skins/StartPanelSkin.exml",
"resource/skins/StartSkin.exml",
"resource/skins/TargetItemSkin.exml",
"resource/skins/TaskItemSkin.exml",
"resource/skins/TaskPrizeSkin.exml",
"resource/skins/TaskSkin.exml",
"resource/skins/Toast2Skin.exml",
"resource/skins/ToastSkin.exml",
"resource/skins/RedBombTipsSkin.exml",
"resource/skins/RedBombRuleSkin.exml",
"resource/skins/TurnRuleSkin.exml",
"resource/skins/TurntableNoPrizeSkin.exml",
"resource/skins/TurntablePrize2Skin.exml",
"resource/skins/TurntablePrizeSkin.exml",
"resource/skins/TurntableSkin.exml",
"resource/skins/VScrollBarSkin.exml"
],
"path": "resource/default.thm.json"
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="RedBombRuleSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect left="0" top="0" bottom="0" right="0" fillAlpha="0.65"/>
<e:Image id="ruleBg" horizontalCenter="0" y="112" source="hbRule_bg_png"/>
<e:Scroller id="scroller" width="545" x="103.76" height="507" y="337.2">
<e:Group id="group" width="100%">
<e:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" textColor="0xa54615"/>
<e:layout>
<e:VerticalLayout/>
</e:layout>
</e:Group>
</e:Scroller>
<e:Button id="closeBtn" label="" x="613" y="261">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
......@@ -6,21 +6,34 @@ import { DataManager } from "../libs/tw/manager/DataManager";
*/
export default (callback?) => {
NetManager.ins.hc_redBombAward((success) => {
callback(success);
if (success) {
const data = DataManager.ins.getData('hc_redBombAward').data;
if (data && data.option && data.option.categoryType != 1) {
callback(1);
}
else {
callback(0);
}
} else {
callback(0);
}
NetManager.ins.hc_redBombBaseInfo(()=>{});
if (data) changeTimesData(data.remainAwardTimes || 0);
// if (data && data.option && data.option.categoryType != 1) {
// callback(1);
// }
// else {
// callback(0);
// }
}
// else {
// callback(0);
// }
// NetManager.ins.hc_redBombBaseInfo(() => { });
});
}
export const getRedBombTimes = ()=>{
return DataManager.ins.getData('hc_redBombBaseInfo');
//如果接口没成功就返回0
export const getRedBombTimes = () => {
if (DataManager.ins.getData('hc_redBombBaseInfo') &&
DataManager.ins.getData('hc_redBombBaseInfo').data) {
return DataManager.ins.getData('hc_redBombBaseInfo').data;
}
return 0;
}
function changeTimesData(timess: number) {
DataManager.ins.getData('hc_redBombBaseInfo').data = timess;
}
\ No newline at end of file
......@@ -64,7 +64,8 @@ import { PropBtnCon } from '../something/uis/PropBtnCon';
import { ChapterNum } from '../something/uis/ChapterNum';
import { CurScoreNum } from '../something/uis/CurScoreNum';
import { FestivalTarget } from '../something/uis/FestivalTarget';
import getRedBombAward from '../getRedBombAward';
import getRedBombAward, { getRedBombTimes } from '../getRedBombAward';
import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni';
const aniClass = {
"BoomAni": BoomAni,
......@@ -81,7 +82,6 @@ const aniClass = {
"EggBrokenAni": EggBrokenAni,
"HairballGreyDisAni": HairballGreyDisAni,
// "HairballBlackDisAni": HairballBlackDisAni,
// "FestivalEleSmallDisAni": FestivalEleSmallDisAni,
}
export const baseScore = 20;
/**
......@@ -103,13 +103,17 @@ export const effectBaseTimes = {
EE: 25,
MM: 50
}
//加载器
let svgaParser;
//三个toast和bonusTime
const movieClips: any = {}
//红包炸弹弹框名字
const redBombPanelName = "aaaaa";
//所有可能被添加节日红包的关卡及索引,默认索引值都是40;如果没有就不放
const fesChapterData: number[] = [1]
//节日大红包格子索引
const festivalIndex: number = 40
export default class MainScene extends Scene {
get skinKey() { return 'Main2' }
......@@ -163,6 +167,8 @@ export default class MainScene extends Scene {
elementTargets: ElementTargets;
//节日元素目标
festivalTarget: FestivalTarget;
//节日小元素需要个数
festivalTargetNum: number = 6;
//所有元素的消耗数量,需要传给后端
hasEliminatedElements: number[];
//得分的动画,首先特效组合的单独算分,然后把所有符合的放入,在波及的特效触发时不算分
......@@ -239,20 +245,9 @@ export default class MainScene extends Scene {
this.chapterData = getChapterData(this.chapter);
//初始化目标信息
this.initTarget();
//添加节日元素,条件可能会变
if (111) {
//添加节日红包目标
this.festivalTarget = new FestivalTarget();
this.festivalTarget.x = 580;
this.festivalTarget.y = 115;
this.addChildAt(this.festivalTarget, 1);
//动效,修改最中间元素为红包
}
//初始化索引信息,包括10*10的,
Tool.init(Tool.getColOddEven(this.chapterData.map.lattices), !!(this.passElements && this.passElements[ElementType.LOLLIPOP]));
this.initUi();
this.initSvgas();
//先禁掉事件
this.enableMouseEvt(false);
//三个曝光埋点
......@@ -260,7 +255,8 @@ export default class MainScene extends Scene {
NetManager.ins.showLog(getlogItem(10))
NetManager.ins.showLog(getlogItem(13))
//初始话地图格子数据
this.initLattices();
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
this.initRecycle();
//初始化元素
......@@ -271,33 +267,40 @@ export default class MainScene extends Scene {
this.addChild(this["settingAll"])
//AiControl初始化,
AiControl.ins.init(this.lattices);
//检查一次三消
if (this.threeMatch()) {
this.eliminate();
} else {
//先检测死图
this.warningCop = Tool.dieMapCheck(this.lattices);
if (!this.warningCop) {
//替换顺序
this.upsetElement();
}
else {
this.enableMouseEvt(true);
//引导
this.initGuide();
//先判断是否添加节日元素,如果加节日元素,就按initFestivalEle里的来
if (!this.initFestivalEle()) {
//检查一次三消
if (this.threeMatch()) {
this.eliminate();
} else {
//先检测死图
this.warningCop = Tool.dieMapCheck(this.lattices);
if (!this.warningCop) {
//替换顺序
this.upsetElement();
}
else {
this.enableMouseEvt(true);
//引导
this.initGuide();
}
}
}
//最后加载svga,为了判断是否要加大红包的动效
this.initSvgas();
}
/**
* 加载所有用到的svga
*/
initSvgas() {
var resPath = getResPath()
var parser = new window["SVGA"].Parser();
var svgas = ["amazing", "great", "wonderful", "bonusTime"]
var resPath = getResPath();
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
var svgas = ["amazing", "great", "wonderful", "bonusTime"];
//如果有节日的加
if (this.festivalTarget) svgas.push("redBombLight");
for (let i = 0; i < svgas.length; i++) {
if (movieClips[svgas[i]]) continue;
parser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
svgaParser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem);
mv.lockStep = true;
if (svgas[i] != "bonusTime") {
......@@ -348,8 +351,6 @@ export default class MainScene extends Scene {
var bg = drawBg(path, this.chapterData.map.lattices)
this.addChild(bg);
this.map = bg;
//初始话地图格子数据,主要因为有冰块,要添加进map,还有要判断是否需要大遮罩,所以位置在这里
this.initLattices();
//容器
this.elementContainer = new egret.DisplayObjectContainer();
this.addChild(this.elementContainer);
......@@ -696,6 +697,56 @@ export default class MainScene extends Scene {
// }
// }
}
//初始化节日元素
initFestivalEle(): boolean {
//添加节日元素,条件可能会变
if (getRedBombTimes() &&
fesChapterData.indexOf(this.chapter >> 0) > -1 &&
// Math.random() > 0.5 &&
this.lattices[festivalIndex] && //格子必须有
(Tool.judgeSetFesEle(this.lattices[festivalIndex]) || !this.lattices[festivalIndex].element) //没有元素也行
) {
var p = Tool.getPositionByIndex(festivalIndex);
//添加节日红包目标
this.festivalTarget = new FestivalTarget(this.festivalTargetNum);
this.festivalTarget.x = 580;
this.festivalTarget.y = 115;
this.addChildAt(this.festivalTarget, 1);
if (this.lattices[festivalIndex].element) {
this.lattices[festivalIndex].element.reset(ElementType.FESTIVALELE_BIG)
} else {
let ele: Element = Tool.getElement(ElementType.FESTIVALELE_BIG)
ele.x = p[0];
ele.y = p[1];
this.elementContainer.addChild(ele);
this.lattices[festivalIndex].element = ele;
}
//动画,然后恢复this.enableMouseEvt(true);
let ani: FesRedBombShowAni = Pool.takeOut(RecoverName.FESREDBOMBSHOW_ANI)
if (!ani) ani = new FesRedBombShowAni();
this.addChild(ani);
this.lattices[festivalIndex].element.visible = false;
ani.play(p, () => {
this.lattices[festivalIndex].element.visible = true;
//检查三消
if (this.threeMatch()) {
this.eliminate();
} else {
//先检测死图
this.warningCop = Tool.dieMapCheck(this.lattices);
if (!this.warningCop) {
//替换顺序
this.upsetElement();
}
else {
this.enableMouseEvt(true);
}
}
})
return true
}
return false
}
/**
* 更新三个道具
......@@ -1041,22 +1092,18 @@ export default class MainScene extends Scene {
}
//交换元素动画
private exchangeElementAni(s: Element, o: Element, callback?) {
var self = this;
// self.enableTouch = false;
this.enableMouseEvt(false);
egret.Tween.get(s)
.to({ x: o.x, y: o.y }, 166)
.call(() => {
if (callback) {
callback.bind(self)(s, o);
callback.bind(this)(s, o);
} else {
// self.enableTouch = true;
self.enableMouseEvt(true);
this.enableMouseEvt(true);
}
})
egret.Tween.get(o)
.to({ x: s.x, y: s.y }, 166)
}
//数据交换
private exchangeData(a: Element, b: Element) {
......@@ -2474,15 +2521,7 @@ export default class MainScene extends Scene {
* @param index
*/
recoverEle(index: number) {
let ele = this.lattices[index].element;
//添加进emptys
this.emptys.push(index)
//从容器移除
this.elementContainer.removeChild(ele);
//回收元素
Pool.recover(RecoverName.ELEMENT, ele);
//置空格子的element,
this.lattices[index].element = null;
let ele = this.removeOperation(index);
//棒棒糖消除不产生任何其他效果
if (ele.type != ElementType.LOLLIPOP) this.checkNebAll(this.lattices[index]);
//计算元素消除个数
......@@ -2692,6 +2731,14 @@ export default class MainScene extends Scene {
this.checkNebEle(latttice, (lat) => {
return lat && lat.element && lat.element.hasState(StateType.HAIRBALLBLACK)
});
//如果附近有节日大红包
this.checkNebEle(latttice, (lat) => {
return lat && lat.element && lat.element.type == ElementType.FESTIVALELE_BIG;
});
//如果附近有节日小红包
this.checkNebEle(latttice, (lat) => {
return lat && lat.element && lat.element.type == ElementType.FESTIVALELE_SMALL;
});
}
/**
* 石头的移除,包括动效
......@@ -2715,17 +2762,19 @@ export default class MainScene extends Scene {
//移除小红包,包括动效,还有个数累计等等。发接口,等等
removeFestivalEleSmall(index: number) {
this.removeOperation(index);
//播放动效
this.playAni(RecoverName.FESTIVALELESMALLDIS_ANI, Tool.getPositionByIndex(index))
let ele = this.removeOperation(index);
//查看次数,原先不为0,
if (this.festivalTarget.count) {
this.festivalTarget.count--;
//完成了,发接口,,
if (this.festivalTarget.count == 0) {
getRedBombAward(() => {
this.redBombPanelMark = true;
})
if (this.festivalTargetNum) {
this.festivalTargetNum--;
var p = this.festivalTarget.localToGlobal(40 * 0.8, 40 * 0.8)
this.addChild(FlyTargetAni(ElementType.FESTIVALELE_SMALL, [ele.x, ele.y], [p.x, p.y], () => {
this.festivalTarget.count--;
}))
//完成了,发接口,到时需要修改,对于接口没成功的不设置
if (!this.festivalTargetNum) {
NetManager.ins.hc_redBombAward((success) => {
if (success) this.redBombPanelMark = true;
});
}
}
}
......
......@@ -2,6 +2,7 @@ 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";
export default class BombTipsPanel extends Panel {
async start(data) {
......@@ -32,9 +33,17 @@ export default class BombTipsPanel extends Panel {
initEvents() {
super.initEvents();
this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this);
this['rulebtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite2, this);
}
onTapInvite2() {
const rule = new RedBombRule();
rule.loadSkin();
rule.start();
this.addChild(rule);
}
onTapInvite() {
this['btn'].touchEnabled=false;
const eles = ['btn', 'rulebtn', 'bg', 'ele1', 'ele2', 'ele3', 'ele4', 'light'];
......
import Panel from "../../libs/new_wx/components/Panel";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import { HtmlTextParser } from "../../libs/new_wx/HtmlTextParser";
/**
* 邀请规则面板
*/
export default class RedBombRule extends Panel {
public scroller: eui.Scroller;
public group: eui.Group;
public labContent: eui.Label;
public closeBtn: eui.Button;
private _mask: egret.Sprite;
start() {
super.start();
this.addRule();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, ()=>{
this.visible = false;
}, this);
}
loadSkin() {
this.skinName = getSkinPath(this.skinKey);
if (this.skin) {
this.onSkinComplete();
} else {
this.addEventListener(egret.Event.COMPLETE, this.onSkinComplete, this);
}
}
private addRule() {
const text =
`<br>1、用户每天邀请指定数量的新玩家参与闯关,可获得指定的现金券奖励。
2、用户发起邀请后,需在24小时内完成邀请任务;超过24小时,邀请任务失败,无法获得奖励,需重新发起邀请。
3、新用户仅包含未参与过狮狮连萌活动的用户。
4、用户不可为自己助力,或重复为好友助力。
5、完成邀请任务后,玩家可点击首页“邀请得现金券”图标领取现金券。
6、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。
7、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。
8、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
9、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动。`
this.labContent.textFlow = (new HtmlTextParser).parser(text);
}
get skinKey() {
return 'RedBombRule'
}
}
......@@ -369,6 +369,24 @@ export class Tool {
return false;
}
/**
* 可放置节日元素
* 必须是基础元素,且不带毛球状态
* 毛球可能成为通关目标,不放
*
* @param lat
*/
public static judgeSetFesEle(lat: Lattice) {
if (Tool.judgeBaseEle(lat) && //基础元素
!lat.element.hasState(StateType.HAIRBALLGREY) && //不带毛球,下同
!lat.element.hasState(StateType.HAIRBALLBLACK) &&
!lat.element.hasState(StateType.HAIRBALLBROWN)
) {
return true;
}
return false;
}
/**
* 判断元素是否可被手势选中和交换
......
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
export class FesRedBombShowAni extends egret.DisplayObjectContainer {
constructor() {
super()
var textureDown: egret.Texture = RES.getRes("fesRedBombSta1_png")
var down = new egret.Bitmap(textureDown);
down.x = -textureDown.textureWidth / 2;
down.y = -textureDown.textureHeight / 2;
this.addChild(down);
var textureUp: egret.Texture = RES.getRes("xingxingbi_png");
var up = new egret.Bitmap(textureUp);
up.x = -textureUp.textureWidth / 2; //-89
up.y = -100;
this.addChild(up);
}
play(position: number[], callback: Function) {
this.scaleX = this.scaleY = 0.29;
this.x = position[0];
this.y = position[1];
egret.Tween.get(this)
.wait(200)
.to({ scaleX: 1, scaleY: 1 }, 500, egret.Ease.backOut)
.wait(500)
.to({ scaleX: 0.29, scaleY: 0.29 }, 500, egret.Ease.backInOut)
.call(() => {
if (this.parent) this.parent.removeChild(this);
Pool.recover(RecoverName.FESREDBOMBSHOW_ANI, this);
callback()
})
//波纹动效再说,现在来不及
}
}
\ No newline at end of file
......@@ -10,8 +10,7 @@ const images = {
* 节日元素
*
*/
export class FestivalEle extends eui.Component {
private showImage: eui.Image;
export class FestivalEle extends egret.DisplayObjectContainer {
/**
* 是否要分裂了
*/
......@@ -25,52 +24,275 @@ export class FestivalEle extends eui.Component {
}
set statusNum(value: number) {
if (value >= 0) {
//播放原来的动画
let child = this.$children[this._statusNum];
child["play"](() => {
//切换
this.toggleStatus(value);
})
this._statusNum = value;
//播放动画,然后循环动画
// if (this.showImage.source != images[this._statusNum]) {
// this.changeSource(images[this._statusNum]);
// }
} else {
//不用动画
this._statusNum = 0;
this.isActive = true;
}
}
constructor(n: number = 2) {
super()
this.showImage = new eui.Image();
this.addChild(this.showImage)
this.changeSource(images[n]);
super();
var status3 = new Status3();
this.addChild(status3);
var status2 = new Status2();
this.addChild(status2);
var status1 = new Status1();
this.addChild(status1);
this.toggleStatus(n);
this.isActive = false;
this._statusNum = n;
}
changeSource(source: string) {
var texture: egret.Texture = RES.getRes(source);
this.showImage.texture = texture
this.showImage.anchorOffsetX = texture.textureWidth / 2;
this.showImage.anchorOffsetY = texture.textureHeight / 2 + 20;
this.showImage.y = 20
}
shakeAni() {
this.showImage.rotation = 0;
egret.Tween.get(this.showImage)
.to({ rotation: 10 }, 80)
.to({ rotation: -8 }, 160)
.to({ rotation: 5 }, 160)
.to({ rotation: 0 }, 50)
}
reset(n: number = 2) {
this.changeSource(images[n]);
this.toggleStatus(n);
this.isActive = false;
this._statusNum = n;
}
toggleStatus(index: number) {
for (var i = 0; i < this.$children.length; i++) {
var child = this.$children[i];
if (i == index) {
child.visible = true;
//重置状态
child["reset"]();
} else {
child.visible = false;
}
}
}
}
//第一种状态
class Status1 extends egret.DisplayObjectContainer {
upImage: egret.Bitmap;
constructor() {
super();
var textureDown: egret.Texture = RES.getRes("fesRedBombSta1_png")
var down = new egret.Bitmap(textureDown);
down.x = -textureDown.textureWidth / 2;
down.y = -textureDown.textureHeight / 2;
this.addChild(down);
var textureUp: egret.Texture = RES.getRes("xingxingbi_png");
var up = new egret.Bitmap(textureUp);
up.anchorOffsetX = textureUp.textureWidth / 2;
up.anchorOffsetY = textureUp.textureHeight / 2;
up.y = textureUp.textureHeight / 2 - 100;
this.addChild(up);
this.upImage = up;
this.scaleX = this.scaleY = 0.29;
}
reset() {
this.upImage.scaleX = this.upImage.scaleY = 1;
}
play(callback: Function) {
egret.Tween.get(this.upImage)
.to({ scaleX: 1.8, scaleY: 1.8 }, 240)
.call(() => {
callback();
})
}
}
const status2Cfg = [
{
"name": "fesRedCap",
"x": -7,
"y": -6,
"width": 251,
"height": 104
},
{
"name": "fesRedSmallLight",
"x": -7,
"y": -14,
"width": 249,
"height": 159
},
{
"name": "fesRedUp",
"x": -2,
"y": 52,
"width": 237,
"height": 185
},
{
"name": "fesRedDown",
"x": -2,
"y": 0,
"width": 237,
"height": 237
}
]
//第二种状态
class Status2 extends egret.DisplayObjectContainer {
light: egret.Bitmap;
fesRedCap: egret.Bitmap
constructor() {
super();
this.scaleX = this.scaleY = 0.29
for (var i = status2Cfg.length - 1; i >= 0; i--) {
var bitmap = new egret.Bitmap(RES.getRes(status2Cfg[i].name + "_png"));
bitmap.x = status2Cfg[i].x - 237 / 2;
bitmap.y = status2Cfg[i].y - 237 / 2;
this.addChild(bitmap);
if (status2Cfg[i].name == "fesRedSmallLight") {
this.light = bitmap
} else if (status2Cfg[i].name == "fesRedCap") {
this.fesRedCap = bitmap;
}
}
}
reset() {
this.fesRedCap.scaleY = 1;
this.light.alpha = 1;
egret.Tween.get(this.light, { loop: true })
.to({ alpha: 0 }, 450)
.to({ alpha: 1 }, 450)
}
play(callback: Function) {
this.light.alpha = 0;
egret.Tween.removeTweens(this.light);
this.fesRedCap.scaleY = 1;
egret.Tween.get(this.fesRedCap)
.to({ scaleY: 0.1 }, 180)
.call(() => {
callback();
})
}
}
const status3Cfg = [
{
"name": "fesRedUp",
"x": 0,
"y": 52,
"width": 237,
"height": 185
},
{
"name": "tinyRedMid",
"x": 86,
"y": 60,
"width": 74,
"height": 90
},
{
"name": "tinyRedLeft",
"x": 22,
"y": 5,
"width": 116,
"height": 132
},
{
"name": "tinyRedRight",
"x": 123,
"y": 14,
"width": 89,
"height": 106
},
{
"name": "fesRedDown",
"x": 0,
"y": 0,
"width": 237,
"height": 237
}
]
class Status3 extends egret.DisplayObjectContainer {
midRed: egret.Bitmap;
leftRed: egret.Bitmap;
rightRed: egret.Bitmap;
constructor() {
super();
this.scaleX = this.scaleY = 0.29
for (var i = status3Cfg.length - 1; i >= 0; i--) {
var config = status3Cfg[i];
var bitmap = new egret.Bitmap(RES.getRes(config.name + "_png"));
bitmap.x = config.x - 237 / 2;
bitmap.y = config.y - 237 / 2;
this.addChild(bitmap);
if (config.name == "tinyRedMid") {
this.midRed = bitmap;
} else if (config.name == "tinyRedLeft") {
this.leftRed = bitmap;
} else if (config.name == "tinyRedRight") {
this.rightRed = bitmap;
}
}
}
reset() {
egret.Tween.removeTweens(this.leftRed);
egret.Tween.removeTweens(this.rightRed);
egret.Tween.removeTweens(this.midRed);
var offset = 237 / 2
//动画出来,然后循环
this.leftRed.x = 22 + 40 - offset;
this.leftRed.y = 5 + 100 - offset;
egret.Tween.get(this.leftRed)
.to({ x: 22 - 3 - offset, y: 5 - 8 - offset }, 150)
.to({ x: 22 - offset, y: 5 - offset }, 50)
this.rightRed.x = 123 - 7 - offset;
this.rightRed.y = 14 + 100 - offset;
egret.Tween.get(this.rightRed)
.to({ x: 123 + 3 - offset, y: 14 - 8 - offset }, 150)
.to({ x: 123 - offset, y: 14 - offset }, 50)
this.midRed.x = 86 - 7 - offset;
this.midRed.y = 60 + 80 - offset;
egret.Tween.get(this.midRed)
.to({ x: 86 + 3 - offset, y: 60 - 8 - offset }, 150)
.to({ x: 86 - offset, y: 60 - offset }, 50)
.call(() => {
//循环动画
this.leftRed.x = 22 - offset;
this.leftRed.y = 5 - offset;
egret.Tween.get(this.leftRed, { loop: true })
.to({ x: 22 + 2 - offset, y: 5 + 5 - offset }, 150)
.to({ x: 22 - 6 - offset, y: 5 - 14 - offset }, 150)
.to({ x: 22 - offset, y: 5 - offset }, 100)
.wait(500);
this.rightRed.x = 123 - offset;
this.rightRed.y = 14 - offset;
egret.Tween.get(this.rightRed, { loop: true })
.to({ x: 123 - 2 - offset, y: 14 + 5 - offset }, 150)
.to({ x: 123 + 6 - offset, y: 14 - 14 - offset }, 150)
.to({ x: 123 - offset, y: 14 - offset }, 100)
.wait(500);
// class
\ No newline at end of file
this.midRed.x = 86 - offset;
this.midRed.y = 60 - offset;
egret.Tween.get(this.midRed, { loop: true })
.to({ x: 86 - 2 - offset, y: 60 + 5 - offset }, 150)
.to({ x: 86 + 6 - offset, y: 60 - 14 - offset }, 150)
.to({ x: 86 - offset, y: 60 - offset }, 100)
.wait(500);
})
}
play(callback: Function) {
}
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ export enum RecoverName {
BUBBLE_ANI = "BubbleAni",
HAIRBALLBROWNDIVIDE_ANI = "HairballBrownDivideAni",
HAIRBALLJUMP_ANI = "HairballJumpAni", //三种毛球是一样的动画
FESREDBOMBSHOW_ANI = "FesRedBombShowAni",
......@@ -52,7 +53,6 @@ export enum RecoverName {
EGGBROKEN_ANI = "EggBrokenAni",
HAIRBALLGREYDIS_ANI = "HairballGreyDisAni",
HAIRBALLBLACKDIS_ANI = "HairballBlackDisAni",
FESTIVALELESMALLDIS_ANI = "FestivalEleSmallDisAni",
//方形遮罩
RECT_MASK = "RectMask",
......
......@@ -30,7 +30,7 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
this._count = value;
this.countNum.num = value;
}
constructor() {
constructor(count: number = 6) {
super()
var texture: egret.Texture = RES.getRes("festivalTargetBg_png");
var showImage = new egret.Bitmap(texture);
......@@ -42,10 +42,10 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
this.zeroMark.visible = false;
this.addChild(this.zeroMark);
this.countNum = new TargetNumber();
this.countNum.x = 40;
this.countNum.y = 60;
this.countNum.x = 40;
this.countNum.y = 60;
this.addChild(this.countNum);
this.count = 6;
this.count = count;
}
}
\ No newline at end of file
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