pvp:随机对手
This commit is contained in:
@@ -204,6 +204,21 @@ export function getCurNameById(gid: number) {
|
||||
return currency.type;
|
||||
}
|
||||
|
||||
export function getHeadItid() {
|
||||
let dicItid = itid_array.find(cur => cur.table == 'role' && cur.type == CONSUME_TYPE.HEAD);
|
||||
return dicItid?.id;
|
||||
}
|
||||
|
||||
export function getFrameItid() {
|
||||
let dicItid = itid_array.find(cur => cur.table == 'role' && cur.type == CONSUME_TYPE.FRAME);
|
||||
return dicItid?.id;
|
||||
}
|
||||
|
||||
export function getSpineItid() {
|
||||
let dicItid = itid_array.find(cur => cur.table == 'role' && cur.type == CONSUME_TYPE.SPINE);
|
||||
return dicItid?.id;
|
||||
}
|
||||
|
||||
export enum QUALITY_TYPE {
|
||||
BLUE = 1, // 蓝
|
||||
PURPLE = 2, // 紫
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -34,6 +34,8 @@ export interface DicGoods {
|
||||
readonly image_id: number;
|
||||
// 礼包id
|
||||
readonly gift: number;
|
||||
// 是否可以用于pvp随机
|
||||
readonly randomShow: number;
|
||||
}
|
||||
|
||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||
@@ -51,6 +53,7 @@ const DicGoodsKeys: KeysEnum<DicGoods> = {
|
||||
timeLimit: true,
|
||||
image_id: true,
|
||||
gift: true,
|
||||
randomShow: true,
|
||||
}
|
||||
export const dicGoods = new Map<number, DicGoods>();
|
||||
export const figureCondition = new Map<number, { params: number[], id: number, gid: number }[]>(); // type => {params, id, gid}
|
||||
|
||||
Reference in New Issue
Block a user