任务:修复共斗任务达成
This commit is contained in:
@@ -4,10 +4,11 @@ import { HeroModel, HeroType } from '../db/Hero';
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
import { HERO_CE_RATIO, ABI_STAGE } from '../consts';
|
||||
import { HERO_CE_RATIO, ABI_STAGE, GACHA_TO_FLOOR } from '../consts';
|
||||
|
||||
import { findIndex } from 'underscore';
|
||||
import { getWeekDate } from './timeUtil';
|
||||
import { Floor } from '../domain/activityField/gachaField';
|
||||
const randomName = require("chinese-random-name");
|
||||
const moment = require('moment');
|
||||
const crypto = require('crypto');
|
||||
@@ -640,4 +641,24 @@ export function splitString(dataString: string, key: string) {
|
||||
numberArray.push(Number(num));
|
||||
}
|
||||
return numberArray;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 获取抽卡保底状态
|
||||
* @param gachaId 招募类型
|
||||
* @param floor 玩家保底
|
||||
*/
|
||||
export function getFloorStatus(gachaId: number, floor: Floor[]) {
|
||||
let floorMap = new Map<number, number>();
|
||||
for(let { id, count } of floor) {
|
||||
floorMap.set(id, count);
|
||||
}
|
||||
let dicFloorType = GACHA_TO_FLOOR.get(gachaId);
|
||||
return dicFloorType.map(id => {
|
||||
return {
|
||||
id,
|
||||
count: floorMap.get(id)||0
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user