羁绊:修改武将羁绊格式
This commit is contained in:
@@ -7,7 +7,7 @@ import { SCHOOL } from '../pubUtils/dicParam';
|
||||
import { gameData, getHeroInitTalent } from '../pubUtils/data';
|
||||
import { SchoolModel } from '../db/School';
|
||||
import { SclResultInter, SclPosInter, RewardInter, ItemInter } from '../pubUtils/interface';
|
||||
import { HeroModel, HeroSkin, HeroUpdate, Talent } from '../db/Hero';
|
||||
import { Connect, HeroModel, HeroSkin, HeroUpdate, Talent } from '../db/Hero';
|
||||
import { SkinUpdate } from '../db/Skin';
|
||||
import { Figure } from '../domain/dbGeneral';
|
||||
import { pick } from 'underscore';
|
||||
@@ -165,6 +165,23 @@ export function addConsumeToHero(oldConsume: Reward[] = [], consumes: ItemInter[
|
||||
return newConsume;
|
||||
}
|
||||
|
||||
export function addConnect(connections: Connect[], curConnect: Connect) {
|
||||
let newConnections: Connect[] = [];
|
||||
let index = -1;
|
||||
for(let i = 0; i < connections.length; i++) {
|
||||
if(connections[i].shipId == curConnect.shipId) {
|
||||
index = i;
|
||||
newConnections.push(curConnect);
|
||||
} else {
|
||||
newConnections.push(connections[i]);
|
||||
}
|
||||
}
|
||||
if(index == -1) {
|
||||
newConnections.push(curConnect);
|
||||
}
|
||||
return newConnections;
|
||||
}
|
||||
|
||||
export function checkUnlockTalentCondition(hid: number, id: number, talents: Talent[], usedTalentPoint: number) {
|
||||
let dicHero = gameData.hero.get(hid);
|
||||
let dicHeroTalent = gameData.heroTalent.get(id);
|
||||
|
||||
Reference in New Issue
Block a user