Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
e7adeb9c
Commit
e7adeb9c
authored
Mar 26, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整炮台逻辑
parent
7062d043
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
57 deletions
+106
-57
MainScene.ts
egret/src/mainScene/MainScene.ts
+3
-2
Tool.ts
egret/src/something/Tool.ts
+15
-0
Chapter22.ts
egret/src/something/chapters/Chapter22.ts
+88
-55
No files found.
egret/src/mainScene/MainScene.ts
View file @
e7adeb9c
...
@@ -2320,12 +2320,13 @@ export default class MainScene extends Scene {
...
@@ -2320,12 +2320,13 @@ export default class MainScene extends Scene {
var
jemitidx
=
cannoFireArr
[
j
];
var
jemitidx
=
cannoFireArr
[
j
];
var
lat
=
this
.
lattices
[
jemitidx
];
var
lat
=
this
.
lattices
[
jemitidx
];
var
caneliminate
=
Tool
.
judgeEliminate
(
lat
);
var
caneliminate
=
Tool
.
judgeEliminate
(
lat
);
if
(
lat
&&
(
caneliminate
||
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
)){
var
iscannoblock
=
Tool
.
judgeIscannoBlock
(
lat
);
if
(
lat
&&
(
caneliminate
||
iscannoblock
)){
if
(
this
.
eliminatedElements
.
indexOf
(
jemitidx
)
==-
1
){
if
(
this
.
eliminatedElements
.
indexOf
(
jemitidx
)
==-
1
){
this
.
eliminatedElements
.
push
(
jemitidx
);
this
.
eliminatedElements
.
push
(
jemitidx
);
}
}
//加分
//加分
if
(
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
){
if
(
iscannoblock
){
// console.log("炮台石头消除");
// console.log("炮台石头消除");
break
;
break
;
}
}
...
...
egret/src/something/Tool.ts
View file @
e7adeb9c
...
@@ -372,6 +372,21 @@ export class Tool {
...
@@ -372,6 +372,21 @@ export class Tool {
return
true
return
true
}
}
}
}
/**
* 判断是否是炮台石头
* @param lat
*/
public
static
judgeIscannoBlock
(
lat
:
Lattice
){
if
(
!
lat
||!
lat
.
element
){
return
false
;
}
else
if
(
lat
.
element
.
type
==
ElementType
.
CANNO_BLOCK
){
return
true
;
}
else
{
return
false
;
}
}
/**
/**
* 判断格子上是基础元素,包括各种状态的
* 判断格子上是基础元素,包括各种状态的
...
...
egret/src/something/chapters/Chapter22.ts
View file @
e7adeb9c
...
@@ -6,59 +6,92 @@ import { ElementType } from "../enum/ElementType";
...
@@ -6,59 +6,92 @@ import { ElementType } from "../enum/ElementType";
export
const
Chapters22
:
ChapterData
[]
=
[
export
const
Chapters22
:
ChapterData
[]
=
[
//551
//551
{
{
baseElementTypes
:
[
0
,
1
,
2
,
3
],
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
bubbleProbability
:
0
,
stepCount
:
25
,
stepCount
:
35
,
passTarget
:
{
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
type
:
1
,
elements
:
[
elements
:
[{
{
type
:
1
,
type
:
ElementType
.
CHICKEN
,
count
:
155
count
:
45
,
},
{
},
type
:
34
,
],
count
:
15
},
}]
starScores
:
[
1000
,
5000
,
10000
],
},
map
:
{
starScores
:
[
15000
,
20000
,
25000
],
lattices
:
[
map
:
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
lattices
:
[
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1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
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
1
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
}]
}
}
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment