当三个英雄后,不再出现其他英雄
This commit is contained in:
@@ -32,6 +32,24 @@ export const getHeroList = ()=>{
|
|||||||
return Masters
|
return Masters
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getHeroListByCalled = (count:number,called:any[])=>{
|
||||||
|
let list=Masters
|
||||||
|
if(called.length==3){
|
||||||
|
list=called.map((item:any)=>item.uuid)
|
||||||
|
}
|
||||||
|
// 确保请求数量不超过可用卡牌数量
|
||||||
|
count = Math.min(count, list.length);
|
||||||
|
|
||||||
|
// 打乱数组顺序
|
||||||
|
const shuffled = [...list].sort(() => Math.random() - 0.5);
|
||||||
|
|
||||||
|
// 返回指定数量的卡牌
|
||||||
|
return shuffled.slice(0, count).map(uuid => ({
|
||||||
|
uuid
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
export const HeroList = [5021,5022,5023,5024,5025,5026,5027,5028]
|
export const HeroList = [5021,5022,5023,5024,5025,5026,5027,5028]
|
||||||
export const MonList = [5201,5202,5203,5204,5205,5206,5219,5220,5221,5222,5223,5224,5225,5226,5227]
|
export const MonList = [5201,5202,5203,5204,5205,5206,5219,5220,5221,5222,5223,5224,5225,5226,5227]
|
||||||
export const Masters = [5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012]
|
export const Masters = [5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012]
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { getSkills, Quality } from "../common/config/SkillSet";
|
|||||||
import { getEnhancement } from "../common/config/LevelUp";
|
import { getEnhancement } from "../common/config/LevelUp";
|
||||||
import { FightSet } from "../common/config/Mission";
|
import { FightSet } from "../common/config/Mission";
|
||||||
import { oops } from "db://oops-framework/core/Oops";
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
|
import { getHeroListByCalled } from "../common/config/heroSet";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -125,7 +126,8 @@ export class CardsCompComp extends CCComp {
|
|||||||
this.card3c.enhancement_select(list[2])
|
this.card3c.enhancement_select(list[2])
|
||||||
}
|
}
|
||||||
hero_select(data:any){
|
hero_select(data:any){
|
||||||
let list=getRandomCardsByType(cardType.HERO,3,0)
|
|
||||||
|
let list=getHeroListByCalled(3,data.called)
|
||||||
console.log("[CardsComp]:英雄选择卡牌列表",list)
|
console.log("[CardsComp]:英雄选择卡牌列表",list)
|
||||||
this.card1c.hero_select(list[0])
|
this.card1c.hero_select(list[0])
|
||||||
this.card2c.hero_select(list[1])
|
this.card2c.hero_select(list[1])
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ export class MissionComp extends CCComp {
|
|||||||
1:{uuid:0,count:0},
|
1:{uuid:0,count:0},
|
||||||
2:{uuid:0,count:0},
|
2:{uuid:0,count:0},
|
||||||
}
|
}
|
||||||
|
|
||||||
func_queue:any=[]
|
func_queue:any=[]
|
||||||
|
|
||||||
|
|
||||||
@@ -259,7 +258,7 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
to_ready(){
|
to_ready(){
|
||||||
console.log("[MissionComp] ** 2 ** to_ready")
|
console.log("[MissionComp] ** 2 ** to_ready")
|
||||||
oops.message.dispatchEvent(GameEvent.HeroSelect)
|
oops.message.dispatchEvent(GameEvent.HeroSelect,{called:[]})
|
||||||
}
|
}
|
||||||
ready_to_fight(){
|
ready_to_fight(){
|
||||||
console.log("[MissionComp] ** 3 ** ready_to_fight")
|
console.log("[MissionComp] ** 3 ** ready_to_fight")
|
||||||
@@ -279,7 +278,8 @@ export class MissionComp extends CCComp {
|
|||||||
// oops.message.dispatchEvent(GameEvent.EnhancementSelect)
|
// oops.message.dispatchEvent(GameEvent.EnhancementSelect)
|
||||||
// }
|
// }
|
||||||
to_call_friend(){
|
to_call_friend(){
|
||||||
oops.message.dispatchEvent(GameEvent.HeroSelect)
|
let called = Object.values(this.heros).filter((item: any) => item.uuid != 0)
|
||||||
|
oops.message.dispatchEvent(GameEvent.HeroSelect,{called:called})
|
||||||
}
|
}
|
||||||
|
|
||||||
to_fight(){
|
to_fight(){
|
||||||
@@ -326,6 +326,7 @@ export class MissionComp extends CCComp {
|
|||||||
1:{uuid:0,count:0},
|
1:{uuid:0,count:0},
|
||||||
2:{uuid:0,count:0},
|
2:{uuid:0,count:0},
|
||||||
}
|
}
|
||||||
|
|
||||||
this.clear_time()
|
this.clear_time()
|
||||||
this.hide_wave_time()
|
this.hide_wave_time()
|
||||||
this.tals={
|
this.tals={
|
||||||
|
|||||||
Reference in New Issue
Block a user