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
799b7543
Commit
799b7543
authored
Mar 09, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
06022a7a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
72 deletions
+90
-72
preload.tmproject
egret/resource/TextureMerger/preload.tmproject
+1
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+2
-0
doConveyorAI.ts
egret/src/mainScene/doConveyorAI.ts
+56
-57
MapScene.ts
egret/src/mapScene/MapScene.ts
+1
-1
SignPanel.ts
egret/src/panels/SignPanel.ts
+8
-5
Chapter20.ts
egret/src/something/chapters/Chapter20.ts
+11
-8
conveyorTool.ts
egret/src/something/conveyor/conveyorTool.ts
+10
-0
getSignConfig.json
mock/happyclear/getSignConfig.json
+1
-1
No files found.
egret/resource/TextureMerger/preload.tmproject
0 → 100644
View file @
799b7543
{"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
egret/src/mainScene/MainScene.ts
View file @
799b7543
...
@@ -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
)
=>
{
...
...
egret/src/mainScene/doConveyorAI.ts
View file @
799b7543
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
egret/src/mapScene/MapScene.ts
View file @
799b7543
...
@@ -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
);
}
}
...
...
egret/src/panels/SignPanel.ts
View file @
799b7543
...
@@ -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
;
...
...
egret/src/something/chapters/Chapter20.ts
View file @
799b7543
...
@@ -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
:
[]
},
...
...
egret/src/something/conveyor/conveyorTool.ts
View file @
799b7543
...
@@ -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
mock/happyclear/getSignConfig.json
View file @
799b7543
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
"categoryType"
:
4
,
"categoryType"
:
4
,
"title"
:
null
,
"title"
:
null
,
"rate"
:
null
,
"rate"
:
null
,
"minValue"
:
1
0
,
"minValue"
:
0
,
"maxValue"
:
20
,
"maxValue"
:
20
,
"coinType"
:
2
,
"coinType"
:
2
,
"realValue"
:
null
,
"realValue"
:
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