Compare commits
3 Commits
10acb8c068
...
c7cb8b3e1e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7cb8b3e1e | ||
|
|
a645e65b09 | ||
|
|
a9d1ebf14d |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 870 KiB After Width: | Height: | Size: 805 KiB |
@@ -859,7 +859,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 40,
|
||||
"height": 10
|
||||
"height": 7
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -1037,7 +1037,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 140,
|
||||
"height": 40
|
||||
"height": 30
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -1162,7 +1162,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 40,
|
||||
"height": 10
|
||||
"height": 7
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
|
||||
@@ -2600,10 +2600,10 @@
|
||||
"height": 63,
|
||||
"rawWidth": 250,
|
||||
"rawHeight": 63,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"borderTop": 22,
|
||||
"borderBottom": 21,
|
||||
"borderLeft": 65,
|
||||
"borderRight": 33,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 192 KiB |
@@ -17,9 +17,26 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{432,936}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,543},{432,936}}</string>
|
||||
<string>{{1,963},{432,936}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1_Lobby.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{432,936}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{432,936}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,1397},{432,936}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>6_Collection_Detail_2_Uncommon.png</key>
|
||||
<dict>
|
||||
@@ -34,7 +51,7 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{432,936}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{435,543},{432,936}}</string>
|
||||
<string>{{543,1},{432,936}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
@@ -51,9 +68,9 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{432,936}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{893,963},{432,936}}</string>
|
||||
<string>{{977,1},{432,936}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>l1_sky.png</key>
|
||||
<dict>
|
||||
@@ -70,7 +87,7 @@
|
||||
<key>textureRect</key>
|
||||
<string>{{1,1},{960,540}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>l2_mountains.png</key>
|
||||
<dict>
|
||||
@@ -85,7 +102,7 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{960,540}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{963,1},{960,354}}</string>
|
||||
<string>{{1505,1},{960,354}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
</dict>
|
||||
@@ -102,7 +119,7 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{960,540}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,1481},{832,142}}</string>
|
||||
<string>{{939,1687},{832,142}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
@@ -119,7 +136,7 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{960,540}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{893,1397},{960,224}}</string>
|
||||
<string>{{939,1235},{960,224}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
@@ -136,9 +153,9 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{960,540}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1591,1},{960,224}}</string>
|
||||
<string>{{939,1461},{960,224}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>l6_ground.png</key>
|
||||
<dict>
|
||||
@@ -153,9 +170,9 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{960,540}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1319,1},{960,270}}</string>
|
||||
<string>{{939,963},{960,270}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>l7_ground.png</key>
|
||||
<dict>
|
||||
@@ -170,9 +187,9 @@
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{960,22}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{869,543},{960,22}}</string>
|
||||
<string>{{543,939},{960,22}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>metadata</key>
|
||||
@@ -186,9 +203,9 @@
|
||||
<key>realTextureFileName</key>
|
||||
<string>umps.png</string>
|
||||
<key>size</key>
|
||||
<string>{1854,1624}</string>
|
||||
<string>{1900,1830}</string>
|
||||
<key>smartupdate</key>
|
||||
<string>$TexturePacker:SmartUpdate:7bdf5ebf9b96a48b6ad0a97b3e47162f:5e4e2e7442be7c58b998030762951bd2:318abc3a8f3ad8d09018e87dff1f2449$</string>
|
||||
<string>$TexturePacker:SmartUpdate:b2c639796bb2a641f20b56f2a45f2983:23da3d48a8b840e8918bf061db3ffbe6:318abc3a8f3ad8d09018e87dff1f2449$</string>
|
||||
<key>textureFileName</key>
|
||||
<string>umps.png</string>
|
||||
</dict>
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 435,
|
||||
"trimY": 543,
|
||||
"trimX": 543,
|
||||
"trimY": 1,
|
||||
"width": 432,
|
||||
"height": 936,
|
||||
"rawWidth": 432,
|
||||
@@ -61,11 +61,57 @@
|
||||
"name": "0_User_Name",
|
||||
"userData": {
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 1,
|
||||
"trimY": 543,
|
||||
"trimY": 963,
|
||||
"width": 432,
|
||||
"height": 936,
|
||||
"rawWidth": 432,
|
||||
"rawHeight": 936,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [],
|
||||
"indexes": [],
|
||||
"uv": [],
|
||||
"nuv": [],
|
||||
"minPos": [],
|
||||
"maxPos": []
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "cd375c0d-bb84-48dc-a7ec-334d7ce1471b@6c48a",
|
||||
"atlasUuid": "d7d869bc-06aa-4876-806f-487e68b96780",
|
||||
"trimType": "auto"
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"fe1eb": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "d7d869bc-06aa-4876-806f-487e68b96780@fe1eb",
|
||||
"displayName": "",
|
||||
"id": "fe1eb",
|
||||
"name": "1_Lobby",
|
||||
"userData": {
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 1,
|
||||
"trimY": 1397,
|
||||
"width": 432,
|
||||
"height": 936,
|
||||
"rawWidth": 432,
|
||||
@@ -107,11 +153,11 @@
|
||||
"name": "9_PopupFullScreen_RewardItems",
|
||||
"userData": {
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 893,
|
||||
"trimY": 963,
|
||||
"trimX": 977,
|
||||
"trimY": 1,
|
||||
"width": 432,
|
||||
"height": 936,
|
||||
"rawWidth": 432,
|
||||
@@ -153,7 +199,7 @@
|
||||
"name": "l1_sky",
|
||||
"userData": {
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 1,
|
||||
@@ -202,7 +248,7 @@
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": -93,
|
||||
"trimX": 963,
|
||||
"trimX": 1505,
|
||||
"trimY": 1,
|
||||
"width": 960,
|
||||
"height": 354,
|
||||
@@ -248,8 +294,8 @@
|
||||
"rotated": false,
|
||||
"offsetX": -9,
|
||||
"offsetY": 127,
|
||||
"trimX": 1,
|
||||
"trimY": 1481,
|
||||
"trimX": 939,
|
||||
"trimY": 1687,
|
||||
"width": 832,
|
||||
"height": 142,
|
||||
"rawWidth": 960,
|
||||
@@ -294,8 +340,8 @@
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": -158,
|
||||
"trimX": 893,
|
||||
"trimY": 1397,
|
||||
"trimX": 939,
|
||||
"trimY": 1235,
|
||||
"width": 960,
|
||||
"height": 224,
|
||||
"rawWidth": 960,
|
||||
@@ -337,11 +383,11 @@
|
||||
"name": "l5_bg-ground02",
|
||||
"userData": {
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": -158,
|
||||
"trimX": 1591,
|
||||
"trimY": 1,
|
||||
"trimX": 939,
|
||||
"trimY": 1461,
|
||||
"width": 960,
|
||||
"height": 224,
|
||||
"rawWidth": 960,
|
||||
@@ -383,11 +429,11 @@
|
||||
"name": "l6_ground",
|
||||
"userData": {
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": -135,
|
||||
"trimX": 1319,
|
||||
"trimY": 1,
|
||||
"trimX": 939,
|
||||
"trimY": 963,
|
||||
"width": 960,
|
||||
"height": 270,
|
||||
"rawWidth": 960,
|
||||
@@ -429,11 +475,11 @@
|
||||
"name": "l7_ground",
|
||||
"userData": {
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 869,
|
||||
"trimY": 543,
|
||||
"trimX": 543,
|
||||
"trimY": 939,
|
||||
"width": 960,
|
||||
"height": 22,
|
||||
"rawWidth": 960,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 266 KiB |
@@ -99,7 +99,7 @@
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": -184.565,
|
||||
"y": 0.2,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -176,7 +176,7 @@
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "d7d869bc-06aa-4876-806f-487e68b96780@40168",
|
||||
"__uuid__": "d7d869bc-06aa-4876-806f-487e68b96780@1e2d6",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 1,
|
||||
@@ -353,8 +353,8 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 567,
|
||||
"height": 31
|
||||
"width": 565,
|
||||
"height": 30
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -390,7 +390,7 @@
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@61404",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@f96ec",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 3,
|
||||
@@ -402,7 +402,7 @@
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0.5,
|
||||
"_fillRange": 1,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": {
|
||||
@@ -674,8 +674,8 @@
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"x": 1.4,
|
||||
"y": 1.8,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
@@ -702,8 +702,8 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 567,
|
||||
"height": 30
|
||||
"width": 407.8571428571429,
|
||||
"height": 16.666666666666668
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -1203,7 +1203,7 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 567,
|
||||
"width": 571,
|
||||
"height": 30
|
||||
},
|
||||
"_anchorPoint": {
|
||||
@@ -1234,13 +1234,13 @@
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"r": 192,
|
||||
"g": 192,
|
||||
"b": 192,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "9fd900dd-221b-4f89-8f2c-fba34243c835@f9941",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@f96ec",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 1,
|
||||
@@ -1254,8 +1254,11 @@
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_useGrayscale": true,
|
||||
"_atlas": {
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
|
||||
"__expectedType__": "cc.SpriteAtlas"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
@@ -1279,7 +1282,7 @@
|
||||
},
|
||||
"_mode": 2,
|
||||
"_totalLength": 1,
|
||||
"_progress": 0.5,
|
||||
"_progress": 1,
|
||||
"_reverse": false,
|
||||
"_id": ""
|
||||
},
|
||||
@@ -1969,8 +1972,8 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 720,
|
||||
"height": 1280
|
||||
"width": 724,
|
||||
"height": 1284
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -1997,10 +2000,10 @@
|
||||
},
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_left": -2,
|
||||
"_right": -2,
|
||||
"_top": -2,
|
||||
"_bottom": -2,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
|
||||
@@ -55,7 +55,7 @@ export class MissionHomeComp extends CCComp {
|
||||
home_active(){
|
||||
this.uodate_data()
|
||||
this.node.active=true
|
||||
this.switch_tab('home')
|
||||
// this.switch_tab('home')
|
||||
}
|
||||
uodate_data(){
|
||||
|
||||
@@ -63,25 +63,25 @@ export class MissionHomeComp extends CCComp {
|
||||
isWxClient(){
|
||||
return typeof wx !== 'undefined' && typeof (wx as any).getSystemInfoSync === 'function';
|
||||
}
|
||||
btn_func(e: any, data: string){
|
||||
if (['home', 'hero', 'rank'].includes(data)) {
|
||||
this.switch_tab(data);
|
||||
}
|
||||
}
|
||||
// btn_func(e: any, data: string){
|
||||
// if (['home', 'hero', 'rank'].includes(data)) {
|
||||
// this.switch_tab(data);
|
||||
// }
|
||||
// }
|
||||
|
||||
switch_tab(tab: string) {
|
||||
if (this.heros_page) this.heros_page.active = tab === 'hero';
|
||||
if (this.rank_page) this.rank_page.active = tab === 'rank';
|
||||
// switch_tab(tab: string) {
|
||||
// if (this.heros_page) this.heros_page.active = tab === 'hero';
|
||||
// if (this.rank_page) this.rank_page.active = tab === 'rank';
|
||||
|
||||
const setBtnActive = (btn: Node, isActive: boolean) => {
|
||||
const activeNode = btn?.getChildByName('active');
|
||||
if (activeNode) activeNode.active = isActive;
|
||||
}
|
||||
// const setBtnActive = (btn: Node, isActive: boolean) => {
|
||||
// const activeNode = btn?.getChildByName('active');
|
||||
// if (activeNode) activeNode.active = isActive;
|
||||
// }
|
||||
|
||||
setBtnActive(this.home_btn, tab === 'home');
|
||||
setBtnActive(this.hero_btn, tab === 'hero');
|
||||
setBtnActive(this.rank_btn, tab === 'rank');
|
||||
}
|
||||
// setBtnActive(this.home_btn, tab === 'home');
|
||||
// setBtnActive(this.hero_btn, tab === 'hero');
|
||||
// setBtnActive(this.rank_btn, tab === 'rank');
|
||||
// }
|
||||
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
|
||||
@@ -19,6 +19,7 @@ const { ccclass, property } = _decorator;
|
||||
export class MissionMonCompComp extends CCComp {
|
||||
private static readonly BOSS_RENDER_PRIORITY = 1000000;
|
||||
private static readonly MON_SLOT_COUNT = 6;
|
||||
private static readonly MON_FRONT_SLOT_COUNT = 3;
|
||||
private static readonly MON_SLOT_START_X = 30;
|
||||
private static readonly MON_SLOT_X_INTERVAL = 60;
|
||||
private static readonly MON_DROP_HEIGHT = 280;
|
||||
@@ -47,6 +48,7 @@ export class MissionMonCompComp extends CCComp {
|
||||
monLv: number,
|
||||
}>> = [];
|
||||
private slotOccupiedEids: Array<number | null> = [];
|
||||
private slotRangeTypes: Array<HType.Melee | HType.Long> = [];
|
||||
/** 全局生成顺序计数器,用于层级管理(预留) */
|
||||
private globalSpawnOrder: number = 0;
|
||||
/** 插队刷怪处理计时器 */
|
||||
@@ -148,6 +150,7 @@ export class MissionMonCompComp extends CCComp {
|
||||
this.waveSpawnedCount = 0;
|
||||
this.bossSpawnedInWave = false;
|
||||
this.waveSpawnTimer = this.waveSpawnCd;
|
||||
this.confirmWaveSlotTypes();
|
||||
this.primeWaveInitialBurst();
|
||||
oops.message.dispatchEvent(GameEvent.NewWave, {
|
||||
wave: this.currentWave,
|
||||
@@ -231,6 +234,14 @@ export class MissionMonCompComp extends CCComp {
|
||||
{ length: MissionMonCompComp.MON_SLOT_COUNT },
|
||||
() => null
|
||||
);
|
||||
this.confirmWaveSlotTypes();
|
||||
}
|
||||
|
||||
private confirmWaveSlotTypes() {
|
||||
this.slotRangeTypes = Array.from(
|
||||
{ length: MissionMonCompComp.MON_SLOT_COUNT },
|
||||
(_, index) => index < MissionMonCompComp.MON_FRONT_SLOT_COUNT ? HType.Melee : HType.Long
|
||||
);
|
||||
}
|
||||
|
||||
private hasPendingSlotQueue() {
|
||||
@@ -268,18 +279,34 @@ export class MissionMonCompComp extends CCComp {
|
||||
return occupied + this.slotSpawnQueues[slotIndex].length;
|
||||
}
|
||||
|
||||
private resolveSlotPriorityIndexes(uuid: number): number[] {
|
||||
private resolveMonsterSlotRange(uuid: number): HType.Melee | HType.Long {
|
||||
const type = HeroInfo[uuid]?.type;
|
||||
if (type === HType.Melee) {
|
||||
if (type === HType.Melee) return HType.Melee;
|
||||
return HType.Long;
|
||||
}
|
||||
|
||||
private resolveSlotPriorityIndexes(uuid: number): number[] {
|
||||
if (this.resolveMonsterSlotRange(uuid) === HType.Melee) {
|
||||
return [0, 1, 2, 3, 4, 5];
|
||||
}
|
||||
return [5, 4, 3, 2, 1, 0];
|
||||
}
|
||||
|
||||
private pickAssignSlotIndex(uuid: number): number {
|
||||
const expectedRange = this.resolveMonsterSlotRange(uuid);
|
||||
const slotPriority = this.resolveSlotPriorityIndexes(uuid);
|
||||
let bestLoad = Number.MAX_SAFE_INTEGER;
|
||||
let bestIndex = slotPriority[0] ?? 0;
|
||||
let bestIndex = -1;
|
||||
for (let i = 0; i < slotPriority.length; i++) {
|
||||
const index = slotPriority[i];
|
||||
if (this.slotRangeTypes[index] !== expectedRange) continue;
|
||||
const load = this.getSlotQueueLoad(index);
|
||||
if (load < bestLoad) {
|
||||
bestLoad = load;
|
||||
bestIndex = index;
|
||||
}
|
||||
}
|
||||
if (bestIndex >= 0) return bestIndex;
|
||||
for (let i = 0; i < slotPriority.length; i++) {
|
||||
const index = slotPriority[i];
|
||||
const load = this.getSlotQueueLoad(index);
|
||||
@@ -288,6 +315,7 @@ export class MissionMonCompComp extends CCComp {
|
||||
bestIndex = index;
|
||||
}
|
||||
}
|
||||
if (bestIndex >= 0) return bestIndex;
|
||||
return bestIndex;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user