武将:抽象武将创建接口
This commit is contained in:
@@ -187,7 +187,10 @@ export const gameData = {
|
||||
taskBox: dicTaskBox,
|
||||
gacha: dicGacha,
|
||||
gachaContent: dicGachaContent,
|
||||
gachaContentHero: dicGachaContentHero
|
||||
gachaContentHero: dicGachaContentHero,
|
||||
gachaHope: getGachaHopePercent(),
|
||||
gachaTurntable: getGachaTurntablePercent(),
|
||||
heroTransPiece: getHeroTransPiece()
|
||||
};
|
||||
|
||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||
@@ -582,4 +585,29 @@ export function getRandExpedition(cnt = 1) {
|
||||
arr.push(dicExpedition);
|
||||
}
|
||||
return getRandEelm(arr, cnt);
|
||||
}
|
||||
|
||||
// 抽卡心愿单概率
|
||||
function getGachaHopePercent() {
|
||||
let arr = decodeArrayListStr(RECRUIT.RECRUIT_WISH_LIST);
|
||||
return arr.map(cur => {
|
||||
return { id: parseInt(cur[0]), weight: parseInt(cur[1]) }
|
||||
});
|
||||
}
|
||||
|
||||
// 抽卡转盘概率
|
||||
function getGachaTurntablePercent() {
|
||||
let arr = decodeArrayListStr(RECRUIT.RECRUIT_BONUS_HERO_QUANTITY);
|
||||
return arr.map(cur => {
|
||||
return { quality: parseInt(cur[0]), weight: parseInt(cur[1]) }
|
||||
});
|
||||
}
|
||||
|
||||
function getHeroTransPiece() {
|
||||
let map = decodeIdCntArrayStr(RECRUIT.RECRUIT_CHANGE_SHARD, 1);
|
||||
let newMap = new Map<number, number>();
|
||||
for(let [id, count] of map) {
|
||||
newMap.set(parseInt(id), count);
|
||||
}
|
||||
return newMap
|
||||
}
|
||||
Reference in New Issue
Block a user