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

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

@@ -13,7 +13,9 @@ export const HERO_SYSTEM_TYPE = {
export const HERO_GROW_MAX = {
STAR: 6,
COLORSTAR: 6,
QUALITY: 3
QUALITY: 3,
EQUIP_STRENGTHEN: 100,
EQUIP_REFINE: 15
}
export const JOB_TYPE = {

View File

@@ -83,8 +83,9 @@ export const FILENAME = {
DIC_TOWER: 'dic_zyz_tower',
DIC_XUNBAO: 'dic_zyz_xunbao',
DIC_QUESTION: 'Questions',
DIC_RANDOM_EFFECT_POOL: 'dic_random_effect_pool',
DIC_STRENGTHEN_COST: 'dic_zyz_enhancementCost'
DIC_RANDOM_EFFECT_POOL: 'dic_zyz_randomEffectPool',
DIC_STRENGTHEN_COST: 'dic_zyz_enhancementCost',
DIC_REFINE: 'dic_zyz_jinglian'
}
export const WAR_RELATE_TABLES = [

View File

@@ -148,6 +148,9 @@ export const STATUS = {
ROLE_EQUIP_PLACE_NOT_ENOUGH: {code: 30400, simStr: '装备栏未装备或无可强化'},
ROLE_COIN_NOT_ENOUGH: {code: 30401, simStr: '铜币不足'},
EQUIP_HAVE_NO_RANDSE: { code: 30403, simStr: '装备无随机属性' },
ROLE_EQUIP_REACH_MAX: { code: 30404, simStr: '强化已达上限' },
ROLE_EQUIP_NOT_REACH_MAX: { code: 30405, simStr: '强化未达到上限' },
ROLE_EQUIP_CANNOT_RESTRENGTHEN: { code: 30406, simStr: '无属性可以洗炼' },
EQUIP_NOT_FIND: {code: 30500, simStr: '装备不存在'},
EQUIP_IS_EQUIPED: {code: 30501, simStr: '装备已经穿戴'},

View File

@@ -11,33 +11,33 @@ export class CeAttrData {
export class CeAttr {
@prop({ required: false })
hp?: CeAttrData;
hp?: CeAttrData = new CeAttrData();
@prop({ required: false })
atk?: CeAttrData;
atk?: CeAttrData = new CeAttrData();
@prop({ required: false })
matk?: CeAttrData;
matk?: CeAttrData = new CeAttrData();
@prop({ required: false })
def?: CeAttrData;
def?: CeAttrData = new CeAttrData();
@prop({ required: false })
mdef?: CeAttrData;
mdef?: CeAttrData = new CeAttrData();
@prop({ required: false })
agi?: CeAttrData;
agi?: CeAttrData = new CeAttrData();
@prop({ required: false })
luk?: CeAttrData;
luk?: CeAttrData = new CeAttrData();
@prop({ required: false })
hit?: CeAttrData;
hit?: CeAttrData = new CeAttrData();
@prop({ required: false })
cri?: CeAttrData;
cri?: CeAttrData = new CeAttrData();
@prop({ required: false })
flee?: CeAttrData;
flee?: CeAttrData = new CeAttrData();
@prop({ required: false })
antCri?: CeAttrData;
antCri?: CeAttrData = new CeAttrData();
@prop({ required: false })
damageIncrease?: CeAttrData;
damageIncrease?: CeAttrData = new CeAttrData();
@prop({ required: false })
damageDecrease?: CeAttrData;
damageDecrease?: CeAttrData = new CeAttrData();
@prop({ required: false })
defIngnore?: CeAttrData;
defIngnore?: CeAttrData = new CeAttrData();
@prop({ required: false })
bloodSuck?: CeAttrData;
bloodSuck?: CeAttrData = new CeAttrData();
}

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));

View File

@@ -0,0 +1,340 @@
[
{
"id": 1,
"type": 102,
"gainValue": "2&0",
"index": 2,
"Min": 5,
"Max": 10,
"info": "物攻提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 2,
"type": 102,
"gainValue": "1&0",
"index": 2,
"Min": 5,
"Max": 10,
"info": "生命值提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 3,
"type": 102,
"gainValue": "3&0",
"index": 2,
"Min": 5,
"Max": 10,
"info": "策攻提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 4,
"type": 102,
"gainValue": "4&0",
"index": 2,
"Min": 5,
"Max": 10,
"info": "物防提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 5,
"type": 102,
"gainValue": "5&0",
"index": 2,
"Min": 5,
"Max": 10,
"info": "策防提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 6,
"type": 102,
"gainValue": "6&0",
"index": 2,
"Min": 5,
"Max": 10,
"info": "敏捷提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 7,
"type": 102,
"gainValue": "7&0",
"index": 2,
"Min": 5,
"Max": 10,
"info": "幸运提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 8,
"type": 101,
"gainValue": "2&0",
"index": 2,
"Min": 200,
"Max": 400,
"info": "物攻提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 9,
"type": 101,
"gainValue": "1&0",
"index": 2,
"Min": 200,
"Max": 400,
"info": "生命值提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 10,
"type": 101,
"gainValue": "3&0",
"index": 2,
"Min": 200,
"Max": 400,
"info": "策攻提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 11,
"type": 101,
"gainValue": "4&0",
"index": 2,
"Min": 200,
"Max": 400,
"info": "物防提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 12,
"type": 101,
"gainValue": "5&0",
"index": 2,
"Min": 200,
"Max": 400,
"info": "策防提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 13,
"type": 101,
"gainValue": "6&0",
"index": 2,
"Min": 200,
"Max": 400,
"info": "敏捷提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 14,
"type": 101,
"gainValue": "7&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "幸运提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 15,
"type": 101,
"gainValue": "8&0",
"index": 2,
"Min": 1,
"Max": 3,
"info": "移动提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 16,
"type": 101,
"gainValue": "9&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "命中提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 17,
"type": 101,
"gainValue": "10&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "暴击提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 18,
"type": 101,
"gainValue": "11&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "格挡提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 19,
"type": 101,
"gainValue": "12&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "暴击等级提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 20,
"type": 101,
"gainValue": "13&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "伤害加深提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 21,
"type": 101,
"gainValue": "14&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "伤害减免提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 22,
"type": 101,
"gainValue": "15&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "忽视防御提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 23,
"type": 101,
"gainValue": "16&0",
"index": 2,
"Min": 5000,
"Max": 10000,
"info": "吸血提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 24,
"type": 101,
"gainValue": "1&10",
"index": 0,
"Min": 0,
"Max": 0,
"info": "生命值提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 25,
"type": 101,
"gainValue": "2&20",
"index": 0,
"Min": 0,
"Max": 0,
"info": "物攻提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
},
{
"id": 26,
"type": 101,
"gainValue": "10&50000",
"index": 0,
"Min": 0,
"Max": 0,
"info": "暴击提高",
"__EMPTY": 0,
"__EMPTY_1": 0,
"__EMPTY_2": 0,
"__EMPTY_3": 0
}
]