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