抽卡:添加获取抽卡数据函数
This commit is contained in:
30
game-server/app/services/gachaService.ts
Normal file
30
game-server/app/services/gachaService.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { GachaData } from "../domain/activityField/gachaField";;
|
||||
import { ActivityModelType, ActivityModel } from "../db/Activity";
|
||||
|
||||
/**
|
||||
* 获取活动页签里的限时卡池
|
||||
*
|
||||
* @param aid 活动id
|
||||
*/
|
||||
export async function getLimitGacha(activityId: number) {
|
||||
|
||||
let activityData: ActivityModelType = await ActivityModel.findActivity(activityId, true);
|
||||
if(!activityData) return false;
|
||||
|
||||
let gachaData = new GachaData(activityData);
|
||||
|
||||
let { heroes, gachaId } = gachaData;
|
||||
|
||||
return {
|
||||
gachaId,
|
||||
heroes,
|
||||
pickHero: 0,
|
||||
freeCount: 0,
|
||||
refFreeTime: 0,
|
||||
count: 0,
|
||||
floor: [{
|
||||
id: 3,
|
||||
count: 0
|
||||
}]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user