Revert "revert 50867e88 to a1aabfdd"

This reverts commit a112732226.
This commit is contained in:
luying
2021-07-12 14:47:43 +08:00
parent c4d5bf3edd
commit 30bd43d98e
17 changed files with 6675 additions and 3876 deletions

View File

@@ -14,7 +14,7 @@ import { DicSe } from './dictionary/DicSe';
import { EquipType } from '../db/Equip';
import { DicRandomEffectPool } from './dictionary/DicRandomEffectPool';
import { SchoolModel } from '../db/School';
import { ABI_TYPE_TO_STAGE, ABI_TYPE_MAIN } from '../consts/constModules/abilityConst'
import { ABI_TYPE_TO_STAGE, ABI_TYPE_MAIN, ABI_JOB_STAGE } from '../consts/constModules/abilityConst'
import { PvpDefenseModel } from '../db/PvpDefense';
import { findIndex } from 'underscore';
import { GuildModel } from '../db/Guild';
@@ -293,7 +293,8 @@ export function calHeroStarIncAttr(originHero: HeroType, update: HeroUpdate, typ
if(starStage == ABI_STAGE.START) star--;
if(colorStarStage == ABI_STAGE.START) colorStar--;
const dicStar = isWake ? getHeroWakeByQuality(dicHero.quality, colorStar) : getHeroStarByQuality(quality, star); // 星级表
const dicJob = gameData.job.get(dicHero.jobid);
const dicStar = isWake ? getHeroWakeByQuality(dicJob.job_class, dicHero.quality, colorStar) : getHeroStarByQuality(dicJob.job_class, quality, star); // 星级表
let stages = new Array<number>(); // 需要升级的阶
@@ -302,14 +303,28 @@ export function calHeroStarIncAttr(originHero: HeroType, update: HeroUpdate, typ
} else if (type == HERO_SYSTEM_TYPE.LVUP) {
stages = getAllAttrStage();
} else if (type == HERO_SYSTEM_TYPE.STAR) {
stages.push(isUpStar? ABI_STAGE.END: starStage);
let end = isUpStar? ABI_STAGE.END: starStage;
if(end < originStarStage) {
stages = getAllAttrStage();
} else {
for(let i = originStarStage; i < end; i++) {
stages.push(i + 1);
}
}
} else if (type == HERO_SYSTEM_TYPE.QUALITY) {
stages = getAllAttrStage();
} else if (type = HERO_SYSTEM_TYPE.COLORSTAR) {
if (isFirstWake) { // 首次觉醒
stages = getAllAttrStage();
} else {
stages.push(isUpStar ? ABI_STAGE.END : colorStarStage);
let end = isUpStar? ABI_STAGE.END: colorStarStage;
if(end < originColorStarStage) {
stages = getAllAttrStage();
} else {
for(let i = originColorStarStage; i < end; i++) {
stages.push(i + 1);
}
}
}
}
for (let stage of stages) {
@@ -427,17 +442,18 @@ export function calHeroTrainIncAttr(originHero: HeroType, update: HeroUpdate) {
let { attr: heroAttrs, job: oldJob, jobStage: oldJobStage } = originHero;
let { job = oldJob, jobStage = oldJobStage } = update;
let targetAttrId = ABI_TYPE_TO_STAGE.get(jobStage); // 转换为18维的属性id
let dicJob = gameData.job.get(job);
if (dicJob.grade > 1) {
if (dicJob.grade >= 1) {
let jobGradeAndClass = getJobByGradeAndClass(dicJob.job_class, dicJob.grade - 1);
let lastJob = gameData.job.get(jobGradeAndClass.jobid);
let inc = (dicJob.ceAttr.get(jobStage) - lastJob.ceAttr.get(jobStage)) * HERO_CE_RATIO;
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp: inc } })
let targetAttrId = dicJob.ceAttr.get(jobStage).id;
let inc = (dicJob.ceAttr.get(jobStage).attr - lastJob.ceAttr.get(jobStage).attr) * HERO_CE_RATIO;
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp: inc } });
} else {
let inc = dicJob.ceAttr.get(jobStage) * HERO_CE_RATIO;
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp: inc } })
let targetAttrId = dicJob.ceAttr.get(jobStage).id;
let inc = dicJob.ceAttr.get(jobStage).attr * HERO_CE_RATIO;
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp: inc } });
}
return heroAttrs;
}
@@ -489,14 +505,15 @@ export function calHeroJobAttr(originHero: HeroType, hero: HeroUpdate, addSeidLi
lastJob = gameData.job.get(jobGradeAndClass.jobid);
}
for (let stage = ABI_STAGE.START + 1; stage <= ABI_STAGE.END; stage++) {
let targetAttrId = ABI_TYPE_TO_STAGE.get(stage);
for (let stage = ABI_JOB_STAGE.START; stage < ABI_JOB_STAGE.END; stage++) {
if(hero.jobStage >= stage) {
let fixUp = currentJob.ceAttr.get(stage) * HERO_CE_RATIO;
let targetAttrId = currentJob.ceAttr.get(stage).id;
let fixUp = currentJob.ceAttr.get(stage).attr * HERO_CE_RATIO;
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp }})
} else {
if(lastJob) {
let fixUp = lastJob.ceAttr.get(stage) * HERO_CE_RATIO;
let targetAttrId = lastJob.ceAttr.get(stage).id;
let fixUp = lastJob.ceAttr.get(stage).attr * HERO_CE_RATIO;
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp } });
}
}