养成:声望溢出

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
@@ -498,15 +498,12 @@ export class HeroHandler {
for (let { id, count } of originalConsumes) { for (let { id, count } of originalConsumes) {
let dicGoods = gameData.goods.get(id); let dicGoods = gameData.goods.get(id);
if (!dicGoods) return resResult(STATUS.DIC_DATA_NOT_FOUND); if (!dicGoods) return resResult(STATUS.DIC_DATA_NOT_FOUND);
let _count = Math.ceil(needExp / dicGoods.value); let needCount = Math.ceil(needExp / dicGoods.value);
if (_count < count) { if(needCount <= 0) break;
material.push({ id, count: _count }); if(needCount > count) needCount = count;
newExp += dicGoods.value * _count; material.push({ id, count: needCount });
break; newExp += dicGoods.value * needCount;
} else { needExp -= dicGoods.value * count;
material.push({ id, count });
newExp += dicGoods.value * count;
}
} }
if (newExp == oldExp) { if (newExp == oldExp) {
+1 -1
View File
@@ -292,7 +292,7 @@ export const STATUS = {
HERO_CONECTION_IS_MAX_LEVEL: { code: 30306, simStr: '羁绊已达到最大等级' }, HERO_CONECTION_IS_MAX_LEVEL: { code: 30306, simStr: '羁绊已达到最大等级' },
HERO_CONECTION_IS_NOT_EXIT: { code: 30307, simStr: '羁绊不存在' }, HERO_CONECTION_IS_NOT_EXIT: { code: 30307, simStr: '羁绊不存在' },
ROLE_SHORT_HERO_CONECTION: { code: 30308, 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: '武将已达到最大的职业阶级' }, HERO_JOB_REACH_MAX_STAGE: { code: 30310, simStr: '武将已达到最大的职业阶级' },
TALENT_HAS_UNLOCKED: { code: 30311, simStr: '该天赋已经解锁' }, TALENT_HAS_UNLOCKED: { code: 30311, simStr: '该天赋已经解锁' },
TALENT_CONDITION_NOT_FIT: { code: 30312, simStr: '天赋解锁条件未达成' }, TALENT_CONDITION_NOT_FIT: { code: 30312, simStr: '天赋解锁条件未达成' },