基础表
This commit is contained in:
@@ -89,7 +89,7 @@ export function calPlayerCe(globalCeAttr: CeAttrRole, hero: HeroType, type: numb
|
||||
heroCe += attrNumber * getAttrCeRatio(attrName);
|
||||
}
|
||||
let incCe = heroCe - hero.ce;
|
||||
hero.ce = heroCe > 0?heroCe:1;
|
||||
hero.ce = heroCe > 0 ? heroCe : 1;
|
||||
if (hero.historyCe < hero.ce) hero.historyCe = hero.ce;
|
||||
return incCe;
|
||||
}
|
||||
@@ -122,28 +122,28 @@ export async function calPlayerCeAndSave(roleId: string, heros: Array<HeroType>,
|
||||
}
|
||||
|
||||
async function calculateTopFive(role: RoleType, hid: number, ce: number) {
|
||||
let topFive = role?.topFive||new Array();
|
||||
let topFive = role?.topFive || new Array();
|
||||
|
||||
topFive.sort((a, b) => {return b.ce - a.ce}); // 0-5,最大-最小
|
||||
topFive.sort((a, b) => { return b.ce - a.ce }); // 0-5,最大-最小
|
||||
let index = topFive.findIndex(cur => cur.hid == hid);
|
||||
if(index == -1) { // 不在最强列表
|
||||
if(topFive.length < 5) { // 不满5人
|
||||
topFive.push({hid, ce});
|
||||
} else if(topFive.length == 5){
|
||||
if(ce > topFive[topFive.length - 1].ce) { // 跻身最强5人
|
||||
topFive.pop();
|
||||
topFive.push({hid, ce});
|
||||
if (index == -1) { // 不在最强列表
|
||||
if (topFive.length < 5) { // 不满5人
|
||||
topFive.push({ hid, ce });
|
||||
} else if (topFive.length == 5) {
|
||||
if (ce > topFive[topFive.length - 1].ce) { // 跻身最强5人
|
||||
topFive.pop();
|
||||
topFive.push({ hid, ce });
|
||||
}
|
||||
} else {
|
||||
topFive.splice(5, topFive.length - 5);
|
||||
}
|
||||
} else {
|
||||
topFive.splice(5, topFive.length - 5);
|
||||
}
|
||||
} else { // 原来就是最强5人
|
||||
if(ce < topFive[topFive.length - 1].ce) { // 滑出最强
|
||||
let heroes = await HeroModel.getTopHero(role.roleId, 5);
|
||||
topFive = heroes.map(cur => {return {hid: cur.hid, ce: cur.ce}});
|
||||
} else {
|
||||
topFive[index].ce = ce;
|
||||
}
|
||||
if (ce < topFive[topFive.length - 1].ce) { // 滑出最强
|
||||
let heroes = await HeroModel.getTopHero(role.roleId, 5);
|
||||
topFive = heroes.map(cur => { return { hid: cur.hid, ce: cur.ce } });
|
||||
} else {
|
||||
topFive[index].ce = ce;
|
||||
}
|
||||
}
|
||||
|
||||
let topFiveCe = topFive.reduce((pre, cur) => {
|
||||
@@ -196,10 +196,10 @@ export function calHeroStarIncAttr(hero: HeroType, type: number, hid: number, ar
|
||||
const dicHero = gameData.hero.get(hero.hid);
|
||||
|
||||
const isWake = colorStar > 0; // 是否觉醒,只要激活了觉醒,彩星就会 > 1
|
||||
if(isWake) {
|
||||
if(colorStarStage == ABI_STAGE.START) originColorStar = colorStar - 1;
|
||||
if (isWake) {
|
||||
if (colorStarStage == ABI_STAGE.START) originColorStar = colorStar - 1;
|
||||
} else {
|
||||
if(starStage == ABI_STAGE.START) originStar = star - 1;
|
||||
if (starStage == ABI_STAGE.START) originStar = star - 1;
|
||||
}
|
||||
const dicStar = isWake ? getHeroWakeByQuality(dicHero.quality, originColorStar) : getHeroStarByQuality(quality, originStar); // 星级表
|
||||
|
||||
@@ -229,7 +229,7 @@ export function calHeroStarIncAttr(hero: HeroType, type: number, hid: number, ar
|
||||
starUp = dicStar.ceAttr.get(stage);
|
||||
}
|
||||
|
||||
let newBase = (heroAttr + hero.lv * (heroUpAttr + starUp)) * HERO_CE_RATIO;
|
||||
let newBase = (heroAttr + (hero.lv - 1) * (heroUpAttr + starUp)) * HERO_CE_RATIO;
|
||||
let field = getAtrrNameById(targetAttrId);
|
||||
let ceAttrData: CeAttrData = ceAttr[field] || new CeAttrData(); // 存表中的属性下的base,fixup,ratioup
|
||||
let { ratioUp = 0, fixUp = 0 } = ceAttrData;
|
||||
@@ -317,9 +317,9 @@ export function calHeroJobAttr(hero: HeroType, res: CeAttr, addSeidList: Array<n
|
||||
if (!!jobGradeAndClass) {
|
||||
lastJob = gameData.job.get(jobGradeAndClass.jobid);
|
||||
}
|
||||
for (let key in HEROTARIN) {
|
||||
for (let key in HEROTARIN) {
|
||||
let attrName: string = HEROTARIN[key];
|
||||
res[attrName] = res[attrName]||{ fixUp: hero.ceAttr[attrName].fixUp, base: hero.ceAttr[attrName].base, ratioUp: hero.ceAttr[attrName].ratioUp };
|
||||
res[attrName] = res[attrName] || { fixUp: hero.ceAttr[attrName].fixUp, base: hero.ceAttr[attrName].base, ratioUp: hero.ceAttr[attrName].ratioUp };
|
||||
if (hero.jobStage >= parseInt(key)) {
|
||||
res[attrName].fixUp += currentJob[attrName] * HERO_CE_RATIO;
|
||||
} else {
|
||||
@@ -332,21 +332,21 @@ export function calHeroJobAttr(hero: HeroType, res: CeAttr, addSeidList: Array<n
|
||||
}
|
||||
|
||||
//穿戴时装
|
||||
export function calHeroWearSkinIncAttr(hero: HeroType, args: Array<number>, addSeidList: Array<number>, removeSeidList: Array<number>, isInit = false, heroAttr?:CeAttr) {
|
||||
let res: CeAttr = heroAttr||{};
|
||||
export function calHeroWearSkinIncAttr(hero: HeroType, args: Array<number>, addSeidList: Array<number>, removeSeidList: Array<number>, isInit = false, heroAttr?: CeAttr) {
|
||||
let res: CeAttr = heroAttr || {};
|
||||
let addSkin = gameData.fashion.get(args[0]);
|
||||
let delSkin = gameData.fashion.get(args[1]);
|
||||
let attrName: string;
|
||||
if (delSkin) {
|
||||
for (let attr of delSkin.actorAttr) {
|
||||
attrName = getAtrrNameById(attr.id);
|
||||
res[attrName] = res[attrName]||{ fixUp: hero.ceAttr[attrName].fixUp, base: hero.ceAttr[attrName].base, ratioUp: hero.ceAttr[attrName].ratioUp };
|
||||
res[attrName] = res[attrName] || { fixUp: hero.ceAttr[attrName].fixUp, base: hero.ceAttr[attrName].base, ratioUp: hero.ceAttr[attrName].ratioUp };
|
||||
res[attrName].fixUp -= attr.number * HERO_CE_RATIO;
|
||||
}
|
||||
}
|
||||
for (let attr of addSkin.actorAttr) {
|
||||
attrName = getAtrrNameById(attr.id);
|
||||
res[attrName] = res[attrName]||{ fixUp: hero.ceAttr[attrName].fixUp, base: hero.ceAttr[attrName].base, ratioUp: hero.ceAttr[attrName].ratioUp };
|
||||
res[attrName] = res[attrName] || { fixUp: hero.ceAttr[attrName].fixUp, base: hero.ceAttr[attrName].base, ratioUp: hero.ceAttr[attrName].ratioUp };
|
||||
res[attrName].fixUp += attr.number * HERO_CE_RATIO;
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ export function calHeroEquipIncAttr(hero: HeroType) {
|
||||
// console.log('refine', dicRefine?dicRefine.upPercent:0 );
|
||||
let valueJewel = jewel.get(i) || 0;
|
||||
// console.log('jewel', valueJewel);
|
||||
let attr = (value1 + lv * valueup) * (HERO_CE_RATIO + valueRefine) + valueJewel * HERO_CE_RATIO;
|
||||
let attr = (value1 + (lv - 1) * valueup) * (HERO_CE_RATIO + valueRefine) + valueJewel * HERO_CE_RATIO;
|
||||
|
||||
attrResult[attrName] += attr;
|
||||
}
|
||||
@@ -540,7 +540,7 @@ export function calHeroEquipIncAttr(hero: HeroType) {
|
||||
|
||||
for (let attrName in attrResult) {
|
||||
let originalCe = hero.ceAttr[attrName].equipUp || 0;
|
||||
console.log('装备战力:', attrName, attrResult[attrName] * HERO_CE_RATIO, originalCe);
|
||||
console.log('装备战力:', attrName, attrResult[attrName], originalCe);
|
||||
res[attrName] = { fixUp: hero.ceAttr[attrName].fixUp, base: hero.ceAttr[attrName].base, ratioUp: hero.ceAttr[attrName].ratioUp, equipUp: originalCe };
|
||||
res[attrName].equipUp += attrResult[attrName] - originalCe;
|
||||
}
|
||||
@@ -884,7 +884,7 @@ export function initRoleAtrr(role: RoleType) {
|
||||
return;
|
||||
}
|
||||
|
||||
async function reCalRoleAttr(heros:Array<HeroType>, ceAttr: CeAttrRole, type: number, args: Array<number>) {
|
||||
async function reCalRoleAttr(heros: Array<HeroType>, ceAttr: CeAttrRole, type: number, args: Array<number>) {
|
||||
let reIncAttr: CeAttrRole = {}; // role表属性增量
|
||||
switch (type) {
|
||||
case HERO_SYSTEM_TYPE.INIT:
|
||||
|
||||
@@ -10001,7 +10001,7 @@
|
||||
"pieceId": 42217,
|
||||
"composeMaterial": "&",
|
||||
"specialMaterial": "&",
|
||||
"suitId": 17,
|
||||
"suitId": 0,
|
||||
"decomposeItem": "17049&1",
|
||||
"hole": 1,
|
||||
"randomEffect": "1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20",
|
||||
@@ -10038,7 +10038,7 @@
|
||||
"pieceId": 42218,
|
||||
"composeMaterial": "&",
|
||||
"specialMaterial": "&",
|
||||
"suitId": 19,
|
||||
"suitId": 0,
|
||||
"decomposeItem": "17049&3",
|
||||
"hole": 1,
|
||||
"randomEffect": "1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user