拍卖行:修改掉落

This commit is contained in:
luying
2021-09-14 15:19:13 +08:00
parent d39fdc970b
commit b77dbe802a
6 changed files with 109 additions and 14 deletions

View File

@@ -68,7 +68,7 @@ import { dicCityActivityReward, loadCityActivityReward } from "./dictionary/DicC
import { dicRaceActivity, dicRaceTypes, loadRaceActivity } from './dictionary/DicRaceActivity';
import { GUILDACTIVITY, RECRUIT } from "./dicParam";
import * as param from "./dicParam";
import { decodeIdCntArrayStr, parseGoodStr, decodeArrayListStr, getRandValueByMinMax, getRandEelm, readTsFile } from "./util";
import { decodeIdCntArrayStr, parseGoodStr, decodeArrayListStr, getRandValueByMinMax, getRandEelm, readTsFile, getRandEelmWithWeight } from "./util";
import { RACE_EVENT_TYPE } from "../consts";
import { dicShop, dicShopItem, loadShop } from "./dictionary/DicShop";
import { dicShopList, loadShopList } from "./dictionary/DicShopList";
@@ -92,6 +92,8 @@ import { dicQuenchByQuality, dicQuenchRangeByQuality, dicQuenchRangeByQualityAnd
import { dicQuenchConsume, loadQuenchConsume } from './dictionary/DicQuenchConsume';
import { dicHoliday, loadHoliday } from './dictionary/DicHoliday';
import { dicExpeditionSubAttr, loadExpeditionSubAttr } from './dictionary/DicExpeditionSubAttr';
import { dicAuctionPool, loadAuctionReward } from './dictionary/DicAuctionReward';
import { pick } from "underscore";
export const gameData = {
blurprtCompose: dicBlueprtCompose,
@@ -228,7 +230,8 @@ export const gameData = {
equipAttributeRatio: new Map<number, number>(),
ceRatio: new Array<{type: number, val: number}>(),
holiday: dicHoliday,
expeditionSubAttr: dicExpeditionSubAttr
expeditionSubAttr: dicExpeditionSubAttr,
auctionPool: dicAuctionPool
};
// 在此提供一些原先在gamedata中提供的方法以便更方便获取gameData数据
@@ -579,7 +582,25 @@ export function getGuildAuctionRewards(aid: number, rank: number) {
let dic = ranksReward.find(cur => {
return rank >= cur.min && (rank <= cur.max || cur.max == 0);
});
return dic ? dic.rewards : new Array<RewardInter>();
if(dic) {
return getAuctionRewardByPoolId(dic.rewards);
} else {
return []
}
}
export function getAuctionRewardByPoolId(poolId: number) {
let pools = gameData.auctionPool.get(poolId);
let rewards: RewardInter[] = [];
for(let { count, basicPool } of pools) {
for(let i = 0; i < count; i++) {
let result = getRandEelmWithWeight(basicPool);
if(result && result.dic) {
rewards.push(pick(result.dic, ['id', 'count']));
}
}
}
return rewards;
}
/**
@@ -872,6 +893,7 @@ function loadDatas() {
loadEquipAttributeRatio();
loadHoliday();
loadExpeditionSubAttr();
loadAuctionReward();
}
// 重载dicParam