装备精炼,洗炼,缺少消耗

This commit is contained in:
luying
2020-12-18 13:56:12 +08:00
parent 329d59b6cc
commit b39c9bdc8b
14 changed files with 490 additions and 51 deletions

View File

@@ -27,6 +27,7 @@ import { dicHeroStar } from "./dictionary/DicHeroStar";
import { dicHeroWake } from "./dictionary/DicHeroWake";
import { dicRandomEffectPool } from './dictionary/DicRandomEffectPool';
import { dicStrengthenCost } from './dictionary/DicStrengthenCost';
import { dicRefine } from './dictionary/DicRefine';
export const gameData = {
blurprtCompose: dicBlueprtCompose,
@@ -64,7 +65,8 @@ export const gameData = {
friendShipLevel: dicFriendShipLevel,
friendShipLevelMap: dicFriendShipLevelMap,
randomEffectPool: dicRandomEffectPool,
strengthenCost: dicStrengthenCost
strengthenCost: dicStrengthenCost,
refine: dicRefine
};
// 在此提供一些原先在gamedata中提供的方法以便更方便获取gameData数据

View File

@@ -2,4 +2,8 @@ export const EQUIP = {
EQUIP_ONE_HOLE: '1&1', // 装备孔1号位消耗
EQUIP_TWO_HOLE: '1&2', // 装备孔2号位消耗
EQUIP_THREE_HOLE: '1&4', // 装备孔3号位消耗
XILIAN_ZERO_LOCK: '1&1', // 洗炼0个锁
XILIAN_ONE_LOCK: '1&2', // 洗炼1个锁
XILIAN_TWO_LOCK: '1&3', // 洗炼2个锁
XILIAN_THREE_LOCK: '1&4', // 洗炼3个锁
};

View File

@@ -13,9 +13,9 @@ export interface DicRandomEffectPool {
// 随机值位置
readonly index: number;
// 随机最小值
readonly min: number;
readonly Min: number;
// 随机最大值
readonly max: number;
readonly Max: number;
}

View File

@@ -0,0 +1,30 @@
// 武将特技表
import { readJsonFile, parseReward } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRefine {
// 精炼id
readonly id: number;
// 精炼等级
readonly level: number;
// 提高属性百分比
readonly upPercent: number;
// 材料
readonly material: Array<RewardInter>;
// 成功率
readonly successRate: number;
}
const str = readJsonFile(FILENAME.DIC_REFINE);
let arr = JSON.parse(str);
export const dicRefine = new Map<number, DicRefine>();
arr.forEach(o => {
o.material = parseReward(o.gainvalue)
dicRefine.set(o.id, o);
});

View File

@@ -40,11 +40,11 @@ export async function addEquips(roleId: string, roleName: string, weapon: EquipI
let randSe = new Array<RandSe>();
for(let i = 0; i < randomNum; i++) {
pool = pool.filter(cur => !chosen.includes(cur.id));
console.log(JSON.stringify(pool))
let random = getRandomByLen(pool);
if(!random) break;
chosen.push(random.id);
let rand = 0;
if(random.id > 0) rand = Math.floor(Math.random() * (random.max - random.min) + random.min);
if(random.id > 0) rand = Math.floor(Math.random() * (random.Max - random.Min) + random.Min);
randSe.push({
id: i + 1,
seid: random.id,

View File

@@ -483,7 +483,7 @@ export function parseReward(str: string) {
export function parseNumberList(str: string) {
let res = new Array<number>();
if(!str) return res;
let arr = decodeArrayStr(str);
let arr = decodeArrayStr(str, '&');
for(let g of arr) {
if(g === "") continue;
res.push(parseInt(g));