✨ feat(兼容): 配表使用后台隐藏物品
This commit is contained in:
@@ -57,7 +57,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, getRandEelm, readTsFile, getRandEelmWithWeight, getRandSingleEelm } from "./util";
|
||||
import { decodeIdCntArrayStr, parseGoodStr, decodeArrayListStr, getRandEelm, readTsFile, getRandSingleEelm } from "./util";
|
||||
import { RACE_EVENT_TYPE } from "../consts";
|
||||
import { dicShopByType, dicShopItem, loadShop } from "./dictionary/DicShop";
|
||||
import { dicShopType, loadShopType } from "./dictionary/DicShopType";
|
||||
@@ -110,7 +110,6 @@ 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,
|
||||
@@ -654,51 +653,6 @@ export function getTodayGuildActivity() {
|
||||
return dic;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据军团活动排名获得奖励
|
||||
* @param aid 活动id
|
||||
* @param rank 排名
|
||||
*/
|
||||
function getGuildAuction(aid: number, rank: number, struLv: number, cityId: number = 0) {
|
||||
let ranksReward = gameData.guildAuction.get(`${aid}_${struLv}_${cityId}`) || [];
|
||||
return ranksReward.find(cur => {
|
||||
return rank >= cur.min && (rank <= cur.max || cur.max == 0);
|
||||
});
|
||||
}
|
||||
|
||||
export function getGuildAuctionRewards(aid: number, rank: number, struLv: number, cityId: number = 0) {
|
||||
let dic = getGuildAuction(aid, rank, struLv, cityId);
|
||||
if(dic) {
|
||||
return getAuctionRewardByPoolId(dic.rewards);
|
||||
} else {
|
||||
return new Map();
|
||||
}
|
||||
}
|
||||
|
||||
export function getGuildAuctionBasicNum(aid: number, rank: number, struLv: number, cityId: number = 0) {
|
||||
let dic = getGuildAuction(aid, rank, struLv, cityId);
|
||||
return dic?.basicDividend||0;
|
||||
}
|
||||
|
||||
export function getAuctionRewardByPoolId(poolId: number) {
|
||||
let pools = gameData.auctionPool.get(poolId);
|
||||
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) {
|
||||
let { id, count } = result.dic;
|
||||
if(!rewards.has(id)) {
|
||||
rewards.set(id, []);
|
||||
}
|
||||
rewards.get(id).push({ goods: {id, count}, basePrice, maxPrice, sort });
|
||||
}
|
||||
}
|
||||
}
|
||||
return rewards;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据军团活动排名获得功勋奖励
|
||||
* @param type 城池类型
|
||||
|
||||
Reference in New Issue
Block a user