养成:声望溢出

This commit is contained in:
luying
2022-05-25 14:44:18 +08:00
parent 79293c5a4a
commit f1e17dfa4e
2 changed files with 7 additions and 10 deletions

View File

@@ -498,15 +498,12 @@ export class HeroHandler {
for (let { id, count } of originalConsumes) {
let dicGoods = gameData.goods.get(id);
if (!dicGoods) return resResult(STATUS.DIC_DATA_NOT_FOUND);
let _count = Math.ceil(needExp / dicGoods.value);
if (_count < count) {
material.push({ id, count: _count });
newExp += dicGoods.value * _count;
break;
} else {
material.push({ id, count });
newExp += dicGoods.value * count;
}
let needCount = Math.ceil(needExp / dicGoods.value);
if(needCount <= 0) break;
if(needCount > count) needCount = count;
material.push({ id, count: needCount });
newExp += dicGoods.value * needCount;
needExp -= dicGoods.value * count;
}
if (newExp == oldExp) {

View File

@@ -292,7 +292,7 @@ export const STATUS = {
HERO_CONECTION_IS_MAX_LEVEL: { code: 30306, simStr: '羁绊已达到最大等级' },
HERO_CONECTION_IS_NOT_EXIT: { code: 30307, simStr: '羁绊不存在' },
ROLE_SHORT_HERO_CONECTION: { code: 30308, simStr: '未拥有羁绊武将' },
HERO_FAVOUR_LEVEL_REACH_MAXT: { code: 30309, simStr: '武将好感等级达到最大' },
HERO_FAVOUR_LEVEL_REACH_MAXT: { code: 30309, simStr: '武将好感等级达到最大' },
HERO_JOB_REACH_MAX_STAGE: { code: 30310, simStr: '武将已达到最大的职业阶级' },
TALENT_HAS_UNLOCKED: { code: 30311, simStr: '该天赋已经解锁' },
TALENT_CONDITION_NOT_FIT: { code: 30312, simStr: '天赋解锁条件未达成' },