合成藏宝图,消耗品单独开表
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
*/
|
||||
|
||||
import { BattleDropModel } from '../db/BattleDrop';
|
||||
import { getWarById, getBluePrtByQuality } from '../pubUtils/gamedata';
|
||||
import { getWarById, getBluePrtByQuality, getGamedata } from '../pubUtils/gamedata';
|
||||
import { decodeStr, getRefTime, getRandomWithWeight, getRandomByLen } from '../pubUtils/util';
|
||||
import { BATTLE_REWARD_TYPE, BLUEPRT_CONST, BLUEPRT_CHANCE } from '../consts/consts';
|
||||
import { BATTLE_REWARD_TYPE, BLUEPRT_CONST } from '../consts/consts';
|
||||
import { handleReward } from './rewardService';
|
||||
import { BattleBlueprtDropModel } from '../db/BattleBlueprtDrop'
|
||||
import { RoleModel } from '../db/Role';
|
||||
@@ -127,7 +127,6 @@ export class WarReward {
|
||||
}
|
||||
|
||||
private async handlerBlueprtReward(num: number) {
|
||||
|
||||
const refTime = getRefTime(new Date(), BLUEPRT_CONST.REFRESH_TIME);
|
||||
const battleBlueprtDrop = await BattleBlueprtDropModel.findByTime(this.roleId, refTime);
|
||||
if(battleBlueprtDrop) {
|
||||
@@ -164,10 +163,12 @@ export class WarReward {
|
||||
|
||||
private async randomBlueprt() {
|
||||
const { lv } = await RoleModel.findByRoleId(this.roleId);
|
||||
const result = BLUEPRT_CHANCE.find(cur => {return cur.min <= lv && cur.max >= lv});
|
||||
const dicPossibility = getGamedata('dic_blueprt_possibility');
|
||||
|
||||
const result = dicPossibility.find(cur => {return cur.min <= lv && cur.max >= lv});
|
||||
|
||||
if(result) {
|
||||
const dicOdds = decodeStr('possibility', result.chance);
|
||||
const dicOdds = decodeStr('possibility', result.possibility);
|
||||
const {dic: {id}} = getRandomWithWeight(dicOdds);
|
||||
|
||||
const blueprtList = getBluePrtByQuality(id);
|
||||
|
||||
Reference in New Issue
Block a user