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
f14b20bc
Commit
f14b20bc
authored
Nov 07, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole
into dev
parents
70d6d9a1
f8629686
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
406 additions
and
118 deletions
+406
-118
exml.json
egret/.wing/exml.json
+4
-0
NoPrizePanel.ts
egret/libs/new_wx/components/NoPrizePanel.ts
+6
-13
PrizePanel.ts
egret/libs/new_wx/components/PrizePanel.ts
+11
-6
common_money.png
egret/resource/assets/common/common_money.png
+0
-0
擦肩而过弹窗 .png
egret/resource/assets/nprize/擦肩而过弹窗 .png
+0
-0
NoPrizeSkin.exml
egret/resource/skins/NoPrizeSkin.exml
+11
-10
PrizeSkin.exml
egret/resource/skins/PrizeSkin.exml
+5
-4
MainScene.ts
egret/src/mainScene/MainScene.ts
+92
-69
MagicRotateAni.ts
egret/src/something/anis/MagicRotateAni.ts
+2
-2
FesRedShootAni.ts
egret/src/something/anisCall/FesRedShootAni.ts
+128
-0
Chapter6.ts
egret/src/something/chapters/Chapter6.ts
+10
-10
Chapter8.ts
egret/src/something/chapters/Chapter8.ts
+1
-1
RecoverName.ts
egret/src/something/enum/RecoverName.ts
+2
-0
AiControl.ts
egret/src/something/logic/AiControl.ts
+132
-1
submit.json
mock/happyclear/submit.json
+2
-2
No files found.
egret/.wing/exml.json
View file @
f14b20bc
...
@@ -119,6 +119,10 @@
...
@@ -119,6 +119,10 @@
{
{
"key"
:
"data.url"
,
"key"
:
"data.url"
,
"value"
:
"common_prop3_png"
"value"
:
"common_prop3_png"
},
{
"key"
:
"data.url2"
,
"value"
:
"common_prop3_png"
}
}
]
]
},
},
...
...
egret/libs/new_wx/components/NoPrizePanel.ts
View file @
f14b20bc
...
@@ -2,7 +2,7 @@ import getShowOffPic from "../../../src/getShowOffPic";
...
@@ -2,7 +2,7 @@ import getShowOffPic from "../../../src/getShowOffPic";
import
{
iswx
}
from
"../../../src/iswx"
;
import
{
iswx
}
from
"../../../src/iswx"
;
import
{
getlogItem
}
from
"../../../src/Main"
;
import
{
getlogItem
}
from
"../../../src/Main"
;
import
{
addRankFriendList
}
from
"../../../src/mapScene/RankFriendList"
;
import
{
addRankFriendList
}
from
"../../../src/mapScene/RankFriendList"
;
import
setGray
from
"../../../src/setGray"
;
import
{
showShare
}
from
"../../../src/shareCtrl"
;
import
{
showShare
}
from
"../../../src/shareCtrl"
;
import
{
changeMapScene
}
from
"../../../src/startScene/StartScene"
;
import
{
changeMapScene
}
from
"../../../src/startScene/StartScene"
;
import
wait
from
"../../new_tc/wait"
;
import
wait
from
"../../new_tc/wait"
;
...
@@ -13,10 +13,8 @@ export default class NoPrizePanel extends Panel {
...
@@ -13,10 +13,8 @@ export default class NoPrizePanel extends Panel {
_level
;
_level
;
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
setGray
(
this
[
'pica'
]);
setGray
(
this
[
'picb'
]);
setGray
(
this
[
'picc'
]);
this
.
_level
=
parseInt
(
data
.
level
+
''
);
this
.
_level
=
parseInt
(
data
.
level
+
''
);
this
[
'lvTxt'
].
text
=
`关卡
${
this
.
_level
}
`
this
[
'shareBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
[
'shareBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
16
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
16
));
if
(
iswx
())
{
if
(
iswx
())
{
...
@@ -38,8 +36,7 @@ export default class NoPrizePanel extends Panel {
...
@@ -38,8 +36,7 @@ export default class NoPrizePanel extends Panel {
changeMapScene
();
changeMapScene
();
},
this
);
},
this
);
addRankFriendList
(
84
,
735.52
,
this
);
addRankFriendList
(
84
,
917.46
,
this
);
}
}
showlog
()
{
showlog
()
{
...
@@ -49,10 +46,6 @@ export default class NoPrizePanel extends Panel {
...
@@ -49,10 +46,6 @@ export default class NoPrizePanel extends Panel {
onTouchTap_closeBtn
()
{
onTouchTap_closeBtn
()
{
super
.
onTouchTap_closeBtn
();
super
.
onTouchTap_closeBtn
();
changeMapScene
();
changeMapScene
();
// if (this._level + 1 <= 70)
// SceneCtrl.instance.change(ModuleTypes.START_SCENE, { level: this._level + 1 });
// else
// SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
...
@@ -79,7 +72,7 @@ export default class NoPrizePanel extends Panel {
...
@@ -79,7 +72,7 @@ export default class NoPrizePanel extends Panel {
await
this
.
playAni3
();
await
this
.
playAni3
();
}
}
if
(
nums
>=
1
)
{
if
(
nums
>=
1
)
{
this
[
'light'
].
visible
=
tru
e
;
this
[
'light'
].
visible
=
fals
e
;
egret
.
Tween
.
get
(
this
[
'light'
]).
set
({
scaleX
:
0
,
scaleY
:
0
,
alpha
:
0
,
}).
to
({
scaleX
:
1
,
scaleY
:
1
,
alpha
:
1
},
300
).
call
(()
=>
{
egret
.
Tween
.
get
(
this
[
'light'
]).
set
({
scaleX
:
0
,
scaleY
:
0
,
alpha
:
0
,
}).
to
({
scaleX
:
1
,
scaleY
:
1
,
alpha
:
1
},
300
).
call
(()
=>
{
egret
.
Tween
.
get
(
this
[
'light'
],
{
loop
:
true
}).
to
({
rotation
:
360
},
3000
);
egret
.
Tween
.
get
(
this
[
'light'
],
{
loop
:
true
}).
to
({
rotation
:
360
},
3000
);
});
});
...
@@ -88,7 +81,7 @@ export default class NoPrizePanel extends Panel {
...
@@ -88,7 +81,7 @@ export default class NoPrizePanel extends Panel {
async
playAni1
()
{
async
playAni1
()
{
return
new
Promise
(
r
=>
{
return
new
Promise
(
r
=>
{
egret
.
Tween
.
get
(
this
[
'pic1'
]).
set
({
scaleX
:
0
,
scaleY
:
0
}).
to
({
scaleX
:
1
,
scaleY
:
1
},
400
,
egret
.
Ease
.
getBackOut
(
1
)).
call
(
r
)
egret
.
Tween
.
get
(
this
[
'pic1'
]).
set
({
scaleX
:
0
,
scaleY
:
0
}).
to
({
scaleX
:
-
1
,
scaleY
:
1
},
400
,
egret
.
Ease
.
getBackOut
(
1
)).
call
(
r
)
})
})
}
}
async
playAni2
()
{
async
playAni2
()
{
...
@@ -98,7 +91,7 @@ export default class NoPrizePanel extends Panel {
...
@@ -98,7 +91,7 @@ export default class NoPrizePanel extends Panel {
}
}
async
playAni3
()
{
async
playAni3
()
{
return
new
Promise
(
r
=>
{
return
new
Promise
(
r
=>
{
egret
.
Tween
.
get
(
this
[
'pic3'
]).
set
({
scaleX
:
0
,
scaleY
:
0
}).
to
({
scaleX
:
-
1
,
scaleY
:
1
},
400
,
egret
.
Ease
.
getBackOut
(
1
)).
call
(
r
)
egret
.
Tween
.
get
(
this
[
'pic3'
]).
set
({
scaleX
:
0
,
scaleY
:
0
}).
to
({
scaleX
:
1
,
scaleY
:
1
},
400
,
egret
.
Ease
.
getBackOut
(
1
)).
call
(
r
)
})
})
}
}
destroy
()
{
destroy
()
{
...
...
egret/libs/new_wx/components/PrizePanel.ts
View file @
f14b20bc
...
@@ -15,8 +15,11 @@ export default class PrizePanel extends Panel {
...
@@ -15,8 +15,11 @@ export default class PrizePanel extends Panel {
const
{
categoryType
,
img
,
num
,
propType
,
realValue
}
=
option
;
// 2次数 3道具 4元宝 5实物 6优惠券 7虚拟商品
const
{
categoryType
,
img
,
num
,
propType
,
realValue
}
=
option
;
// 2次数 3道具 4元宝 5实物 6优惠券 7虚拟商品
this
[
'propnums'
].
text
=
'x1'
;
this
[
'propnums'
].
text
=
'x1'
;
if
(
num
)
this
[
'propnums2'
].
text
=
'x1'
;
if
(
num
){
this
[
'propnums'
].
text
=
'x'
+
num
;
this
[
'propnums'
].
text
=
'x'
+
num
;
this
[
'propnums2'
].
text
=
'x'
+
num
;
}
switch
(
categoryType
)
{
switch
(
categoryType
)
{
case
2
:
case
2
:
this
[
'blood'
].
visible
=
true
;
this
[
'blood'
].
visible
=
true
;
...
@@ -24,13 +27,14 @@ export default class PrizePanel extends Panel {
...
@@ -24,13 +27,14 @@ export default class PrizePanel extends Panel {
break
;
break
;
case
3
:
case
3
:
this
[
'numsgroup'
].
visible
=
true
;
this
[
'numsgroup'
].
visible
=
true
;
this
[
'img'
].
visible
=
true
;
this
[
'img
2
'
].
visible
=
true
;
this
.
data
.
url
=
`turnprize_icon
${
propType
}
_png`
;
this
.
data
.
url
2
=
`common_prop
${
propType
}
_png`
;
break
;
break
;
case
4
:
case
4
:
this
[
'numsgroup'
].
visible
=
true
;
this
[
'numsgroup'
].
visible
=
false
;
this
[
'propnums2'
].
visible
=
true
;
this
[
'money'
].
visible
=
true
;
this
[
'money'
].
visible
=
true
;
this
[
'propnums
'
].
text
=
'x'
+
realValue
;
this
[
'propnums
2'
].
text
=
realValue
;
break
;
break
;
default
:
default
:
this
[
'img'
].
visible
=
true
;
this
[
'img'
].
visible
=
true
;
...
@@ -42,6 +46,7 @@ export default class PrizePanel extends Panel {
...
@@ -42,6 +46,7 @@ export default class PrizePanel extends Panel {
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
this
.
_level
=
parseInt
(
data
.
level
+
''
);
this
.
_level
=
parseInt
(
data
.
level
+
''
);
this
[
'lvTxt'
].
text
=
`关卡
${
this
.
_level
}
`
this
.
updateOption
(
data
.
option
);
this
.
updateOption
(
data
.
option
);
...
@@ -66,7 +71,7 @@ export default class PrizePanel extends Panel {
...
@@ -66,7 +71,7 @@ export default class PrizePanel extends Panel {
this
.
setStar
(
hc_submitData
.
stars
);
this
.
setStar
(
hc_submitData
.
stars
);
addRankFriendList
(
84
,
8
6
9.74
,
this
);
addRankFriendList
(
84
,
8
8
9.74
,
this
);
}
}
showlog
()
{
showlog
()
{
...
...
egret/resource/assets/common/common_money.png
View replaced file @
70d6d9a1
View file @
f14b20bc
45.7 KB
|
W:
|
H:
42.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
egret/resource/assets/nprize/擦肩而过弹窗 .png
View replaced file @
70d6d9a1
View file @
f14b20bc
122 KB
|
W:
|
H:
227 KB
|
W:
|
H:
2-up
Swipe
Onion skin
egret/resource/skins/NoPrizeSkin.exml
View file @
f14b20bc
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"NoPrizeSkin"
width=
"750"
height=
"1000"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Skin
class=
"NoPrizeSkin"
width=
"750"
height=
"1000"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Component
y=
"
735.52
"
skinName=
"ADSmallSkin"
x=
"84"
visible=
"false"
/>
<e:Component
y=
"
917.46
"
skinName=
"ADSmallSkin"
x=
"84"
visible=
"false"
/>
<e:Image
id=
"light"
source=
"common_prizelight_png"
x=
"374.19"
y=
"329.51"
anchorOffsetX=
"375.76"
anchorOffsetY=
"327.27"
/>
<e:Image
id=
"light"
source=
"common_prizelight_png"
x=
"374.19"
y=
"329.51"
anchorOffsetX=
"375.76"
anchorOffsetY=
"327.27"
/>
<e:Image
y=
"109.55"
source=
"擦肩而过弹窗 _png"
horizontalCenter=
"0.5"
/>
<e:Image
y=
"109.55"
source=
"擦肩而过弹窗 _png"
horizontalCenter=
"0.5"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"6
17"
y=
"279
"
>
<e:Button
id=
"closeBtn"
label=
""
x=
"6
09"
y=
"344.28
"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
...
@@ -11,13 +11,7 @@
...
@@ -11,13 +11,7 @@
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Image
id=
"picb"
source=
"点亮 副本 2_png"
x=
"142"
y=
"179"
/>
<e:Button
id=
"shareBtn"
label=
""
y=
"766"
horizontalCenter=
"-145.5"
>
<e:Image
id=
"pica"
source=
"点亮 副本 2_png"
x=
"608"
y=
"179"
scaleX=
"-1"
/>
<e:Image
id=
"picc"
source=
"点亮_png"
y=
"130"
x=
"280"
/>
<e:Image
id=
"pic1"
source=
"点亮 副本 2_png"
x=
"218"
y=
"237"
anchorOffsetX=
"76"
anchorOffsetY=
"58"
/>
<e:Image
id=
"pic3"
source=
"点亮 副本 2_png"
x=
"534"
y=
"235"
scaleX=
"-1"
anchorOffsetX=
"74"
anchorOffsetY=
"56"
/>
<e:Image
id=
"pic2"
source=
"点亮_png"
y=
"200"
horizontalCenter=
"0"
anchorOffsetX=
"98"
anchorOffsetY=
"70"
/>
<e:Button
id=
"shareBtn"
label=
""
y=
"588"
horizontalCenter=
"-145.5"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"按钮 副本 3_png"
source.down=
"按钮 副本 3_png"
source.disabled=
"按钮 副本 3_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"按钮 副本 3_png"
source.down=
"按钮 副本 3_png"
source.disabled=
"按钮 副本 3_png"
/>
...
@@ -25,7 +19,7 @@
...
@@ -25,7 +19,7 @@
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Button
id=
"goBtn"
label=
""
y=
"
588
"
horizontalCenter=
"144"
>
<e:Button
id=
"goBtn"
label=
""
y=
"
766
"
horizontalCenter=
"144"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"按钮 副本 4_png"
source.down=
"按钮 副本 4_png"
source.disabled=
"按钮 副本 4_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"按钮 副本 4_png"
source.down=
"按钮 副本 4_png"
source.disabled=
"按钮 副本 4_png"
/>
...
@@ -33,5 +27,12 @@
...
@@ -33,5 +27,12 @@
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Image
id=
"picb"
x=
"286"
y=
"391.28"
source=
"点亮 副本 2gray_png"
scaleX=
"-1"
/>
<e:Image
id=
"pica"
x=
"465.48"
y=
"384.28"
source=
"点亮 副本 2gray_png"
/>
<e:Image
id=
"picc"
y=
"367.28"
source=
"点亮gray_png"
x=
"310"
/>
<e:Image
id=
"pic1"
source=
"点亮 副本 2_png"
x=
"214.18"
y=
"443.39"
anchorOffsetX=
"81.82"
anchorOffsetY=
"60.61"
scaleX=
"-1"
/>
<e:Image
id=
"pic3"
source=
"点亮 副本 2_png"
x=
"528.24"
y=
"446.89"
scaleX=
"1"
anchorOffsetX=
"71.76"
anchorOffsetY=
"66.61"
/>
<e:Image
id=
"pic2"
source=
"点亮_png"
y=
"440.01"
anchorOffsetX=
"73.94"
anchorOffsetY=
"74.73"
x=
"375.94"
/>
<e:Label
id=
"lvTxt"
text=
"关卡1"
y=
"326"
textColor=
"0xFF841B"
horizontalCenter=
"0.5"
/>
<w:Config
id=
"1690063a75e"
/>
<w:Config
id=
"1690063a75e"
/>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/resource/skins/PrizeSkin.exml
View file @
f14b20bc
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"PrizeSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Skin
class=
"PrizeSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<w:Config
id=
"169005181d0"
/>
<w:Config
id=
"169005181d0"
/>
<e:Component
y=
"8
6
9.74"
skinName=
"ADSmallSkin"
x=
"84"
visible=
"false"
/>
<e:Component
y=
"8
8
9.74"
skinName=
"ADSmallSkin"
x=
"84"
visible=
"false"
/>
<e:Image
id=
"light"
source=
"common_prizelight_png"
x=
"374.19"
y=
"253.76"
anchorOffsetX=
"375.76"
anchorOffsetY=
"327.27"
visible=
"false"
/>
<e:Image
id=
"light"
source=
"common_prizelight_png"
x=
"374.19"
y=
"253.76"
anchorOffsetX=
"375.76"
anchorOffsetY=
"327.27"
visible=
"false"
/>
<e:Image
source=
"prizePanelbg_png"
y=
"61.15"
scale9Grid=
"87,543,522,23"
height=
"839"
x=
"28"
/>
<e:Image
source=
"prizePanelbg_png"
y=
"61.15"
scale9Grid=
"87,543,522,23"
height=
"839"
x=
"28"
/>
<e:Image
id=
"img"
width=
"508"
height=
"225"
source=
"{data.url}"
horizontalCenter=
"0"
y=
"515.76"
/>
<e:Image
id=
"img"
width=
"508"
height=
"225"
source=
"{data.url}"
horizontalCenter=
"0"
y=
"515.76"
visible=
"false"
/>
<e:Image
id=
"img2"
horizontalCenter=
"0"
y=
"515.76"
source=
"{data.url2}"
scaleX=
"0.7"
scaleY=
"0.7"
visible=
"false"
/>
<e:Image
id=
"money"
y=
"516.2"
scaleX=
"0.6"
scaleY=
"0.6"
source=
"common_money_png"
x=
"150"
visible=
"false"
/>
<e:Image
id=
"money"
y=
"516.2"
scaleX=
"0.6"
scaleY=
"0.6"
source=
"common_money_png"
x=
"150"
visible=
"false"
/>
<e:Image
id=
"blood"
y=
"5
22.8"
horizontalCenter=
"1"
source=
"common_blood_png"
scaleX=
"0.6"
scaleY=
"0.6
"
visible=
"false"
/>
<e:Image
id=
"blood"
y=
"5
18.8"
horizontalCenter=
"1.5"
source=
"common_blood_png"
scaleX=
"0.7"
scaleY=
"0.7
"
visible=
"false"
/>
<e:Group
id=
"numsgroup"
x=
"396.38"
y=
"518.4"
visible=
"false"
>
<e:Group
id=
"numsgroup"
x=
"396.38"
y=
"518.4"
visible=
"false"
>
<e:Image
id=
"numsbg"
source=
"signprize_numsbg_png"
x=
"0"
y=
"0"
/>
<e:Image
id=
"numsbg"
source=
"signprize_numsbg_png"
x=
"0"
y=
"0"
/>
<e:Label
id=
"propnums"
text=
"X8"
size=
"22"
horizontalCenter=
"0"
verticalCenter=
"0"
verticalAlign=
"middle"
textAlign=
"center"
/>
<e:Label
id=
"propnums"
text=
"X8"
size=
"22"
horizontalCenter=
"0"
verticalCenter=
"0"
verticalAlign=
"middle"
textAlign=
"center"
/>
</e:Group>
</e:Group>
<e:Label
id=
"propnums2"
text=
"30"
textColor=
"0x885037"
bold=
"true"
y=
"6
49
.08"
width=
"75"
textAlign=
"right"
x=
"287.16"
visible=
"false"
/>
<e:Label
id=
"propnums2"
text=
"30"
textColor=
"0x885037"
bold=
"true"
y=
"6
51
.08"
width=
"75"
textAlign=
"right"
x=
"287.16"
visible=
"false"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"608"
y=
"287.25"
>
<e:Button
id=
"closeBtn"
label=
""
x=
"608"
y=
"287.25"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
...
...
egret/src/mainScene/MainScene.ts
View file @
f14b20bc
...
@@ -47,7 +47,7 @@ import { readCache, getCacheKey } from '../mapScene/GuideCon';
...
@@ -47,7 +47,7 @@ import { readCache, getCacheKey } from '../mapScene/GuideCon';
import
{
StepAni
}
from
'../something/anis/StepAni'
;
import
{
StepAni
}
from
'../something/anis/StepAni'
;
import
{
updateMainTimerAfterGetData
}
from
'../../libs/new_wx/MainBase'
;
import
{
updateMainTimerAfterGetData
}
from
'../../libs/new_wx/MainBase'
;
import
wait
from
'../../libs/new_tc/wait'
;
import
wait
from
'../../libs/new_tc/wait'
;
import
{
AiControl
}
from
'../something/logic/AiControl'
;
import
{
AiControl
,
fesELeSmallNum
}
from
'../something/logic/AiControl'
;
import
{
JellyDisAni
}
from
'../something/anis/JellyDisAni'
;
import
{
JellyDisAni
}
from
'../something/anis/JellyDisAni'
;
import
{
EggBrokenAni
}
from
'../something/anis/EggBrokenAni'
;
import
{
EggBrokenAni
}
from
'../something/anis/EggBrokenAni'
;
import
{
FallAniData
,
FallType
}
from
'../something/interface/FallAniData'
;
import
{
FallAniData
,
FallType
}
from
'../something/interface/FallAniData'
;
...
@@ -111,7 +111,7 @@ const movieClips: any = {}
...
@@ -111,7 +111,7 @@ const movieClips: any = {}
//红包炸弹弹框名字
//红包炸弹弹框名字
const
redBombPanelName
=
"aaaaa"
;
const
redBombPanelName
=
"aaaaa"
;
//所有可能被添加节日红包的关卡及索引,默认索引值都是40;如果没有就不放
//所有可能被添加节日红包的关卡及索引,默认索引值都是40;如果没有就不放
const
fesChapterData
:
number
[]
=
[
1
]
const
fesChapterData
:
number
[]
=
[]
//节日大红包格子索引
//节日大红包格子索引
const
festivalIndex
:
number
=
40
const
festivalIndex
:
number
=
40
...
@@ -168,7 +168,7 @@ export default class MainScene extends Scene {
...
@@ -168,7 +168,7 @@ export default class MainScene extends Scene {
//节日元素目标
//节日元素目标
festivalTarget
:
FestivalTarget
;
festivalTarget
:
FestivalTarget
;
//节日小元素需要个数
//节日小元素需要个数
festivalTargetNum
:
number
=
6
;
festivalTargetNum
:
number
=
fesELeSmallNum
;
//所有元素的消耗数量,需要传给后端
//所有元素的消耗数量,需要传给后端
hasEliminatedElements
:
number
[];
hasEliminatedElements
:
number
[];
//得分的动画,首先特效组合的单独算分,然后把所有符合的放入,在波及的特效触发时不算分
//得分的动画,首先特效组合的单独算分,然后把所有符合的放入,在波及的特效触发时不算分
...
@@ -265,8 +265,6 @@ export default class MainScene extends Scene {
...
@@ -265,8 +265,6 @@ export default class MainScene extends Scene {
this
.
initBaseElement
();
this
.
initBaseElement
();
//设置栏置顶
//设置栏置顶
this
.
addChild
(
this
[
"settingAll"
])
this
.
addChild
(
this
[
"settingAll"
])
//AiControl初始化,
AiControl
.
ins
.
init
(
this
.
lattices
);
//先判断是否添加节日元素,如果加节日元素,就按initFestivalEle里的来
//先判断是否添加节日元素,如果加节日元素,就按initFestivalEle里的来
if
(
!
this
.
initFestivalEle
())
{
if
(
!
this
.
initFestivalEle
())
{
//检查一次三消
//检查一次三消
...
@@ -288,6 +286,8 @@ export default class MainScene extends Scene {
...
@@ -288,6 +286,8 @@ export default class MainScene extends Scene {
}
}
//最后加载svga,为了判断是否要加大红包的动效
//最后加载svga,为了判断是否要加大红包的动效
this
.
initSvgas
();
this
.
initSvgas
();
//AiControl初始化,
AiControl
.
ins
.
init
(
this
.
lattices
);
}
}
/**
/**
* 加载所有用到的svga
* 加载所有用到的svga
...
@@ -702,7 +702,7 @@ export default class MainScene extends Scene {
...
@@ -702,7 +702,7 @@ export default class MainScene extends Scene {
//添加节日元素,条件可能会变
//添加节日元素,条件可能会变
if
(
getRedBombTimes
()
&&
if
(
getRedBombTimes
()
&&
fesChapterData
.
indexOf
(
this
.
chapter
>>
0
)
>
-
1
&&
fesChapterData
.
indexOf
(
this
.
chapter
>>
0
)
>
-
1
&&
//
Math.random() > 0.5 &&
Math
.
random
()
>
0.5
&&
this
.
lattices
[
festivalIndex
]
&&
//格子必须有
this
.
lattices
[
festivalIndex
]
&&
//格子必须有
(
Tool
.
judgeSetFesEle
(
this
.
lattices
[
festivalIndex
])
||
!
this
.
lattices
[
festivalIndex
].
element
)
//没有元素也行
(
Tool
.
judgeSetFesEle
(
this
.
lattices
[
festivalIndex
])
||
!
this
.
lattices
[
festivalIndex
].
element
)
//没有元素也行
)
{
)
{
...
@@ -1796,72 +1796,75 @@ export default class MainScene extends Scene {
...
@@ -1796,72 +1796,75 @@ export default class MainScene extends Scene {
AiControl
.
ins
.
eggMotion
(
this
,
()
=>
{
AiControl
.
ins
.
eggMotion
(
this
,
()
=>
{
//后执行毛球跳动
//后执行毛球跳动
AiControl
.
ins
.
hairballMotion
(
this
,
()
=>
{
AiControl
.
ins
.
hairballMotion
(
this
,
()
=>
{
//如果早已通关,正在结算
//节日元素
if
(
this
.
hasPassed
)
{
AiControl
.
ins
.
fesEleMotion
(
this
,
()
=>
{
//如果原先特效还有,
//如果早已通关,正在结算
if
(
!
this
.
isCountingTime
)
{
if
(
this
.
hasPassed
)
{
this
.
terminateSteps
();
//如果原先特效还有,
if
(
!
this
.
isCountingTime
)
{
this
.
terminateSteps
();
}
//如果只有步数转化的,不能再进结算,
else
{
//通关了
//提交分数等
var
json
=
this
.
getSubmitJson
()
this
.
submit
(
json
)
}
return
}
}
//如果只有步数转化的,不能再进结算,
//判断是否已达目标
else
{
this
.
hasPassed
=
this
.
judgePass
();
//通关了
// console.log(this.hasPassed)
//提交分数等
//如果已达目标
var
json
=
this
.
getSubmitJson
()
if
(
this
.
hasPassed
)
{
this
.
submit
(
json
)
//连消基数为1
this
.
commonContinuityTimes
=
1
;
this
.
effectContinuityTimes
=
1
;
if
(
movieClips
[
"bonusTime"
])
{
this
.
addChild
(
movieClips
[
"bonusTime"
])
movieClips
[
"bonusTime"
].
gotoAndPlay
(
1
,
true
)
setTimeout
(()
=>
{
this
.
terminateSteps
();
if
(
movieClips
[
"bonusTime"
].
parent
)
{
this
.
removeChild
(
movieClips
[
"bonusTime"
])
}
},
1930
)
}
else
{
this
.
addChild
(
this
.
bonusTime
);
this
.
bonusTime
.
play
(()
=>
{
this
.
removeChild
(
this
.
bonusTime
)
this
.
terminateSteps
();
})
}
return
}
}
return
//出累计一步分数的toast;
}
this
.
oneStepScoreToast
();
//判断是否已达目标
//连消置0
this
.
hasPassed
=
this
.
judgePass
();
this
.
commonContinuityTimes
=
0
;
// console.log(this.hasPassed)
this
.
effectContinuityTimes
=
0
;
//如果已达目标
//判断步数是否为0;
if
(
this
.
hasPassed
)
{
if
(
this
.
steps
==
0
)
{
//连消基数为1
//失败弹框
this
.
commonContinuityTimes
=
1
;
// playSound(SoundType.fail);
this
.
effectContinuityTimes
=
1
;
var
panelsDatas
=
this
.
returnPanels
(
"failed"
,
{
level
:
this
.
chapter
})
if
(
movieClips
[
"bonusTime"
])
{
PanelCtrl
.
instance
.
showPanels
(
panelsDatas
[
0
],
panelsDatas
[
1
],
()
=>
{
});
this
.
addChild
(
movieClips
[
"bonusTime"
])
// PanelCtrl.instance.show("failed", { level: this.chapter });
movieClips
[
"bonusTime"
].
gotoAndPlay
(
1
,
true
)
return
setTimeout
(()
=>
{
this
.
terminateSteps
();
if
(
movieClips
[
"bonusTime"
].
parent
)
{
this
.
removeChild
(
movieClips
[
"bonusTime"
])
}
},
1930
)
}
else
{
this
.
addChild
(
this
.
bonusTime
);
this
.
bonusTime
.
play
(()
=>
{
this
.
removeChild
(
this
.
bonusTime
)
this
.
terminateSteps
();
})
}
}
return
//果冻的时间980,气泡的时间1100,必须考虑直接执行的情况,所以必须同时判断
}
//额外加一步ai果冻的操作,考虑和气泡一起改变,然后再执行检查死图
//出累计一步分数的toast;
let
count
=
0
;
this
.
oneStepScoreToast
();
let
countAll
=
2
;
//和操作步数一致
//连消置0
//果冻的先执行,因为有元素类型的改变,会影响变色气泡的动画
this
.
commonContinuityTimes
=
0
;
AiControl
.
ins
.
jellyMotion
(
this
,
()
=>
{
this
.
effectContinuityTimes
=
0
;
if
(
++
count
===
countAll
)
this
.
aiMotionCheckDieMap
()
//判断步数是否为0;
})
if
(
this
.
steps
==
0
)
{
//然后执行气泡
//失败弹框
AiControl
.
ins
.
bubbleMotion
(
this
,
()
=>
{
// playSound(SoundType.fail);
if
(
++
count
===
countAll
)
this
.
aiMotionCheckDieMap
()
var
panelsDatas
=
this
.
returnPanels
(
"failed"
,
{
level
:
this
.
chapter
})
})
PanelCtrl
.
instance
.
showPanels
(
panelsDatas
[
0
],
panelsDatas
[
1
],
()
=>
{
});
// PanelCtrl.instance.show("failed", { level: this.chapter });
return
}
//果冻的时间980,气泡的时间1100,必须考虑直接执行的情况,所以必须同时判断
//额外加一步ai果冻的操作,考虑和气泡一起改变,然后再执行检查死图
let
count
=
0
;
let
countAll
=
2
;
//和操作步数一致
//果冻的先执行,因为有元素类型的改变,会影响变色气泡的动画
AiControl
.
ins
.
jellyMotion
(
this
,
()
=>
{
if
(
++
count
===
countAll
)
this
.
aiMotionCheckDieMap
()
})
//然后执行气泡
AiControl
.
ins
.
bubbleMotion
(
this
,
()
=>
{
if
(
++
count
===
countAll
)
this
.
aiMotionCheckDieMap
()
})
})
})
})
})
})
...
@@ -2778,6 +2781,26 @@ export default class MainScene extends Scene {
...
@@ -2778,6 +2781,26 @@ export default class MainScene extends Scene {
}
}
}
}
}
}
//红包炸弹动效
redBombLightAni
(
index
:
number
,
callback
:
Function
)
{
//如果有
if
(
movieClips
[
"redBombLight"
])
{
var
p
=
Tool
.
getPositionByIndex
(
index
);
movieClips
[
"redBombLight"
].
x
=
p
[
0
]
-
358
;
movieClips
[
"redBombLight"
].
y
=
p
[
1
]
-
137
;
this
.
addChild
(
movieClips
[
"redBombLight"
])
movieClips
[
"redBombLight"
].
gotoAndPlay
(
1
,
true
);
setTimeout
(()
=>
{
if
(
movieClips
[
"redBombLight"
].
parent
)
{
movieClips
[
"redBombLight"
].
parent
.
removeChild
(
movieClips
[
"redBombLight"
])
}
},
56
/
60
*
1000
)
}
//时间再调
// setTimeout(() => {
callback
();
// }, 80)
}
/**
/**
* 移除元素的操作:
* 移除元素的操作:
* 进入emptys
* 进入emptys
...
...
egret/src/something/anis/MagicRotateAni.ts
View file @
f14b20bc
...
@@ -32,7 +32,7 @@ export function MagicRotateAni(ele: Element, p: number[], con: egret.DisplayObje
...
@@ -32,7 +32,7 @@ export function MagicRotateAni(ele: Element, p: number[], con: egret.DisplayObje
//算角度,弧度,x正方向为0,0到2pi,逆时针为正
//算角度,弧度,x正方向为0,0到2pi,逆时针为正
var
vec0
=
[
1
,
0
]
var
vec0
=
[
1
,
0
]
var
vec1
=
[
deltaX
,
deltaY
]
var
vec1
=
[
deltaX
,
deltaY
]
var
rotation
=
getRot
(
vec0
,
vec1
);
var
rotation
=
getRot
ByTwoVectors
(
vec0
,
vec1
);
if
(
deltaY
>
0
)
{
if
(
deltaY
>
0
)
{
rotation
=
pi2
-
rotation
;
rotation
=
pi2
-
rotation
;
}
}
...
@@ -81,7 +81,7 @@ function rotationAcodPoint(p: number[], rotation: number, point: number[] = [0,
...
@@ -81,7 +81,7 @@ function rotationAcodPoint(p: number[], rotation: number, point: number[] = [0,
* @param vec1
* @param vec1
* @param vec2
* @param vec2
*/
*/
function
getRot
(
vec1
:
number
[],
vec2
:
number
[])
{
export
function
getRotByTwoVectors
(
vec1
:
number
[],
vec2
:
number
[])
{
var
a
=
Math
.
sqrt
(
vec1
[
0
]
*
vec1
[
0
]
+
vec1
[
1
]
*
vec1
[
1
])
var
a
=
Math
.
sqrt
(
vec1
[
0
]
*
vec1
[
0
]
+
vec1
[
1
]
*
vec1
[
1
])
var
b
=
Math
.
sqrt
(
vec2
[
0
]
*
vec2
[
0
]
+
vec2
[
1
]
*
vec2
[
1
])
var
b
=
Math
.
sqrt
(
vec2
[
0
]
*
vec2
[
0
]
+
vec2
[
1
]
*
vec2
[
1
])
var
ab
=
vec1
[
0
]
*
vec2
[
0
]
+
vec1
[
1
]
*
vec2
[
1
]
var
ab
=
vec1
[
0
]
*
vec2
[
0
]
+
vec1
[
1
]
*
vec2
[
1
]
...
...
egret/src/something/anisCall/FesRedShootAni.ts
0 → 100644
View file @
f14b20bc
import
{
ImageAni
}
from
"../class/ImageAni"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
playSound
,
SoundType
}
from
"../../soundCtrl"
;
import
{
Element
}
from
"../class/Element"
;
import
{
Tool
}
from
"../Tool"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
export
const
stepPosition
:
number
[]
=
[
125
,
115
];
/**
* 需要回调的
* 手动修改this.shoot.rotation=
*/
export
class
FesRedShootAni
extends
egret
.
DisplayObjectContainer
{
light
:
LightingAni
;
imageAni
:
ImageAni
;
imageAniCon
:
egret
.
DisplayObjectContainer
constructor
()
{
super
()
this
.
light
=
new
LightingAni
();
this
.
addChild
(
this
.
light
);
var
arr
=
[]
for
(
var
i
=
1
;
i
<=
10
;
i
++
)
{
arr
.
push
(
"fesEleSmallDis"
+
i
+
"_png"
);
}
this
.
imageAniCon
=
new
egret
.
DisplayObjectContainer
();
this
.
imageAni
=
new
ImageAni
(
arr
);
this
.
imageAniCon
.
addChild
(
this
.
imageAni
);
this
.
addChild
(
this
.
imageAniCon
);
this
.
imageAni
.
visible
=
false
}
reset
()
{
this
.
light
.
visible
=
true
;
this
.
imageAni
.
visible
=
false
;
this
.
light
.
scaleX
=
0.2
;
}
play
(
startP
:
number
[],
ele
:
Element
,
callback
:
Function
)
{
this
.
reset
()
//算角度
var
r
=
Tool
.
getForwardRotation
(
startP
,
[
ele
.
x
,
ele
.
y
])
this
.
light
.
rotation
=
r
*
180
/
Math
.
PI
;
this
.
light
.
x
=
startP
[
0
];
this
.
light
.
y
=
startP
[
1
];
this
.
imageAniCon
.
x
=
ele
.
x
;
this
.
imageAniCon
.
y
=
ele
.
y
;
//247
var
dis
=
Math
.
sqrt
(
(
startP
[
0
]
-
ele
.
x
)
*
(
startP
[
0
]
-
ele
.
x
)
+
(
startP
[
1
]
-
ele
.
y
)
*
(
startP
[
1
]
-
ele
.
y
)
)
var
scaleX
=
dis
/
247
;
egret
.
Tween
.
get
(
this
.
light
)
.
to
({
scaleX
:
scaleX
,
},
400
)
.
call
(()
=>
{
ele
.
reset
(
ElementType
.
FESTIVALELE_SMALL
);
ele
.
scaleX
=
ele
.
scaleY
=
0.1
egret
.
Tween
.
get
(
ele
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
backOut
)
//回调
callback
();
this
.
imageAni
.
visible
=
true
;
this
.
imageAni
.
play
(()
=>
{
if
(
this
.
$parent
)
{
this
.
$parent
.
removeChild
(
this
)
};
Pool
.
recover
(
RecoverName
.
FESREDSHOOT_ANI
,
this
)
})
setTimeout
(()
=>
{
this
.
light
.
visible
=
false
;
},
200
)
})
}
}
class
LightingAni
extends
egret
.
Bitmap
{
sourceAll
:
string
[];
currentFrame
:
number
;
totalFrames
:
number
;
isPlay
:
boolean
;
startTime
:
number
/**
* 所有时间,帧数按每秒30
*/
allTime
:
number
/**
* 播放完的回调
*/
constructor
()
{
super
();
var
arr
=
[];
for
(
var
i
=
1
;
i
<=
13
;
i
++
)
{
arr
.
push
(
"lineLight"
+
i
+
"_png"
)
}
this
.
anchorOffsetX
=
23
;
this
.
anchorOffsetY
=
27
;
this
.
sourceAll
=
arr
;
this
.
texture
=
RES
.
getRes
(
this
.
sourceAll
[
0
])
this
.
currentFrame
=
0
;
this
.
totalFrames
=
arr
.
length
;
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
)
this
.
startTime
=
Date
.
now
()
this
.
allTime
=
this
.
sourceAll
.
length
/
30
*
1000
;
}
onEnterFrame
()
{
if
(
!
this
.
stage
)
return
var
dataNow
=
Date
.
now
();
var
deltaTime
=
dataNow
-
this
.
startTime
;
var
scale
=
deltaTime
/
this
.
allTime
;
if
(
scale
>=
1
)
{
this
.
startTime
=
Date
.
now
()
this
.
currentFrame
=
0
;
}
else
{
this
.
currentFrame
=
(
scale
*
this
.
sourceAll
.
length
)
>>
0
;
}
this
.
texture
=
RES
.
getRes
(
this
.
sourceAll
[
this
.
currentFrame
])
}
}
egret/src/something/chapters/Chapter6.ts
View file @
f14b20bc
...
@@ -494,15 +494,15 @@ export const Chapters6: ChapterData[] = [
...
@@ -494,15 +494,15 @@ export const Chapters6: ChapterData[] = [
starScores
:
[
5000
,
12000
,
20000
],
starScores
:
[
5000
,
12000
,
20000
],
map
:
{
map
:
{
lattices
:
[
lattices
:
[
3
,
3
,
3
,
0
,
0
,
0
,
3
,
3
,
3
,
2
,
2
,
2
,
0
,
0
,
0
,
2
,
2
,
2
,
3
,
3
,
3
,
0
,
0
,
0
,
3
,
3
,
3
,
2
,
2
,
2
,
0
,
0
,
0
,
2
,
2
,
2
,
3
,
3
,
0
,
0
,
0
,
0
,
0
,
3
,
3
,
2
,
2
,
0
,
0
,
0
,
0
,
0
,
2
,
2
,
0
,
0
,
0
,
3
,
3
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
2
,
2
,
0
,
0
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
3
,
3
,
3
,
3
,
0
,
3
,
3
,
3
,
3
,
2
,
2
,
2
,
2
,
0
,
2
,
2
,
2
,
2
,
3
,
3
,
3
,
0
,
3
,
0
,
3
,
3
,
3
,
2
,
2
,
2
,
0
,
2
,
0
,
2
,
2
,
2
,
0
,
3
,
0
,
3
,
3
,
3
,
0
,
3
,
0
,
0
,
2
,
0
,
2
,
2
,
2
,
0
,
2
,
0
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
],
],
connectedLats
:
[[
73
,
0
],
[
74
,
1
],
[
75
,
2
],
[
77
,
6
],
[
78
,
7
],
[
79
,
8
]],
connectedLats
:
[[
73
,
0
],
[
74
,
1
],
[
75
,
2
],
[
77
,
6
],
[
78
,
7
],
[
79
,
8
]],
elements
:
[
elements
:
[
...
@@ -550,7 +550,7 @@ export const Chapters6: ChapterData[] = [
...
@@ -550,7 +550,7 @@ export const Chapters6: ChapterData[] = [
{
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0.1
,
bubbleProbability
:
0.1
,
stepCount
:
3
0
,
stepCount
:
4
0
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
6
,
count
:
8
}]
},
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
6
,
count
:
8
}]
},
starScores
:
[
5000
,
12000
,
21000
],
starScores
:
[
5000
,
12000
,
21000
],
map
:
{
map
:
{
...
...
egret/src/something/chapters/Chapter8.ts
View file @
f14b20bc
...
@@ -512,7 +512,7 @@ export const Chapters8: ChapterData[] = [
...
@@ -512,7 +512,7 @@ export const Chapters8: ChapterData[] = [
},
},
//157
//157
{
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
2
6
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
6
,
count
:
13
}]
},
starScores
:
[
5000
,
12000
,
21000
],
map
:
{
lattices
:
[
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
],
connectedLats
:
[[
30
,
48
],
[
31
,
49
],
[
32
,
50
],
[
74
,
18
],
[
78
,
26
]],
elements
:
[
1
,
1
,
1
,
3
,
3
,
3
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
3
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
3
,
3
,
3
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
],
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
:
[
75
,
76
,
77
],
generateLats
:
[{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
10
,
type
:
null
},
{
index
:
16
,
type
:
null
},
{
index
:
18
,
type
:
null
},
{
index
:
26
,
type
:
null
}]
}
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
3
6
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
6
,
count
:
13
}]
},
starScores
:
[
5000
,
12000
,
21000
],
map
:
{
lattices
:
[
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
],
connectedLats
:
[[
30
,
48
],
[
31
,
49
],
[
32
,
50
],
[
74
,
18
],
[
78
,
26
]],
elements
:
[
1
,
1
,
1
,
3
,
3
,
3
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
3
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
3
,
3
,
3
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
],
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
:
[
75
,
76
,
77
],
generateLats
:
[{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
10
,
type
:
null
},
{
index
:
16
,
type
:
null
},
{
index
:
18
,
type
:
null
},
{
index
:
26
,
type
:
null
}]
}
},
},
//158
//158
{
{
...
...
egret/src/something/enum/RecoverName.ts
View file @
f14b20bc
...
@@ -24,6 +24,8 @@ export enum RecoverName {
...
@@ -24,6 +24,8 @@ export enum RecoverName {
HAIRBALLJUMP_ANI
=
"HairballJumpAni"
,
//三种毛球是一样的动画
HAIRBALLJUMP_ANI
=
"HairballJumpAni"
,
//三种毛球是一样的动画
FESREDBOMBSHOW_ANI
=
"FesRedBombShowAni"
,
FESREDBOMBSHOW_ANI
=
"FesRedBombShowAni"
,
FESREDSHOOT_ANI
=
"FesRedShootAni"
,
//元素身上,特效常驻动效
//元素身上,特效常驻动效
...
...
egret/src/something/logic/AiControl.ts
View file @
f14b20bc
...
@@ -14,9 +14,16 @@ import { Element } from "../class/Element";
...
@@ -14,9 +14,16 @@ import { Element } from "../class/Element";
import
{
HairballBrownState
}
from
"../states/HairballBrownState"
;
import
{
HairballBrownState
}
from
"../states/HairballBrownState"
;
import
{
HairballJumpAni
}
from
"../anis/HairballJumpAni"
;
import
{
HairballJumpAni
}
from
"../anis/HairballJumpAni"
;
import
{
HairballBrownDivideAni
}
from
"../anis/HairballBrownDivideAni"
;
import
{
HairballBrownDivideAni
}
from
"../anis/HairballBrownDivideAni"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
{
getRotByTwoVectors
}
from
"../anis/MagicRotateAni"
;
import
{
FesRedShootAni
}
from
"../anisCall/FesRedShootAni"
;
//孵鸡的数量
//孵鸡的数量
const
chickenNum
:
number
=
4
const
chickenNum
:
number
=
4
;
//节日大红包的小红包数量
export
const
fesELeSmallNum
:
number
=
6
;
export
class
AiControl
{
export
class
AiControl
{
private
static
_ins
:
AiControl
private
static
_ins
:
AiControl
...
@@ -43,6 +50,10 @@ export class AiControl {
...
@@ -43,6 +50,10 @@ export class AiControl {
*/
*/
private
hasHairball
:
boolean
;
private
hasHairball
:
boolean
;
/**
* 判断是否还有节日大红包,不可再生
*/
private
hasFesEleBig
:
boolean
;
/**
/**
* 用于判断格子中
* 用于判断格子中
* 是否有果冻,
* 是否有果冻,
...
@@ -57,6 +68,115 @@ export class AiControl {
...
@@ -57,6 +68,115 @@ export class AiControl {
// this.hasBubble = judgeBubbleExist(lattices);
// this.hasBubble = judgeBubbleExist(lattices);
this
.
hasHairball
=
judgeHairballExist
(
lattices
);
this
.
hasHairball
=
judgeHairballExist
(
lattices
);
this
.
eggs
=
getEggs
(
lattices
);
this
.
eggs
=
getEggs
(
lattices
);
this
.
hasFesEleBig
=
judgeFesEleBigExist
(
lattices
)
}
fesEleMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
//无节日大红包,直接回调,气泡能生成,不能直接判断
if
(
!
this
.
hasFesEleBig
)
{
callback
();
return
}
//找出所有的节日大红包
var
indexs
:
number
[]
=
[];
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
var
lat
=
thisObj
.
lattices
[
i
];
if
(
lat
&&
lat
.
element
&&
lat
.
element
.
type
==
ElementType
.
FESTIVALELE_BIG
//&&
// lat.element.festivalEle.isActive
)
{
indexs
.
push
(
i
);
}
}
//没有节日大红包,直接回调
if
(
!
indexs
.
length
)
{
//标记无节日大红包
this
.
hasFesEleBig
=
false
;
callback
();
return
}
if
(
!
thisObj
.
lattices
[
indexs
[
0
]].
element
.
festivalEle
.
isActive
)
{
callback
();
return
}
//找出6个能飞的小红包
var
redIndexs
:
number
[]
=
[];
for
(
var
a
=
0
;
a
<
thisObj
.
lattices
.
length
;
a
++
)
{
var
lat
=
thisObj
.
lattices
[
a
];
//是基础元素,但是不能有任何状态,
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
!
lat
.
element
.
hasAnyState
()
&&
!
lat
.
isGenerate
//且格子不是生成口
)
{
redIndexs
.
push
(
a
);
}
}
//打乱索引
redIndexs
.
sort
(
function
()
{
return
(
0.5
-
Math
.
random
());
});
let
six
:
any
[]
=
redIndexs
.
splice
(
0
,
fesELeSmallNum
);
//如果不足6个,就修改thisObj里的
if
(
six
.
length
<
fesELeSmallNum
)
{
thisObj
.
festivalTargetNum
=
fesELeSmallNum
;
thisObj
.
festivalTarget
.
count
=
fesELeSmallNum
;
//如果是0;就直接发接口吧
if
(
!
six
.
length
)
{
NetManager
.
ins
.
hc_redBombAward
((
success
)
=>
{
if
(
success
)
thisObj
.
redBombPanelMark
=
true
;
});
callback
();
return
}
}
//变成对象
for
(
var
i
=
0
;
i
<
six
.
length
;
i
++
)
six
[
i
]
=
{
index
:
six
[
i
]
};
//暂时只有一个大红包,
let
index
=
indexs
[
0
];
var
p
=
Tool
.
getPositionByIndex
(
index
);
var
vec0
=
[
1
,
0
];
//计算角度
for
(
var
i
=
0
;
i
<
six
.
length
;
i
++
)
{
var
po
=
Tool
.
getPositionByIndex
(
six
[
i
].
index
);
var
deltaX
=
po
[
0
]
-
p
[
0
];
var
deltaY
=
po
[
1
]
-
p
[
1
];
// var dis = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
//算角度,弧度,x正方向为0,0到2pi,逆时针为正
var
vec1
=
[
deltaX
,
deltaY
]
var
rotation
=
getRotByTwoVectors
(
vec0
,
vec1
);
if
(
deltaY
>
0
)
rotation
=
Math
.
PI
*
2
-
rotation
;
six
[
i
].
rotation
=
rotation
;
}
//排序
six
.
sort
(
function
(
a
,
b
)
{
return
b
.
rotation
-
a
.
rotation
});
//还原为索引
for
(
var
i
=
0
;
i
<
six
.
length
;
i
++
)
six
[
i
]
=
six
[
i
].
index
;
//动画
thisObj
.
redBombLightAni
(
index
,
()
=>
{
let
count
=
0
;
let
countAll
=
six
.
length
;
for
(
let
a
=
0
;
a
<
six
.
length
;
a
++
)
{
let
endIndex
=
six
[
a
];
let
lat
=
thisObj
.
lattices
[
endIndex
];
let
ele
=
lat
.
element
;
let
fesRedShootAni
:
FesRedShootAni
=
Pool
.
takeOut
(
RecoverName
.
FESREDSHOOT_ANI
)
if
(
!
fesRedShootAni
)
fesRedShootAni
=
new
FesRedShootAni
();
setTimeout
(()
=>
{
thisObj
.
addChild
(
fesRedShootAni
);
fesRedShootAni
.
play
(
p
,
ele
,
()
=>
{
if
(
++
count
==
countAll
)
{
thisObj
.
removeOperation
(
index
);
thisObj
.
fall
(()
=>
{
//掉落停止回调
thisObj
.
fallCallback
();
});
// callback();
}
})
},
100
*
a
)
}
})
}
}
jellyMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
jellyMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
...
@@ -515,6 +635,17 @@ function judgeHairballExist(lattices: Lattice[]) {
...
@@ -515,6 +635,17 @@ function judgeHairballExist(lattices: Lattice[]) {
}
}
return
false
;
return
false
;
}
}
function
judgeFesEleBigExist
(
lattices
:
Lattice
[])
{
for
(
var
i
=
0
;
i
<
lattices
.
length
;
i
++
)
{
var
lattice
=
lattices
[
i
]
if
(
lattice
&&
lattice
.
element
&&
lattice
.
element
.
type
==
ElementType
.
FESTIVALELE_BIG
)
return
true
}
return
false
;
}
/**
/**
* 判断气泡是否存在
* 判断气泡是否存在
* @param lattices
* @param lattices
...
...
mock/happyclear/submit.json
View file @
f14b20bc
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
"option"
:
{
"option"
:
{
"id"
:
"41"
,
"id"
:
"41"
,
"day"
:
null
,
"day"
:
null
,
"realValue"
:
87
,
"realValue"
:
999
,
"categoryType"
:
5
,
"categoryType"
:
5
,
"title"
:
"游戏次数2"
,
"title"
:
"游戏次数2"
,
"rate"
:
"10"
,
"rate"
:
"10"
,
"minValue"
:
null
,
"minValue"
:
null
,
"maxValue"
:
null
,
"maxValue"
:
null
,
"coinType"
:
1
,
"coinType"
:
1
,
"propType"
:
2
,
"propType"
:
3
,
"num"
:
null
,
"num"
:
null
,
"img"
:
"//yun.dui88.com/images/201910/e6pmpk2pne.png"
,
"img"
:
"//yun.dui88.com/images/201910/e6pmpk2pne.png"
,
"appItemId"
:
null
,
"appItemId"
:
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