Commit 85193d72 authored by wildfirecode's avatar wildfirecode

1

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