✨ feat(副将): pvp相关副将设置
This commit is contained in:
@@ -30,6 +30,8 @@ export class OppPlayerHeroInfo {
|
||||
order: number; // 行动顺序
|
||||
@prop({ required: true })
|
||||
ce: number; // 战力
|
||||
@prop({ required: true })
|
||||
subHid: number; // 副将
|
||||
|
||||
setByWarJson(warJson: DicWarJson) {
|
||||
this.hid = warJson.actorId;
|
||||
@@ -51,7 +53,7 @@ export class OppPlayerHeroInfo {
|
||||
}
|
||||
}
|
||||
|
||||
setByDefenseHero(hero: HeroType, lineup: {actorId: number, dataId: number, order: number}[]) {
|
||||
setByDefenseHero(hero: HeroType, lineup: {actorId: number, dataId: number, order: number, subHid: number}[]) {
|
||||
this.hid = hero.hid;
|
||||
this.skinId = hero.skinId;
|
||||
this.quality = hero.quality;
|
||||
@@ -63,6 +65,7 @@ export class OppPlayerHeroInfo {
|
||||
if(curLineup) {
|
||||
this.dataId = curLineup.dataId;
|
||||
this.order = curLineup.order;
|
||||
this.subHid = curLineup.subHid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +119,7 @@ export class OppPlayerInfo {
|
||||
this.leagueName = league.name;
|
||||
}
|
||||
|
||||
setPlayerHeroes(heroes: HeroType[], lineup: {actorId: number, dataId: number, order: number}[]) {
|
||||
setPlayerHeroes(heroes: HeroType[], lineup: {actorId: number, dataId: number, order: number, subHid: number}[]) {
|
||||
for(let hero of heroes) {
|
||||
let obj = new OppPlayerHeroInfo();
|
||||
obj.setByDefenseHero(hero, lineup);
|
||||
@@ -174,7 +177,7 @@ export class OppDetailHeroData {
|
||||
subActorId: number = 0;
|
||||
artifact: HeroArtifact[] = [];
|
||||
|
||||
constructor(warJson: DicWarJson, defensHero: OppPlayerHeroInfo, hero: HeroType, artifacts: ArtifactModelType[]) {
|
||||
constructor(warJson: DicWarJson, defensHero: OppPlayerHeroInfo, hero: HeroType, artifacts: ArtifactModelType[], subHero: HeroType) {
|
||||
this.dataId = warJson.dataId;
|
||||
this.relation = warJson.relation;
|
||||
this.dirction = warJson.dirction;
|
||||
@@ -201,12 +204,14 @@ export class OppDetailHeroData {
|
||||
let skin = hero.skins.find(cur => cur.enable);
|
||||
if(skin) this.talent = skin.talent;
|
||||
this.job = hero.job;
|
||||
this.subHid = hero.subHid;
|
||||
this.subActorId = hero.subActorId;
|
||||
let artifact = artifacts.find(cur => cur.seqId == hero.artifact);
|
||||
if(artifact) this.artifact.push({ artifactId: artifact.artifactId, lv: artifact.lv });
|
||||
}
|
||||
}
|
||||
if(subHero) {
|
||||
this.subHid = subHero?.skinId||0;
|
||||
this.subActorId = subHero?.hid||0;
|
||||
}
|
||||
}
|
||||
|
||||
setAttribute(attribute: string) {
|
||||
@@ -240,7 +245,8 @@ export class OppDetailData{
|
||||
let defenseHero = defenseHeroes.find(cur => cur.dataId == warJson.dataId);
|
||||
if(!defenseHero) continue;
|
||||
let curHero = heroes.find(cur => cur.hid == defenseHero.hid);
|
||||
let hero = new OppDetailHeroData(warJson, defenseHero, curHero, artifacts);
|
||||
let subHero = defenseHero.subHid? heroes.find(cur => cur.hid == defenseHero.subHid): null;
|
||||
let hero = new OppDetailHeroData(warJson, defenseHero, curHero, artifacts, subHero);
|
||||
this.heroes.push(hero);
|
||||
this.lineupCe += curHero.ce;
|
||||
}
|
||||
|
||||
@@ -775,6 +775,7 @@ export class MyTeamSimpleInfo {
|
||||
actorId: number; // 武将
|
||||
dataId: number; // 出兵表上的位置
|
||||
order: number; // 行动
|
||||
subHid: number;
|
||||
}[];
|
||||
hasConfirm: boolean;
|
||||
|
||||
@@ -784,7 +785,7 @@ export class MyTeamSimpleInfo {
|
||||
this.head = team.head;
|
||||
this.frame = team.frame;
|
||||
this.spine = team.spine;
|
||||
this.lineup = team.lineup.map(({ actorId, dataId, outIndex }) => ({ actorId, dataId, order: outIndex }));
|
||||
this.lineup = team.lineup.map(({ actorId, dataId, outIndex, subActorId }) => ({ actorId, dataId, order: outIndex, subHid: subActorId }));
|
||||
this.hasConfirm = team.confirmConfigId == configId;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user