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 {
}
await
doConveyorAI
(
this
);
await
doSandAI
(
this
);
if
(
this
.
lattices
.
some
(
lat
=>!
lat
.
element
))
throw
new
Error
(
'123'
)
const
doHoneyPotAIResult
=
await
doHoneyPotAI
(
this
);
if
(
doHoneyPotAIResult
.
length
>
0
)
{
//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
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
{
Element
}
from
"../something/class/Element"
;
import
{
Tool
}
from
"../something/Tool"
;
const
getTargetIndexs
=
(
conveyor
:
number
[])
=>
{
...
...
@@ -15,75 +14,75 @@ const getTargetIndexs = (conveyor: number[]) => {
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
)
=>
{
//移动了传送带之后,可能会有可消除的,需要检查消除
//移动的动画,如果是两头的需要一个带遮罩的动画
//检查与其他元素的兼容性
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
)
{
const
list
=
fillConveyor
(
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
);
const
elements
=
list
.
map
(
index
=>
thisObj
.
lattices
[
index
].
element
);
const
lattices
=
list
.
map
(
index
=>
thisObj
.
lattices
[
index
]);
const
elements
=
list
.
map
(
index
=>
thisObj
.
lattices
[
index
].
element
);
//当前传送带元素
const
lattices
=
list
.
map
(
index
=>
thisObj
.
lattices
[
index
]);
//当前的lattices
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
);
});
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
);
const
promiseList
:
Promise
<
any
>
[]
=
[];
elementsList
.
forEach
((
elements
,
i
)
=>
{
const
targetLattices
=
targetLatticesList
[
i
]
;
const
targetIndexs
=
targetIndexsList
[
i
]
;
const
lattices
=
latticesList
[
i
]
;
elements
.
forEach
((
ele
,
eleIndex
)
=>
{
targetLattices
[
eleIndex
].
element
=
ele
;
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];
// 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];
// }
promiseList
.
push
(
promise
)
});
});
// list.forEach(i => {
// 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)
// });
}
await
Promise
.
all
(
promiseList
);
}
\ No newline at end of file
egret/src/mapScene/MapScene.ts
View file @
799b7543
...
...
@@ -229,7 +229,7 @@ export default class MapScene extends Scene {
const
{
signInfoVO
}
=
DataManager
.
ins
.
getData
(
'getSignInfo'
);
if
(
signInfoVO
&&
signInfoVO
.
continueDay
<
7
)
{
//表示明天还可以签到
if
(
signInfoVO
.
todaySigned
==
0
&&
oldTimerStr
!=
nowTimerStr
)
{
if
(
signInfoVO
.
todaySigned
==
0
&&
oldTimerStr
!=
nowTimerStr
&&
getSignBtn
()
)
{
panels
.
push
(
'sign'
);
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 {
if
(
notGiftResult
)
{
result
.
push
(
this
.
getResultItem
(
notGiftResult
));
}
else
{
result
.
push
({
nums
:
'
惊喜礼盒
'
,
type
:
'object'
});
result
.
push
({
nums
:
'
*1
'
,
type
:
'object'
});
}
return
result
;
}
...
...
@@ -144,7 +144,7 @@ export default class SignPanel extends Panel {
getResultItem
(
option
)
{
const
resultItem
:
any
=
{};
if
(
option
.
categoryType
==
2
)
{
resultItem
.
nums
=
`
体力
*
${
option
.
num
}
`
resultItem
.
nums
=
`*
${
option
.
num
}
`
resultItem
.
type
=
'blood'
;
}
else
if
(
option
.
categoryType
==
3
)
{
...
...
@@ -154,8 +154,11 @@ export default class SignPanel extends Panel {
}
else
if
(
option
.
categoryType
==
4
)
{
resultItem
.
type
=
'money'
;
resultItem
.
nums
=
`
${
option
.
maxValue
}
元宝`
;
if
(
option
.
maxValue
!=
option
.
minValue
)
console
.
warn
(
'元宝配置错误'
);
if
(
option
.
maxValue
!=
option
.
minValue
)
resultItem
.
nums
=
`*?`
;
else
resultItem
.
nums
=
`*
${
option
.
maxValue
}
`
;
// if (option.maxValue != option.minValue) console.warn('元宝配置错误');
}
else
if
(
option
.
categoryType
>=
5
)
{
resultItem
.
nums
=
`*1`
;
...
...
@@ -171,7 +174,7 @@ export default class SignPanel extends Panel {
if
(
results
.
length
==
1
)
{
result
=
results
[
0
];
return
result
;
}
else
{
}
else
{
console
.
warn
(
'配置错误'
);
}
return
null
;
...
...
egret/src/something/chapters/Chapter20.ts
View file @
799b7543
...
...
@@ -4,7 +4,7 @@ import { ElementType } from "../enum/ElementType";
//501-525
export
const
Chapters20
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
999
,
passTarget
:
{
...
...
@@ -29,14 +29,17 @@ export const Chapters20: ChapterData[] = [
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
conveyor
:[
[
29
,
56
],
[
57
,
60
],
[
51
,
33
],
[
32
,
30
],
conveyor
:
[
//
[29,56],
//
[57,60],
[
51
,
33
],
[
32
,
30
],
],
conveyorConnectedLats
:[
[
76
,
29
]
conveyorConnectedLats
:
[
// [56,57],
// [60,29],
[
33
,
32
],
[
30
,
51
],
],
generateLats
:
[
{
index
:
11
,
type
:
[
0
],
cus
:
[]
},
...
...
egret/src/something/conveyor/conveyorTool.ts
View file @
799b7543
...
...
@@ -97,4 +97,14 @@ export const fillConveyor = (conveyor: number[]) => {
return
fillConveyor4
(
conveyor
)
}
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 @@
"categoryType"
:
4
,
"title"
:
null
,
"rate"
:
null
,
"minValue"
:
1
0
,
"minValue"
:
0
,
"maxValue"
:
20
,
"coinType"
:
2
,
"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