招募:引导特殊招募功能

This commit is contained in:
luying
2021-11-16 18:06:39 +08:00
parent d48792390e
commit 0d54e3058b
6 changed files with 213 additions and 3 deletions
@@ -309,6 +309,29 @@ export class GachaPull {
return { items, heroInfo, resultList, activityData }
}
public pullBySimpleResult(simpleResult: {contentId: number, hid: number}[]) {
let items: RewardInter[] = [], heroInfo: CreateHeroParam[] = [], resultList: GachaResult[] = [];
let activityData = [];//活动需要统计抽中的英雄、碎片品质
for (let { contentId, hid } of simpleResult) {
let result = new GachaResult(contentId);
result.setHero(hid);
let hasHero = this.userHeroes.find(cur => cur.hid == hid);
if (hasHero) { // 已有转换为碎片
activityData.push({ hid, quality: hasHero.quality });
let { pieceId, count } = transPiece(hid);
result.transferToPiece(pieceId, count);
items.push({ id: pieceId, count });
} else {
heroInfo.push({ hid, count: 1 })//默认1个英雄
}
resultList.push(result);
}
return { items, heroInfo, resultList, activityData }
}
private getPurpleFloor(count: number, index: number, contentId: number, resultList: GachaResult[]) {
if (this.gachaType == GACHA_ID.NORMAL && count == 10 && index == count - 1) { // 10连到最后一抽
let { type, param } = gameData.gachaContent.get(contentId);