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
975c9ba7
Commit
975c9ba7
authored
Mar 09, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新新元素
parent
5362fc39
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
152 additions
and
127 deletions
+152
-127
doConveyorAI.ts
egret/src/mainScene/doConveyorAI.ts
+85
-0
Chapter19.ts
egret/src/something/chapters/Chapter19.ts
+67
-1
home.json
mock/happyclear/home.json
+0
-126
No files found.
egret/src/mainScene/doConveyorAI.ts
0 → 100644
View file @
975c9ba7
import
{
Element
}
from
"../something/class/Element"
;
import
{
StateType
}
from
"../something/enum/StateType"
;
import
MainScene
from
"./MainScene"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
EffectType
}
from
"../something/enum/EffectType"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
{
MonsterShootAni
,
monstShootAniDur
}
from
"../something/anis/MonsterShootAni"
;
import
{
RecoverName
}
from
"../something/enum/RecoverName"
;
import
{
Pool
}
from
"../something/Pool"
;
import
{
createMonsterStatusAni
}
from
"../effect/createMonsterStatusAni"
;
/**
* 独眼怪爆炸
*/
export
default
async
(
thisObj
:
MainScene
)
=>
{
//先找出所有激活的怪物
const
awakeMonsterIndexs
:
number
[]
=
[];
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
const
lattice
=
thisObj
.
lattices
[
i
]
if
(
lattice
&&
lattice
.
element
&&
lattice
.
element
.
monster
&&
lattice
.
element
.
monster
.
active
)
{
if
(
!
lattice
.
element
.
hasState
(
StateType
.
BLOCK_LOCK
))
awakeMonsterIndexs
.
push
(
i
);
}
}
//遍历所有基础元素
const
baseElements
:
Element
[]
=
[];
for
(
var
i
=
Tool
.
colNum
*
Tool
.
rowNum
-
1
;
i
>=
0
;
i
--
)
{
var
lat
=
thisObj
.
lattices
[
i
];
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
!
lat
.
element
.
monster
&&
!
lat
.
element
.
candy
&&
!
lat
.
element
.
effectType
)
{
baseElements
.
push
(
lat
.
element
);
}
}
baseElements
.
sort
(
function
()
{
//打乱数组
return
(
0.5
-
Math
.
random
());
});
let
genarateEffect
:
Element
[]
=
[];
//生成的特效的列表
const
activeMosterEles
:
Element
[]
=
awakeMonsterIndexs
.
map
(
i
=>
thisObj
.
lattices
[
i
].
element
);
const
foundsResult
:
Element
[][]
=
[];
//遍历激活的怪物
for
(
let
index
=
0
;
index
<
activeMosterEles
.
length
;
index
++
)
{
const
monsterEle
=
activeMosterEles
[
index
];
//找到相同颜色的元素
let
founds
=
baseElements
.
filter
(
ele
=>
ele
.
type
==
monsterEle
.
type
&&
genarateEffect
.
indexOf
(
ele
)
==
-
1
);
founds
=
founds
.
slice
(
0
,
3
);
genarateEffect
=
genarateEffect
.
concat
(
founds
);
foundsResult
[
index
]
=
founds
;
}
const
playEffect
=
async
(
index
)
=>
{
const
monsterEle
=
activeMosterEles
[
index
];
//找到相同颜色的元素
let
founds
=
foundsResult
[
index
];
await
createMonsterStatusAni
(
monsterEle
.
x
,
monsterEle
.
y
,
thisObj
);
monsterEle
.
monster
.
hide
();
founds
.
forEach
((
ele
)
=>
{
let
bonusShootAni
:
MonsterShootAni
=
Pool
.
takeOut
(
RecoverName
.
MONSTER_SHOOT_ANI
);
if
(
!
bonusShootAni
)
bonusShootAni
=
new
MonsterShootAni
();
var
r
=
Tool
.
getForwardRotation
([
monsterEle
.
x
,
monsterEle
.
y
],
[
ele
.
x
,
ele
.
y
])
bonusShootAni
.
play
(
r
*
180
/
Math
.
PI
,
[
monsterEle
.
x
,
monsterEle
.
y
],
[
ele
.
x
,
ele
.
y
],
()
=>
{
});
thisObj
.
addChild
(
bonusShootAni
);
});
};
for
(
let
index
=
0
;
index
<
activeMosterEles
.
length
;
index
++
)
{
playEffect
(
index
);
}
if
(
genarateEffect
.
length
>
0
)
await
wait
(
monstShootAniDur
+
300
);
for
(
let
index
=
0
;
index
<
foundsResult
.
length
;
index
++
)
{
const
founds
=
foundsResult
[
index
];
founds
.
forEach
(
ele
=>
{
ele
.
effectType
=
Math
.
random
()
>
0.5
?
EffectType
.
HORIZONTAL
:
EffectType
.
VERTICAL
;
});
activeMosterEles
[
index
].
monster
.
resetStatus
();
}
// console.log('激活的怪物数据', foundsResult);
//禁用所有的怪物,再开始播放怪物释放技能的动画,完了再播放怪物睡眠、苏醒的动画,再重新启用怪物
return
genarateEffect
;
//如果有苏醒的怪物
}
\ No newline at end of file
egret/src/something/chapters/Chapter19.ts
View file @
975c9ba7
...
...
@@ -2,4 +2,70 @@ import { ChapterData } from "../interface/ChapterData";
import
{
PassType
}
from
"../enum/PassType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//476-500
export
const
Chapters19
:
ChapterData
[]
=
[]
\ No newline at end of file
export
const
Chapters19
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
999
,
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
CHICKEN
,
count
:
995
,
},
],
},
starScores
:
[
1000
,
5000
,
10000
],
map
:
{
lattices
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
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0
,
0
,
0
,
0
,
],
// recycles: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
mock/happyclear/home.json
View file @
975c9ba7
...
...
@@ -2387,132 +2387,6 @@
"levelNum"
:
475
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
476
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
477
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
478
,
"maxScore"
:
47440
,
"stars"
:
1
}
,
{
"levelNum"
:
479
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
480
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
481
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
482
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
483
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
484
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
485
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
486
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
487
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
488
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
489
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
490
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
491
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
492
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
493
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
494
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
495
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
496
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
497
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
498
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
499
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
500
,
"maxScore"
:
47440
,
"stars"
:
1
}
],
...
...
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