This commit is contained in:
aozhiwei 2022-09-21 17:39:07 +08:00
parent 985038a3f1
commit 1cc5337847

View File

@ -133,12 +133,23 @@ class Fragment {
} }
break; break;
}//end switch }//end switch
const data = allocedFragments.get(key);
constant.ALL_HERO_FRAGMENT.forEach( constant.ALL_HERO_FRAGMENT.forEach(
(element) => { (element) => {
if (element == constant.SPEC_HERO_FRAGMENT) { if (element == constant.SPEC_HERO_FRAGMENT) {
const allocedNum = data.get(element);
let remainNum = Math.floor(value.get('specHeroNum') / remainHour);
if (allocedNum) {
remainNum = Math.max(0, remainNum - allocedNum);
}
value.set(element, remainNum);
} else { } else {
const allocedNum = data.get(element);
let remainNum = Math.floor(value.get('normalHeroNum') / remainHour);
if (allocedNum) {
remainNum = Math.max(0, remainNum - allocedNum);
}
value.set(element, remainNum);
} }
} }
); );