feat(拍卖行): 只流3个拍品到世界拍卖行

https://bantugame.feishu.cn/wiki/wikcn1qfpNYNUnOvuKiyK69eqqg?lang=zh-CN&open_in_browser=true
This commit is contained in:
luying
2022-10-23 17:49:53 +08:00
parent ecba195051
commit 44787d68a5
8 changed files with 95 additions and 24 deletions

View File

@@ -87,7 +87,6 @@ import { dicWhiteIp, loadWhiteIp } from './dictionary/DicWhiteIp';
import { dicGuildWishReward, loadGuildWishReward } from './dictionary/DicGuildWishReward';
import { dicApiById, dicApiByUrl, loadApi } from './dictionary/DicApi';
import { dicServerConst, loadServerConst } from './dictionary/DicServerConst';
import { pick } from "underscore";
const _ = require("underscore");
import { dicEquipById, dicEquipIdByJobClassAndEplace, loadEquip } from "./dictionary/DicEquip";
import { dicBlueprt, dicBlueprtByLv, dicJewel, loadJewel } from "./dictionary/DicJewel";
@@ -111,6 +110,7 @@ import { dicLadderMatch, loadLadderMatch } from "./dictionary/DicLadderMatch";
import { dicLadderDifficultRatio, loadLadderDifficultRatio } from "./dictionary/DicLadderDifficultRatio";
import { dicLadderRankReward, loadLadderRankReward } from "./dictionary/DicLadderRankReward";
import { dicGeneralGoods, loadGeneralGoods } from "./dictionary/DicGeneralGoods";
import { AuctionRewardInter } from "../domain/battleField/auction";
export const gameData = {
daily: dicDaily,
@@ -671,7 +671,7 @@ export function getGuildAuctionRewards(aid: number, rank: number, cityId: number
if(dic) {
return getAuctionRewardByPoolId(dic.rewards);
} else {
return []
return new Map();
}
}
@@ -682,13 +682,17 @@ export function getGuildAuctionBasicNum(aid: number, rank: number, cityId: numbe
export function getAuctionRewardByPoolId(poolId: number) {
let pools = gameData.auctionPool.get(poolId);
let rewards: { goods: RewardInter, basePrice: number, maxPrice: number, sort: number }[] = [];
let rewards: Map<number, AuctionRewardInter[]> = new Map();
for(let { count, basicPool } of pools) {
let { rewardBasicPool, basePrice, maxPrice, sort } = basicPool
for(let i = 0; i < count; i++) {
let result = getRandEelmWithWeight(rewardBasicPool);
if(result && result.dic) {
rewards.push({ goods: pick(result.dic, ['id', 'count']), basePrice, maxPrice, sort });
let { id, count } = result.dic;
if(!rewards.has(id)) {
rewards.set(id, []);
}
rewards.get(id).push({ goods: {id, count}, basePrice, maxPrice, sort });
}
}
}