Merge branch 'feature/ce'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { getRandEelm, } from '../pubUtils/util';
|
||||
import { EPlace, Stone } from "../db/Hero";
|
||||
import { gameData, getRandEffectByGroupAndLevel } from "../pubUtils/data";
|
||||
import { gameData, getJewelConditionByLvAndSeId, getRandEffectByGroupAndLevel } from "../pubUtils/data";
|
||||
import { JewelType, RandSe } from '../db/Jewel';
|
||||
import { DicRandomEffectPool } from '../pubUtils/dictionary/DicRandomEffectPool';
|
||||
import { getJewelRandSe } from './role/rewardService';
|
||||
@@ -126,4 +126,18 @@ export function getJewelByEquip(oldEquip: EPlace, newEquip: EPlace, jewels: Jewe
|
||||
let oldJewel = jewels.find(cur => cur && cur.seqId == oldEquip.jewel);
|
||||
let newJewel = jewels.find(cur => cur && cur.seqId == newEquip.jewel);
|
||||
return { oldJewel, newJewel }
|
||||
}
|
||||
|
||||
export function isRandSeUnLock(jewelId: number, randSeId: number, stones: Stone[]) {
|
||||
let dicJewel = gameData.jewel.get(jewelId);
|
||||
let dicJewelCondition = getJewelConditionByLvAndSeId(dicJewel.lv, randSeId);
|
||||
let stoneCnt = 0, stoneLv = 0;
|
||||
for(let { stone } of stones) {
|
||||
let dicStone = gameData.stone.get(stone);
|
||||
if(dicStone) {
|
||||
stoneCnt++;
|
||||
stoneLv += dicStone.lv;
|
||||
}
|
||||
}
|
||||
return stoneCnt >= dicJewelCondition.stoneCnt && stoneLv >= dicJewelCondition.stoneLv;
|
||||
}
|
||||
Reference in New Issue
Block a user