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 { ...@@ -2058,6 +2058,8 @@ export default class MainScene extends Scene {
} }
await doConveyorAI(this); await doConveyorAI(this);
await doSandAI(this); await doSandAI(this);
if(this.lattices.some(lat=>!lat.element))
throw new Error('123')
const doHoneyPotAIResult = await doHoneyPotAI(this); const doHoneyPotAIResult = await doHoneyPotAI(this);
if (doHoneyPotAIResult.length > 0) {//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步 if (doHoneyPotAIResult.length > 0) {//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
doHoneyPotAIResult.forEach((index) => { 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 MainScene from "./MainScene";
import { Element } from "../something/class/Element";
import { Tool } from "../something/Tool"; import { Tool } from "../something/Tool";
const getTargetIndexs = (conveyor: number[]) => { const getTargetIndexs = (conveyor: number[]) => {
...@@ -15,75 +14,75 @@ const getTargetIndexs = (conveyor: number[]) => { ...@@ -15,75 +14,75 @@ const getTargetIndexs = (conveyor: number[]) => {
return list; 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) => { export default async (thisObj: MainScene) => {
//移动了传送带之后,可能会有可消除的,需要检查消除 //移动了传送带之后,可能会有可消除的,需要检查消除
//移动的动画,如果是两头的需要一个带遮罩的动画 //移动的动画,如果是两头的需要一个带遮罩的动画
//检查与其他元素的兼容性 //检查与其他元素的兼容性
const conveyorList = thisObj.chapterData.map.conveyor; 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) { for (const conveyor of conveyorList) {
const list = fillConveyor(conveyor); const list = fillConveyor(conveyor);
const targetIndexs = getTargetIndexs(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); console.log(list, targetIndexs);
const elements = list.map(index => thisObj.lattices[index].element); const elements = list.map(index => thisObj.lattices[index].element);//当前传送带元素
const lattices = list.map(index => thisObj.lattices[index]); const lattices = list.map(index => thisObj.lattices[index]);//当前的lattices
const targetLattices = targetIndexs.map(index => thisObj.lattices[index]); const targetLattices = targetIndexs.map(index => thisObj.lattices[index]);
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); lattices.forEach(lat => lat.element = null);
});
list.forEach((index, i) => { const promiseList: Promise<any>[] = [];
const c = thisObj.conveyorMap[index]; elementsList.forEach((elements, i) => {
const targetP = Tool.getPositionByIndex(targetIndexs[i]); const targetLattices = targetLatticesList[i];
egret.Tween.get(c).to({ x: targetP[0], y: targetP[1] }, 200); const targetIndexs = targetIndexsList[i];
}); const lattices = latticesList[i];
elements.forEach((ele, i) => {
targetLattices[i].element = ele; elements.forEach((ele, eleIndex) => {
const targetP = Tool.getPositionByIndex(targetIndexs[i]); targetLattices[eleIndex].element = ele;
egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 200); 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);
});
// const lat = thisObj.lattices[index]; promiseList.push(promise)
// 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];
// }
}); });
});
// list.forEach(i => { await Promise.all(promiseList);
// 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)
// });
}
} }
\ No newline at end of file
...@@ -229,7 +229,7 @@ export default class MapScene extends Scene { ...@@ -229,7 +229,7 @@ export default class MapScene extends Scene {
const { signInfoVO } = DataManager.ins.getData('getSignInfo'); const { signInfoVO } = DataManager.ins.getData('getSignInfo');
if (signInfoVO && signInfoVO.continueDay < 7) { //表示明天还可以签到 if (signInfoVO && signInfoVO.continueDay < 7) { //表示明天还可以签到
if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) { if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr && getSignBtn()) {
panels.push('sign'); panels.push('sign');
localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr); localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr);
} }
......
...@@ -134,7 +134,7 @@ export default class SignPanel extends Panel { ...@@ -134,7 +134,7 @@ export default class SignPanel extends Panel {
if (notGiftResult) { if (notGiftResult) {
result.push(this.getResultItem(notGiftResult)); result.push(this.getResultItem(notGiftResult));
} else { } else {
result.push({ nums: '惊喜礼盒', type: 'object' }); result.push({ nums: '*1', type: 'object' });
} }
return result; return result;
} }
...@@ -144,7 +144,7 @@ export default class SignPanel extends Panel { ...@@ -144,7 +144,7 @@ export default class SignPanel extends Panel {
getResultItem(option) { getResultItem(option) {
const resultItem: any = {}; const resultItem: any = {};
if (option.categoryType == 2) { if (option.categoryType == 2) {
resultItem.nums = `体力*${option.num}` resultItem.nums = `*${option.num}`
resultItem.type = 'blood'; resultItem.type = 'blood';
} }
else if (option.categoryType == 3) { else if (option.categoryType == 3) {
...@@ -154,8 +154,11 @@ export default class SignPanel extends Panel { ...@@ -154,8 +154,11 @@ export default class SignPanel extends Panel {
} }
else if (option.categoryType == 4) { else if (option.categoryType == 4) {
resultItem.type = 'money'; resultItem.type = 'money';
resultItem.nums = `${option.maxValue}元宝`; if (option.maxValue != option.minValue)
if (option.maxValue != option.minValue) console.warn('元宝配置错误'); resultItem.nums = `*?`;
else
resultItem.nums = `*${option.maxValue}`;
// if (option.maxValue != option.minValue) console.warn('元宝配置错误');
} }
else if (option.categoryType >= 5) { else if (option.categoryType >= 5) {
resultItem.nums = `*1`; resultItem.nums = `*1`;
...@@ -171,7 +174,7 @@ export default class SignPanel extends Panel { ...@@ -171,7 +174,7 @@ export default class SignPanel extends Panel {
if (results.length == 1) { if (results.length == 1) {
result = results[0]; result = results[0];
return result; return result;
}else { } else {
console.warn('配置错误'); console.warn('配置错误');
} }
return null; return null;
......
...@@ -4,7 +4,7 @@ import { ElementType } from "../enum/ElementType"; ...@@ -4,7 +4,7 @@ import { ElementType } from "../enum/ElementType";
//501-525 //501-525
export const Chapters20: ChapterData[] = [ export const Chapters20: ChapterData[] = [
{ {
baseElementTypes: [0, 1, 2, 3,4], baseElementTypes: [0, 1, 2, 3, 4],
bubbleProbability: 0, bubbleProbability: 0,
stepCount: 999, stepCount: 999,
passTarget: { passTarget: {
...@@ -29,14 +29,17 @@ export const Chapters20: ChapterData[] = [ ...@@ -29,14 +29,17 @@ export const Chapters20: ChapterData[] = [
0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
], ],
conveyor:[ conveyor: [
[29,56], // [29,56],
[57,60], // [57,60],
[51,33], [51, 33],
[32,30], [32, 30],
], ],
conveyorConnectedLats:[ conveyorConnectedLats: [
[76,29] // [56,57],
// [60,29],
[33, 32],
[30, 51],
], ],
generateLats: [ generateLats: [
{ index: 11, type: [0], cus: [] }, { index: 11, type: [0], cus: [] },
......
...@@ -97,4 +97,14 @@ export const fillConveyor = (conveyor: number[]) => { ...@@ -97,4 +97,14 @@ export const fillConveyor = (conveyor: number[]) => {
return fillConveyor4(conveyor) return fillConveyor4(conveyor)
} }
return null; 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 @@ ...@@ -84,7 +84,7 @@
"categoryType": 4, "categoryType": 4,
"title": null, "title": null,
"rate": null, "rate": null,
"minValue": 10, "minValue": 0,
"maxValue": 20, "maxValue": 20,
"coinType": 2, "coinType": 2,
"realValue": null, "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