pvp:随机对手
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 } from "./util";
|
||||
import { decodeIdCntArrayStr, parseGoodStr, decodeArrayListStr, getRandEelm, readTsFile, getRandEelmWithWeight, getRandSingleEelm } from "./util";
|
||||
import { RACE_EVENT_TYPE } from "../consts";
|
||||
import { dicShopByType, dicShopItem, loadShop } from "./dictionary/DicShop";
|
||||
import { dicShopType, loadShopType } from "./dictionary/DicShopType";
|
||||
@@ -425,6 +425,16 @@ export function getGoodById(gid: number) {
|
||||
return gameData.goods.get(gid);
|
||||
}
|
||||
|
||||
export function randomGoodsByItid(itid: number) {
|
||||
let result: number[] = [];
|
||||
for(let [id, dicGoods] of gameData.goods) {
|
||||
if(dicGoods.randomShow == 1 && dicGoods.itid == itid) {
|
||||
result.push(id);
|
||||
}
|
||||
}
|
||||
return getRandSingleEelm(result)
|
||||
}
|
||||
|
||||
export function getHeroJob(jobId: number) {
|
||||
const job = gameData.job.get(jobId);
|
||||
return job;
|
||||
|
||||
Reference in New Issue
Block a user