Commit 799b7543 authored by wildfirecode's avatar wildfirecode

1

parent 06022a7a
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["../assets/mainScene/arrowbg.png"]}
\ No newline at end of file
......@@ -2058,6 +2058,8 @@ export default class MainScene extends Scene {
}
await doConveyorAI(this);
await doSandAI(this);
if(this.lattices.some(lat=>!lat.element))
throw new Error('123')
const doHoneyPotAIResult = await doHoneyPotAI(this);
if (doHoneyPotAIResult.length > 0) {//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
doHoneyPotAIResult.forEach((index) => {
......
import { fillConveyor, getArrowDir, ARROW_DIR } from "../something/conveyor/conveyorTool";
import { ARROW_DIR, fillConveyor, findTarget, getArrowDir } from "../something/conveyor/conveyorTool";
import MainScene from "./MainScene";
import { Element } from "../something/class/Element";
import { Tool } from "../something/Tool";
const getTargetIndexs = (conveyor: number[]) => {
......@@ -15,75 +14,75 @@ const getTargetIndexs = (conveyor: number[]) => {
return list;
}
// const conBgAniCahce = {};
// class ConBgAni {
// private _thisObj: MainScene;
// private _conveyor: number[];
// private _conveyorList: number[][];
// constructor(thisObj: MainScene, conveyor: number[], conveyorList: number[][]) {
// this._thisObj = thisObj;
// this._conveyor = conveyor;
// this._conveyorList = conveyorList;
// const list = fillConveyor(conveyor);
// const targetIndexs = getTargetIndexs(conveyor);
// }
// play() {
// }
// }
export default async (thisObj: MainScene) => {
//移动了传送带之后,可能会有可消除的,需要检查消除
//移动的动画,如果是两头的需要一个带遮罩的动画
//检查与其他元素的兼容性
const conveyorList = thisObj.chapterData.map.conveyor;
if (!conveyorList) return null;
if (!conveyorList) return;
const elementsList = []; //所有轨道元素组的列表
const targetLatticesList = []; //所有轨道目标地图组的列表
const latticesList = []; //所有轨道当前地图组的列表
const targetIndexsList = [];
for (const conveyor of conveyorList) {
const list = fillConveyor(conveyor);
const targetIndexs = getTargetIndexs(conveyor);
const dir = getArrowDir(conveyor);
let foundTarget: number;
if (dir == ARROW_DIR.RIGHT || dir == ARROW_DIR.DOWN) {//如果是右or下,最后一个的目标去找下
foundTarget = findTarget(list[list.length - 1], thisObj.chapterData.map.conveyorConnectedLats);
targetIndexs[targetIndexs.length - 1] = foundTarget;
} else {
foundTarget = findTarget(list[0], thisObj.chapterData.map.conveyorConnectedLats);
targetIndexs[0] = foundTarget;
}
console.log(list, targetIndexs);
const elements = list.map(index => thisObj.lattices[index].element);
const lattices = list.map(index => thisObj.lattices[index]);
const elements = list.map(index => thisObj.lattices[index].element);//当前传送带元素
const lattices = list.map(index => thisObj.lattices[index]);//当前的lattices
const targetLattices = targetIndexs.map(index => thisObj.lattices[index]);
lattices.forEach(lat => lat.element = null);
list.forEach((index, i) => {
const c = thisObj.conveyorMap[index];
const targetP = Tool.getPositionByIndex(targetIndexs[i]);
egret.Tween.get(c).to({ x: targetP[0], y: targetP[1] }, 200);
elementsList.push(elements);
targetLatticesList.push(targetLattices);
latticesList.push(lattices);
targetIndexsList.push(targetIndexs);
// lattices.forEach(lat => lat.element = null);
// list.forEach((index, i) => {
// const c = thisObj.conveyorMap[index];
// const targetP = Tool.getPositionByIndex(targetIndexs[i]);
// egret.Tween.get(c).to({ x: targetP[0], y: targetP[1] }, 200);
// });
// elements.forEach((ele, i) => {
// targetLattices[i].element = ele;
// const targetP = Tool.getPositionByIndex(targetIndexs[i]);
// egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 200);
}
latticesList.forEach(lattices => {
lattices.forEach(lat => lat.element = null);
});
elements.forEach((ele, i) => {
targetLattices[i].element = ele;
const targetP = Tool.getPositionByIndex(targetIndexs[i]);
egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 200);
const promiseList: Promise<any>[] = [];
elementsList.forEach((elements, i) => {
const targetLattices = targetLatticesList[i];
const targetIndexs = targetIndexsList[i];
const lattices = latticesList[i];
// const lat = thisObj.lattices[index];
// const ele = elements[i];
// const targetIndex = targetIndexs[i];
// const targetLat = thisObj.lattices[targetIndex]
// lat.element = null;
// if (ele) {
// targetLat.element = ele;
// const targetP = Tool.getPositionByIndex(targetIndex);
// egret.Tween.get(ele).to({x: targetP[0],y:targetP[1]},200);
// // ele.x = targetP[0];
// // ele.y = targetP[1];
// }
elements.forEach((ele, eleIndex) => {
targetLattices[eleIndex].element = ele;
const targetP = Tool.getPositionByIndex(targetIndexs[eleIndex]);
const promise = new Promise((r) => {
egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 500).call(r);
});
// list.forEach(i => {
// const arrow = createArrowBg(tex);
// arrow.rotation = getArrowRotation(dir);
// this.conveyor.addChild(arrow);
// const p = Tool.getPositionByIndex(i);
// arrow.x = p[0];
// arrow.y = p[1];
// // egret.Tween.get(arrow).to({y:p[1]+500},7000)
// });
}
promiseList.push(promise)
});
});
await Promise.all(promiseList);
}
\ No newline at end of file
......@@ -229,7 +229,7 @@ export default class MapScene extends Scene {
const { signInfoVO } = DataManager.ins.getData('getSignInfo');
if (signInfoVO && signInfoVO.continueDay < 7) { //表示明天还可以签到
if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) {
if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr && getSignBtn()) {
panels.push('sign');
localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr);
}
......
......@@ -134,7 +134,7 @@ export default class SignPanel extends Panel {
if (notGiftResult) {
result.push(this.getResultItem(notGiftResult));
} else {
result.push({ nums: '惊喜礼盒', type: 'object' });
result.push({ nums: '*1', type: 'object' });
}
return result;
}
......@@ -144,7 +144,7 @@ export default class SignPanel extends Panel {
getResultItem(option) {
const resultItem: any = {};
if (option.categoryType == 2) {
resultItem.nums = `体力*${option.num}`
resultItem.nums = `*${option.num}`
resultItem.type = 'blood';
}
else if (option.categoryType == 3) {
......@@ -154,8 +154,11 @@ export default class SignPanel extends Panel {
}
else if (option.categoryType == 4) {
resultItem.type = 'money';
resultItem.nums = `${option.maxValue}元宝`;
if (option.maxValue != option.minValue) console.warn('元宝配置错误');
if (option.maxValue != option.minValue)
resultItem.nums = `*?`;
else
resultItem.nums = `*${option.maxValue}`;
// if (option.maxValue != option.minValue) console.warn('元宝配置错误');
}
else if (option.categoryType >= 5) {
resultItem.nums = `*1`;
......@@ -171,7 +174,7 @@ export default class SignPanel extends Panel {
if (results.length == 1) {
result = results[0];
return result;
}else {
} else {
console.warn('配置错误');
}
return null;
......
......@@ -4,7 +4,7 @@ import { ElementType } from "../enum/ElementType";
//501-525
export const Chapters20: ChapterData[] = [
{
baseElementTypes: [0, 1, 2, 3,4],
baseElementTypes: [0, 1, 2, 3, 4],
bubbleProbability: 0,
stepCount: 999,
passTarget: {
......@@ -29,14 +29,17 @@ export const Chapters20: ChapterData[] = [
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
conveyor:[
[29,56],
[57,60],
[51,33],
[32,30],
conveyor: [
// [29,56],
// [57,60],
[51, 33],
[32, 30],
],
conveyorConnectedLats:[
[76,29]
conveyorConnectedLats: [
// [56,57],
// [60,29],
[33, 32],
[30, 51],
],
generateLats: [
{ index: 11, type: [0], cus: [] },
......
......@@ -98,3 +98,13 @@ export const fillConveyor = (conveyor: number[]) => {
}
return null;
}
export const findTarget = (start: number, conveyorConnectedLats: number[][]) => {
for (const c of conveyorConnectedLats) {
const [s,e]=c;
if(start==s)
return e
}
throw new Error('配置错误')
}
\ No newline at end of file
......@@ -84,7 +84,7 @@
"categoryType": 4,
"title": null,
"rate": null,
"minValue": 10,
"minValue": 0,
"maxValue": 20,
"coinType": 2,
"realValue": null,
......
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