Commit 85193d72 authored by wildfirecode's avatar wildfirecode

1

parent 636b34c7
...@@ -40,7 +40,7 @@ import { Ice } from '../something/class/Ice'; ...@@ -40,7 +40,7 @@ import { Ice } from '../something/class/Ice';
import { Lattice } from '../something/class/Lattice'; import { Lattice } from '../something/class/Lattice';
import { EffectType } from '../something/enum/EffectType'; import { EffectType } from '../something/enum/EffectType';
import { ElementConfigType, createCandy } from '../something/enum/ElementConfigType'; import { ElementConfigType, createCandy } from '../something/enum/ElementConfigType';
import { codeMsgs, ElementType, FiveBaseElementTypes, submitTran } from '../something/enum/ElementType'; import { codeMsgs, ElementType, FiveBaseElementTypes, submitTran, isCandyElement } from '../something/enum/ElementType';
import { isIce, isSpecialLattice } from '../something/enum/LatticeType'; import { isIce, isSpecialLattice } from '../something/enum/LatticeType';
import { PassType } from '../something/enum/PassType'; import { PassType } from '../something/enum/PassType';
import { RecoverName } from '../something/enum/RecoverName'; import { RecoverName } from '../something/enum/RecoverName';
...@@ -2352,6 +2352,12 @@ export default class MainScene extends Scene { ...@@ -2352,6 +2352,12 @@ export default class MainScene extends Scene {
//这里面会去算个数 //这里面会去算个数
this.recoverEle(index) this.recoverEle(index)
} }
//糖果消失特效
else if (isCandyElement(ele.type)) {
this.playAni(RecoverName.ELEDIS_ANI, p)
//这里面会去算个数
this.recoverEle(index)
}
//石头 //石头
else if (ele.type == ElementType.ROCK) { else if (ele.type == ElementType.ROCK) {
this.removeRock(index); this.removeRock(index);
......
import { Element } from "./class/Element"; import { Element } from "./class/Element";
import { Lattice } from "./class/Lattice"; import { Lattice } from "./class/Lattice";
import { ElementType, FiveBaseElementTypes } from "./enum/ElementType"; import { RectMask } from "./class/RectMask";
import { EffectType } from "./enum/EffectType"; import { EffectType } from "./enum/EffectType";
import { Pool } from "./Pool"; import { ElementType, FiveBaseElementTypes, isCandyElement, matchCandy } from "./enum/ElementType";
import { RecoverName } from "./enum/RecoverName"; import { RecoverName } from "./enum/RecoverName";
import { RectMask } from "./class/RectMask"; import { StateType } from "./enum/StateType";
import { FallType } from "./interface/FallAniData"; import { FallType } from "./interface/FallAniData";
import { GenerateLatData } from "./interface/GenerateLatData"; import { GenerateLatData } from "./interface/GenerateLatData";
import { StateType } from "./enum/StateType"; import { Pool } from "./Pool";
//两种,0无棒棒糖,1有 //两种,0无棒棒糖,1有
const offsetYTwo: number[] = []; const offsetYTwo: number[] = [];
...@@ -94,7 +94,7 @@ export class Tool { ...@@ -94,7 +94,7 @@ export class Tool {
*/ */
public static init(isTwo: boolean = false, hasLollipop: boolean = false) { public static init(isTwo: boolean = false, hasLollipop: boolean = false) {
//初始化屏幕尺寸 //初始化屏幕尺寸
if(!offsetYTwo.length)initClientScale(); if (!offsetYTwo.length) initClientScale();
//x的偏移 //x的偏移
var ooox: number = isTwo ? 55 : 15;// 49 : 8.25 var ooox: number = isTwo ? 55 : 15;// 49 : 8.25
var oooy: number = hasLollipop ? offsetYTwo[1] : offsetYTwo[0]; var oooy: number = hasLollipop ? offsetYTwo[1] : offsetYTwo[0];
...@@ -295,7 +295,7 @@ export class Tool { ...@@ -295,7 +295,7 @@ export class Tool {
if (this.judgeFall(lat) && if (this.judgeFall(lat) &&
!lat.element.hasState(StateType.HAIRBALLBLACK) && !lat.element.hasState(StateType.HAIRBALLBLACK) &&
!lat.element.hasState(StateType.HAIRBALLGREY) && !lat.element.hasState(StateType.HAIRBALLGREY) &&
!lat.element.hasState(StateType.HAIRBALLBROWN)&& !lat.element.hasState(StateType.HAIRBALLBROWN) &&
!lat.element.hasState(StateType.BLOCK_LOCK) && !lat.element.hasState(StateType.BLOCK_LOCK) &&
lat.element.type != ElementType.FESTIVALELE_SMALL lat.element.type != ElementType.FESTIVALELE_SMALL
) { ) {
...@@ -311,7 +311,8 @@ export class Tool { ...@@ -311,7 +311,8 @@ export class Tool {
* @param lat * @param lat
*/ */
public static judgeMatch(lat: Lattice) { public static judgeMatch(lat: Lattice) {
if (Tool.judgeBaseEle(lat) && //是基础元素 if (
(Tool.judgeBaseEle(lat) || Tool.judgeCandyEle(lat)) && //是基础元素 or 糖果
lat.element.effectType != EffectType.MAGICLION && //特效不为魔力鸟 lat.element.effectType != EffectType.MAGICLION && //特效不为魔力鸟
!lat.element.hasState(StateType.HAIRBALLGREY) && //不带毛球, 下同 !lat.element.hasState(StateType.HAIRBALLGREY) && //不带毛球, 下同
!lat.element.hasState(StateType.HAIRBALLBLACK) && !lat.element.hasState(StateType.HAIRBALLBLACK) &&
...@@ -357,6 +358,16 @@ export class Tool { ...@@ -357,6 +358,16 @@ export class Tool {
return false return false
} }
public static judgeCandyEle(lat: Lattice) {
if (lat &&
lat.element &&
isCandyElement(lat.element.type) //是糖果元素
) {
return true
}
return false
}
/** /**
* 判断在打乱时,格子上元素是否能移动交换 * 判断在打乱时,格子上元素是否能移动交换
* @param lat 格子 * @param lat 格子
...@@ -797,7 +808,8 @@ export class Tool { ...@@ -797,7 +808,8 @@ export class Tool {
var latC = lattices[cur]; var latC = lattices[cur];
if (Tool.judgeMatch(latP) && if (Tool.judgeMatch(latP) &&
Tool.judgeMatch(latC) && Tool.judgeMatch(latC) &&
latP.element.type == latC.element.type) { (latP.element.type == latC.element.type || matchCandy(latP.element.type, latC.element.type))
) {
result[i].push(cur) result[i].push(cur)
} else { } else {
result[++i] = [cur]; result[++i] = [cur];
......
...@@ -242,7 +242,16 @@ export const Chapters13: ChapterData[] = [ ...@@ -242,7 +242,16 @@ export const Chapters13: ChapterData[] = [
baseElementTypes: [0, 1, 3, 4], baseElementTypes: [0, 1, 3, 4],
bubbleProbability: 0, stepCount: 26, passTarget: { type: 1, elements: [{ type: 10, count: 8 }, { type: 9, count: 65 }] }, starScores: [15000, 20000, 25000], bubbleProbability: 0, stepCount: 26, passTarget: { type: 1, elements: [{ type: 10, count: 8 }, { type: 9, count: 65 }] }, starScores: [15000, 20000, 25000],
map: { map: {
lattices: [3, 0, 0, 3, 3, 3, 0, 0, 3, 0, 61, 3, 3, 3, 3, 3, 61, 0, 0, 3, 6, 3, 3, 3, 6, 3, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 6, 3, 3, 3, 3, 3, 6, 0, 3, 0, 0, 3, 3, 3, 0, 0, 3], lattices: [
3, 0, 0, 3, 3, 3, 0, 0, 3,
0, 61, 3, 3, 3, 3, 3, 61, 0,
0, 3, 6, 3, 3, 3, 6, 3, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3,
0, 3, 3, 3, 3, 3, 3, 3, 0,
0, 6, 3, 3, 3, 3, 3, 6, 0,
3, 0, 0, 3, 3, 3, 0, 0, 3],
connectedLats: [], connectedLats: [],
elements: [ elements: [
1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
...@@ -255,7 +264,16 @@ export const Chapters13: ChapterData[] = [ ...@@ -255,7 +264,16 @@ export const Chapters13: ChapterData[] = [
1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1,
9, 1, 1, 9, 2, 9, 1, 1, 9 9, 1, 1, 9, 2, 9, 1, 1, 9
], ],
baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0],
recycles: [], generateLats: [{ index: 0, type: null }, { index: 3, type: null }, { index: 4, type: null }, { index: 5, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 11, type: null }, { index: 15, type: null }, { index: 16, type: null }] recycles: [], generateLats: [{ index: 0, type: null }, { index: 3, type: null }, { index: 4, type: null }, { index: 5, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 11, type: null }, { index: 15, type: null }, { index: 16, type: null }]
} }
} }
......
...@@ -78,19 +78,19 @@ export const createCandy = (t: ElementConfigType) => { ...@@ -78,19 +78,19 @@ export const createCandy = (t: ElementConfigType) => {
const order = Math.ceil(Math.random() * 5); const order = Math.ceil(Math.random() * 5);
switch (order) { switch (order) {
case 1: case 1:
type = ElementType.CANDY1 type = ElementType.CANDY_RABBIT
break; break;
case 2: case 2:
type = ElementType.CANDY2 type = ElementType.CANDY_CHICKEN
break; break;
case 3: case 3:
type = ElementType.CANDY3 type = ElementType.CANDY_CATTLE
break; break;
case 4: case 4:
type = ElementType.CANDY4 type = ElementType.CANDY_LION
break; break;
case 5: case 5:
type = ElementType.CANDY5 type = ElementType.CANDY_PIG
break; break;
default: default:
...@@ -98,19 +98,19 @@ export const createCandy = (t: ElementConfigType) => { ...@@ -98,19 +98,19 @@ export const createCandy = (t: ElementConfigType) => {
} }
} }
else if (t == ElementConfigType.CANDY_1) { else if (t == ElementConfigType.CANDY_1) {
type = ElementType.CANDY1; type = ElementType.CANDY_RABBIT;
} }
else if (t == ElementConfigType.CANDY_2) { else if (t == ElementConfigType.CANDY_2) {
type = ElementType.CANDY2; type = ElementType.CANDY_CHICKEN;
} }
else if (t == ElementConfigType.CANDY_3) { else if (t == ElementConfigType.CANDY_3) {
type = ElementType.CANDY3; type = ElementType.CANDY_CATTLE;
} }
else if (t == ElementConfigType.CANDY_4) { else if (t == ElementConfigType.CANDY_4) {
type = ElementType.CANDY4; type = ElementType.CANDY_LION;
} }
else if (t == ElementConfigType.CANDY_5) { else if (t == ElementConfigType.CANDY_5) {
type = ElementType.CANDY5; type = ElementType.CANDY_PIG;
}; };
return type; return type;
} }
\ No newline at end of file
...@@ -30,19 +30,27 @@ export enum ElementType { ...@@ -30,19 +30,27 @@ export enum ElementType {
FESTIVALELE_BIG, //节日元素大中间一个13 FESTIVALELE_BIG, //节日元素大中间一个13
FESTIVALELE_SMALL, //节日元素飞溅的小元素14 FESTIVALELE_SMALL, //节日元素飞溅的小元素14
CANDY1, CANDY_RABBIT,//兔子
CANDY2, CANDY_CHICKEN,//鸟
CANDY3, CANDY_CATTLE,//牛
CANDY4, CANDY_LION,//狮子
CANDY5, CANDY_PIG,//猪
} }
export const isCandyElement=(t:ElementType)=>{ export const isCandyElement=(t:ElementType)=>{
return t == ElementType.CANDY1 || return t == ElementType.CANDY_RABBIT ||
t == ElementType.CANDY2 || t == ElementType.CANDY_CHICKEN ||
t == ElementType.CANDY3 || t == ElementType.CANDY_CATTLE ||
t == ElementType.CANDY4 || t == ElementType.CANDY_LION ||
t == ElementType.CANDY5 t == ElementType.CANDY_PIG
};
export const matchCandy=(a:ElementType,b:ElementType,)=>{
return (a==ElementType.CANDY_RABBIT && b== ElementType.RABBIT) ||
(a==ElementType.CANDY_CHICKEN && b== ElementType.CHICKEN) ||
(a==ElementType.CANDY_CATTLE && b== ElementType.CATTLE) ||
(a==ElementType.CANDY_LION && b== ElementType.LION) ||
(a==ElementType.CANDY_PIG && b== ElementType.PIG)
}; };
/** /**
......
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