✨ feat(gvg): 遗迹驻扎阵容优化
This commit is contained in:
@@ -164,6 +164,18 @@ export async function checkHeroIsUsedInOtherVestige(roleId: string, curVestigeId
|
||||
return false;
|
||||
}
|
||||
|
||||
// 是否保存过阵容之后换了人了(保存过阵容之后只能换位置,不能再换武将)
|
||||
export async function checkHeroChangeInVestige(roleId: string, curVestigeId: number, heroes: { actorId: number }[]) {
|
||||
let myDatasInVestige = await GVGVestigeRankModel.findByRole(curVestigeId, roleId);
|
||||
if(!myDatasInVestige || !myDatasInVestige.hasDefense) return false;
|
||||
let usedHeroes = myDatasInVestige.lineup||[];
|
||||
for(let { actorId } of heroes) {
|
||||
let hasHero = usedHeroes.find(cur => cur.actorId == actorId);
|
||||
if(!hasHero) return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 检查我的排名是否可以挑战对方的排名
|
||||
export function checkVestigeRank(myRank: number, targetRank: number) {
|
||||
let dicRange = getGVGVestigeRange(myRank);
|
||||
|
||||
Reference in New Issue
Block a user