更新json和部分dictionary定义

This commit is contained in:
luying
2021-01-06 17:16:15 +08:00
parent 44ebf774b9
commit 514a8de340
25 changed files with 4240 additions and 28 deletions

View File

@@ -6,6 +6,7 @@ import fs = require('fs');
import path = require('path');
import { DicRandomEffectPool } from './dictionary/DicRandomEffectPool';
import { HERO_CE_RATIO, ABI_STAGE } from '../consts';
import { PvpDefenseType } from '../db/PvpDefense';
const _ = require('underscore');
@@ -173,6 +174,10 @@ export function getRandomByLen(arr: Array<any>): any {
return arr[Math.floor(Math.random() * len)]
}
export function getRandomIndexByLen(len: number) {
return Math.floor(Math.random() * len);
}
export function getRandomWithWeight(randomList: any) {
let len = randomList.reduce((pre, cur) => {
return pre + cur.weight || 1;