抽卡:新武将抽卡接入

This commit is contained in:
luying
2021-07-02 11:05:52 +08:00
parent 1e09f6bc43
commit fc97dc3040
4 changed files with 22 additions and 51 deletions
@@ -12,6 +12,7 @@ import { CreateHeroParam } from "../../domain/roleField/hero";
import { UserGuildType } from "../../db/UserGuild";
import { transPiece } from "../../pubUtils/itemUtils";
import { HeroType } from "../../db/Hero";
import { NewHeroGachaItem } from "../../domain/activityField/newHeroGachaField";
/**
* 获取招募列表
@@ -144,12 +145,14 @@ export class GachaPull {
this.hope = userGacha.hope;
}
// 新武将活动setter
public setByActivity() {
// this.floorCount =
// this.hasGetFloor =
// this.percent =
// this.dicFloorCount =
// this.dicFloor =
public setByActivity(item: NewHeroGachaItem) {
this.floorCount = item.count;
this.hasGetFloor = item.hasGetFloor;
this.percent = item.percent;
this.dicFloorCount = item.floorCount;
if(item.floorReward >= 0) {
this.dicFloor = item.percent[item.floorReward]
}
}
private getFloorResult(base: { id: number, weight: number, goodId?: number }) {
@@ -335,8 +338,7 @@ export class GachaPull {
}
// 活动getter
public getActivityParam() {
// this.hasGetFloor
// this.floorCount
return { hasGetFloor: this.hasGetFloor, floorCount: this.floorCount };
}
}