武将战力计算(进阶,穿戴,羁绊,好感)加道具
This commit is contained in:
@@ -120,6 +120,8 @@ function parseJobData() {
|
||||
const jobsData = gamedata['jsons'][jobFile] || [];
|
||||
jobsData.forEach(elem => {
|
||||
if (elem && elem.jobid) {
|
||||
elem.seids = elem.seid.split('&');
|
||||
delete elem.seid;
|
||||
jobInfos.set(elem.jobid, elem);
|
||||
let jobClass = jobClassMaxGrades.get(elem.job_class);
|
||||
if (!!jobClass && jobClass.grade < elem.grade) {
|
||||
@@ -269,6 +271,15 @@ function parseFashions() {
|
||||
const data = gamedata['jsons'][file] || [];
|
||||
data.forEach(elem => {
|
||||
if (elem && elem.id) {
|
||||
elem.actorAttrs = [];
|
||||
let actorAttrs = elem.actorAttr.split('|');
|
||||
for (let attr of actorAttrs) {
|
||||
let attrArr = attr.split('&');
|
||||
elem.actorAttrs.push({
|
||||
id: parseInt(attrArr[0]),
|
||||
number: parseInt(attrArr[1]),
|
||||
});
|
||||
}
|
||||
fashions.set(elem.id, elem);
|
||||
}
|
||||
});
|
||||
@@ -279,8 +290,16 @@ function parseFiendShips() {
|
||||
const data = gamedata['jsons'][file] || [];
|
||||
data.forEach(elem => {
|
||||
if (elem && elem.id) {
|
||||
let hids = elem.memberId.split('&');
|
||||
elem.hids = hids;
|
||||
elem.attributes = [];
|
||||
elem.hids = elem.memberId.split('&');
|
||||
let attributes = elem.attribute.split('|');
|
||||
for (let attr of attributes) {
|
||||
let attrArr = attr.split('&');
|
||||
elem.attributes.push({
|
||||
id: parseInt(attrArr[0]),
|
||||
number: parseInt(attrArr[1]),
|
||||
});
|
||||
}
|
||||
delete elem.memberId;
|
||||
fiendShips.set(elem.shipId + '_' + elem.level, elem);
|
||||
let fiendShipHidAandId = fiendShipHidAandIds.get(elem.shipId);
|
||||
|
||||
+25
-1
@@ -410,4 +410,28 @@ export function getItems(str:string) {
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
export function deepCopy (obj) {
|
||||
if (typeof obj !== 'object' || obj === null) {
|
||||
return obj;
|
||||
}
|
||||
var target;
|
||||
if (obj instanceof Array) {
|
||||
target = [];
|
||||
obj.forEach(element => {
|
||||
target.push(deepCopy(element));
|
||||
});
|
||||
} else {
|
||||
target = {};
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
const element = obj[key];
|
||||
if (!!element || element == 0) {
|
||||
target[key] = deepCopy(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
};
|
||||
Reference in New Issue
Block a user