Commit 8a5ee75a authored by wildfirecode's avatar wildfirecode

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

parents e30311d9 e5f98ab7
......@@ -1282,21 +1282,40 @@ export default class MainScene extends Scene {
var rc = Tool.indexToRc(index);
var p = Tool.getPositionByIndex(index);
this.playAni(RecoverName.CROSS_ANI, p);
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) && (lat.row == rc[0] || lat.column == rc[1])) {
if (this.eliminatedElements.indexOf(i) == -1) {
this.eliminatedElements.push(i);
if (this.lattices[i].element.type == ElementType.FISH) {
this.lattices[i].element.nextFishState();
}
if (Tool.judgeHasScore(lat.element)) {
// for (var i = 0; i < this.lattices.length; i++) {
// var lat = this.lattices[i];
// if (Tool.judgeEliminate(lat) && (lat.row == rc[0] || lat.column == rc[1])) {
// if (this.eliminatedElements.indexOf(i) == -1) {
// this.eliminatedElements.push(i);
// if (this.lattices[i].element.type == ElementType.FISH) {
// this.lattices[i].element.nextFishState();
// }
// if (Tool.judgeHasScore(lat.element)) {
// //算直线+直线LL
// this.pushScoreAni(baseScore * 1 * effectBaseTimes.LL, Tool.getPositionByIndex(i))
// }
// }
// }
// }
//新增石头阻挡
var elimitarr = this.getEliPassCannoStone(rc[0],rc[1]);
for(var j=0;j<elimitarr.length;j++){
var jelidx = elimitarr[j];
var jlat = this.lattices[jelidx];
if(this.eliminatedElements.indexOf(jelidx)==-1){
this.eliminatedElements.push(jelidx);
if(jlat.element.type == ElementType.FISH){
jlat.element.nextFishState();
}
if(Tool.judgeHasScore(jlat.element)){
//算直线+直线LL
this.pushScoreAni(baseScore * 1 * effectBaseTimes.LL, Tool.getPositionByIndex(i))
}
this.pushScoreAni(baseScore * 1 * effectBaseTimes.LL, Tool.getPositionByIndex(jelidx))
}
}
}
setTimeout(() => {
this._converyorTag = true;
this.eliminate();
......@@ -1334,6 +1353,77 @@ export default class MainScene extends Scene {
}
}, prop)
}
//横向消除,不包括炮台石头
getEliHorPassCannoStone(row:number,col:number){
var elimitarr:number[] = new Array();
//向左
for(var i=col;i>=0;i--){
var iemitidx = Tool.rcToIndex(row,i);
var lat = this.lattices[iemitidx];
var caneliminate = Tool.judgeEliminate(lat);
var iscannoblock = Tool.judgeIscannoBlock(lat);
if(caneliminate){
elimitarr.push(iemitidx);
}
if(iscannoblock){
break;
}
}
//向右
for(var i=col;i<Tool.colNum;i++){
var iemitidx = Tool.rcToIndex(row,i);
var lat = this.lattices[iemitidx];
var caneliminate = Tool.judgeEliminate(lat);
var iscannoblock = Tool.judgeIscannoBlock(lat);
if(caneliminate){
elimitarr.push(iemitidx);
}
if(iscannoblock){
break;
}
}
return elimitarr;
}
//竖向消除,不包括炮台石头
getEliVerPassCannoStone(row:number,col:number){
var elimitarr:number[] = new Array();
//向上
for(var i=row;i>=0;i--){
var iemitidx = Tool.rcToIndex(i,col);
var lat = this.lattices[iemitidx];
var caneliminate = Tool.judgeEliminate(lat);
var iscannoblock = Tool.judgeIscannoBlock(lat);
if(caneliminate){
elimitarr.push(iemitidx);
}
if(iscannoblock){
break;
}
}
//向下
for(var i=row;i<Tool.rowNum;i++){
var iemitidx = Tool.rcToIndex(i,col);
var lat = this.lattices[iemitidx];
var caneliminate = Tool.judgeEliminate(lat);
var iscannoblock = Tool.judgeIscannoBlock(lat);
if(caneliminate){
elimitarr.push(iemitidx);
}
if(iscannoblock){
break;
}
}
return elimitarr;
}
//一般横向竖向消除,不过炮台石头
getEliPassCannoStone(row:number,col:number){
var elimitarr:number[] = new Array();
var elimitarrhor = this.getEliHorPassCannoStone(row,col);
var elimitarrver = this.getEliVerPassCannoStone(row,col);
elimitarr.push(...elimitarrhor);
elimitarr.push(...elimitarrver);
return elimitarr;
}
mouseDownE(e: egret.TextEvent) {
// if (!this.enableTouch) return
......@@ -2509,19 +2599,37 @@ export default class MainScene extends Scene {
this.recoverEle(one)
this.recoverEle(two)
//添加消除元素two,同行或同列
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) && (lat.row == lat1.row || lat.column == lat1.column)) {
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
if (this.lattices[i].element.type == ElementType.FISH) {
this.lattices[i].element.nextFishState();
}
if (Tool.judgeHasScore(lat.element)) {
// for (var i = 0; i < this.lattices.length; i++) {
// var lat = this.lattices[i];
// if (Tool.judgeEliminate(lat) && (lat.row == lat1.row || lat.column == lat1.column)) {
// if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
// if (this.lattices[i].element.type == ElementType.FISH) {
// this.lattices[i].element.nextFishState();
// }
// if (Tool.judgeHasScore(lat.element)) {
// //线与线
// this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.LL, Tool.getPositionByIndex(i))
// }
// }
// }
//新增石头阻挡
var elimitarr = this.getEliPassCannoStone(lat1.row,lat1.column);
for(var j=0;j<elimitarr.length;j++){
var jelidx = elimitarr[j];
var jlat = this.lattices[jelidx];
if(this.eliminatedElements.indexOf(jelidx)==-1){
this.eliminatedElements.push(jelidx);
if(jlat.element.type == ElementType.FISH){
jlat.element.nextFishState();
}
if(Tool.judgeHasScore(jlat.element)){
//线与线
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.LL, Tool.getPositionByIndex(i))
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.LL, Tool.getPositionByIndex(jelidx));
}
}
}
}
//一个方向,一个爆炸
else if ((ele1.effectType < 2 || ele2.effectType < 2) &&
......@@ -2858,18 +2966,33 @@ export default class MainScene extends Scene {
//动画移除自己
this.playAni(RecoverName.HORIZONTAL_ANI, p);
this.recoverEle(index);
for (var i = 0; i < Tool.colNum; i++) {
var ein = Tool.rcToIndex(row, i);
if (Tool.judgeEliminate(this.lattices[ein])) {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein);
if (this.lattices[ein].element.type == ElementType.FISH) {
this.lattices[ein].element.nextFishState();
}
//加分
if (Tool.judgeHasScore(this.lattices[ein].element)) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["0"], Tool.getPositionByIndex(ein))
// for (var i = 0; i < Tool.colNum; i++) {
// var ein = Tool.rcToIndex(row, i);
// if (Tool.judgeEliminate(this.lattices[ein])) {
// if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
// this.eliminatedElements.push(ein);
// if (this.lattices[ein].element.type == ElementType.FISH) {
// this.lattices[ein].element.nextFishState();
// }
// //加分
// if (Tool.judgeHasScore(this.lattices[ein].element)) {
// this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["0"], Tool.getPositionByIndex(ein))
// }
// }
// }
// }
//新增石头阻挡
var elimitarr = this.getEliHorPassCannoStone(row,lat.column);
for(var j=0;j<elimitarr.length;j++){
var jelidx = elimitarr[j];
var jlat = this.lattices[jelidx];
if(this.eliminatedElements.indexOf(jelidx)==-1&&effectIndexs.indexOf(jelidx)==-1){
this.eliminatedElements.push(jelidx);
if(jlat.element.type==ElementType.FISH){
jlat.element.nextFishState();
}
if(Tool.judgeHasScore(jlat.element)){
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["0"], Tool.getPositionByIndex(jelidx));
}
}
}
......@@ -2880,18 +3003,32 @@ export default class MainScene extends Scene {
//动画移除自己
this.playAni(RecoverName.VERTICAL_ANI, p);
this.recoverEle(index);
for (var i = 0; i < Tool.rowNum; i++) {
var ein = Tool.rcToIndex(i, col);
if (Tool.judgeEliminate(this.lattices[ein])) {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein);
if (this.lattices[ein].element.type == ElementType.FISH) {
this.lattices[ein].element.nextFishState();
}
//加分
if (Tool.judgeHasScore(this.lattices[ein].element)) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["1"], Tool.getPositionByIndex(ein))
}
// for (var i = 0; i < Tool.rowNum; i++) {
// var ein = Tool.rcToIndex(i, col);
// if (Tool.judgeEliminate(this.lattices[ein])) {
// if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
// this.eliminatedElements.push(ein);
// if (this.lattices[ein].element.type == ElementType.FISH) {
// this.lattices[ein].element.nextFishState();
// }
// //加分
// if (Tool.judgeHasScore(this.lattices[ein].element)) {
// this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["1"], Tool.getPositionByIndex(ein))
// }
// }
// }
// }
var elimitarr = this.getEliVerPassCannoStone(lat.row,col);
for(var j=0;j<elimitarr.length;j++){
var jelidx = elimitarr[j];
var jlat = this.lattices[jelidx];
if(this.eliminatedElements.indexOf(jelidx)==-1&&effectIndexs.indexOf(jelidx)==-1){
this.eliminatedElements.push(jelidx);
if(jlat.element.type==ElementType.FISH){
jlat.element.nextFishState();
}
if(Tool.judgeHasScore(jlat.element)){
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["1"], Tool.getPositionByIndex(jelidx));
}
}
}
......
......@@ -219,7 +219,7 @@ export class Element extends eui.Component {
}
changeShowCannoStat(){
this.cannolab.text = this._cannoStat+"";
this.cannoMoveClip.gotoAndPlay(this.cannoStat[this._cannoStat]);
this.cannoMoveClip&&this.cannoMoveClip.gotoAndPlay(this.cannoStat[this._cannoStat]);
}
checkCannoStat(){
if(this._cannoStat==3){
......@@ -511,7 +511,7 @@ export class Element extends eui.Component {
listenCn(){
var statend = this.cannoStat[this._cannoStat+1];
if(this.cannoMoveClip.currentFrame>=statend){
console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame);
// console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame);
this.cannoMoveClip.stop();
}
}
......
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