抽卡:免费抽卡次数
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { ActivityModelType } from '../../db/Activity';
|
||||
import { UserGachaType } from '../../db/UserGacha';
|
||||
import { DicGacha } from '../../pubUtils/dictionary/DicGacha';
|
||||
import { RewardInter } from '../../pubUtils/interface';
|
||||
import { ActivityBase } from './activityField';
|
||||
|
||||
interface NewHeroGachaItemInDb {
|
||||
@@ -24,7 +26,8 @@ export class NewHeroGachaData extends ActivityBase {
|
||||
uiType: number;
|
||||
pickHero: number = 0;
|
||||
count: number = 0;
|
||||
freeCount: number = 0;
|
||||
isFree: boolean = false; // 免费次数
|
||||
cost: RewardInter[] = []; // 消耗
|
||||
|
||||
constructor(activityData: ActivityModelType, createTime: number, serverTime: number) {
|
||||
super(activityData, createTime, serverTime)
|
||||
@@ -45,11 +48,13 @@ export class NewHeroGachaData extends ActivityBase {
|
||||
}
|
||||
|
||||
//解析玩家记录
|
||||
public setPlayerRecords(data: UserGachaType) {
|
||||
if (!data) return;
|
||||
this.pickHero = data.pickHero;
|
||||
this.count = data.count;
|
||||
this.freeCount = data.freeCount;
|
||||
public setPlayerRecords(data: UserGachaType, dic: DicGacha) {
|
||||
if(dic) this.cost = dic.cost;
|
||||
if (data) {
|
||||
this.pickHero = data.pickHero;
|
||||
this.count = data.count;
|
||||
this.isFree = data.freeCount < dic?.free.count;
|
||||
}
|
||||
}
|
||||
|
||||
public isPickHero(hid: number) {
|
||||
|
||||
Reference in New Issue
Block a user