修复:名将谱战力、活动铜币数量、引导抽卡new问题、未初始推送

This commit is contained in:
luying
2021-12-28 14:53:42 +08:00
parent 5097979bf4
commit 7d5ef79407
8 changed files with 35 additions and 18 deletions
+9 -1
View File
@@ -960,20 +960,28 @@ async function calSchoolStarIncAttr(role: RoleType, heros: HeroType[], type: num
*/
function calScrollAddAttr(role: RoleType,heros: HeroType[], hid: number) {
let { attr: roleAttrs } = role;
console.log('********** calScrollAddAttr', hid)
let curHero = heros.find(cur => cur.hid == hid);
let dicHero = gameData.hero.get(hid);
if (!curHero || !dicHero) return roleAttrs;
let { quality } = dicHero;
let { star, quality: curQuality, colorStar } = curHero;
console.log('********** calScrollAddAttr curHero', star, curQuality, colorStar);
let heroScroll = getScollByStar(quality, star, curQuality, colorStar);
if (!heroScroll) return roleAttrs;
console.log('********** heroScroll', heroScroll);
let isInit = star == dicHero.initialStars && curQuality == dicHero.quality && colorStar == 0;
let preScroll = isInit? null: gameData.preHeroScroll.get(heroScroll.id);
console.log('********** preScroll', preScroll);
let preScroll = gameData.preHeroScroll.get(heroScroll.id);
heroScroll.ceAttr.forEach((add, attrId) => {
let preAdd = preScroll ? preScroll.ceAttr.get(attrId) : 0;
let fixUp = (add - preAdd) * HERO_CE_RATIO;
console.log('********** preAdd', attrId, preAdd, fixUp);
updateRoleAttr(roleAttrs, attrId, { inc: { fixUp } });
});
return roleAttrs;