军团:改表
This commit is contained in:
@@ -9,8 +9,7 @@ export interface DicArmyDevelopConsume {
|
||||
readonly id: number;
|
||||
// 目标品质
|
||||
readonly quality: number;
|
||||
readonly levelMin: number;
|
||||
readonly levelMax: number;
|
||||
readonly starLevel: number;
|
||||
readonly prePositions: Array<number>;
|
||||
readonly honourConsume: Array<RewardInter>;
|
||||
readonly fundConsume: number;
|
||||
@@ -20,8 +19,7 @@ export interface DicArmyDevelopConsume {
|
||||
const DicArmyDevelopConsumeKeys: KeysEnum<DicArmyDevelopConsume> = {
|
||||
id: true,
|
||||
quality: true,
|
||||
levelMin: true,
|
||||
levelMax: true,
|
||||
starLevel: true,
|
||||
prePositions: true,
|
||||
honourConsume: true,
|
||||
fundConsume: true,
|
||||
|
||||
@@ -6,12 +6,14 @@ const _ = require('lodash');
|
||||
|
||||
export interface DicArmyDonate {
|
||||
readonly id: number;
|
||||
readonly level: number;
|
||||
readonly fund: number;
|
||||
readonly boxRewards: Array<RewardInter>;
|
||||
}
|
||||
|
||||
const DicArmyDonateKeys: KeysEnum<DicArmyDonate> = {
|
||||
id: true,
|
||||
level: true,
|
||||
fund: true,
|
||||
boxRewards: true
|
||||
};
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// 公会权限
|
||||
import { readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicGuildWishReward {
|
||||
|
||||
// id
|
||||
readonly id: number;
|
||||
// itid
|
||||
readonly itid: number;
|
||||
// 装备星级
|
||||
readonly starLevel: number;
|
||||
// 品质
|
||||
readonly quality: number;
|
||||
// 功勋奖励
|
||||
readonly honourReward: number;
|
||||
|
||||
}
|
||||
|
||||
export const dicGuildWishReward = new Map<string, DicGuildWishReward>();
|
||||
export function loadGuildWishReward() {
|
||||
dicGuildWishReward.clear();
|
||||
let arr = readFileAndParse(FILENAME.DIC_GUILD_WISH_REWARD);
|
||||
|
||||
arr.forEach(o => {
|
||||
if(o.starLevel == '&') o.starLevel = 0;
|
||||
dicGuildWishReward.set(`${o.itid}_${o.starLevel}_${o.quality}`, o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
@@ -116,18 +116,12 @@ export interface DicDonateBase {
|
||||
readonly level: number;
|
||||
// 捐献奖励
|
||||
readonly donateReward: Map<number, { id: number, rewardGood: RewardInter, rewardFund:number, cosume:RewardInter }>;
|
||||
// 今日捐献宝箱领取奖励系数
|
||||
readonly boxRewardRatio: number;
|
||||
|
||||
readonly requireRewardRatio: number;
|
||||
}
|
||||
|
||||
const DicDonateKeys: KeysEnum<DicDonateBase> = {
|
||||
id: true,
|
||||
level: true,
|
||||
donateReward: true,
|
||||
boxRewardRatio: true,
|
||||
requireRewardRatio: true
|
||||
};
|
||||
|
||||
// 许愿池
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// 关卡表
|
||||
import {decodeArrayListStr, decodeArrayStr, parseNumberList, readFileAndParse} from '../util'
|
||||
import { WAR_RELATE_TABLES, WAR_TYPE } from '../../consts';
|
||||
import { TRAIN_REWARD_TYPE, WAR_RELATE_TABLES, WAR_TYPE } from '../../consts';
|
||||
import { isString } from 'underscore'
|
||||
import { RewardInter } from '../interface';
|
||||
export interface DicWar {
|
||||
|
||||
// 关卡id
|
||||
@@ -44,6 +45,10 @@ export interface DicWar {
|
||||
readonly scriptBefore: string;
|
||||
// 战后剧本
|
||||
readonly scriptAfter: string;
|
||||
// 练兵场胜利奖励
|
||||
readonly winReward: Map<number, number|RewardInter[]>;
|
||||
// 练兵场失败奖励
|
||||
readonly failReward: Map<number, number|RewardInter[]>;
|
||||
}
|
||||
|
||||
export const dicWar = new Map<number, DicWar>();
|
||||
@@ -76,7 +81,6 @@ export function loadWar() {
|
||||
}
|
||||
}
|
||||
|
||||
dicWar.set(o.war_id, o);
|
||||
if(o.warType == WAR_TYPE.PVP) {
|
||||
dicWarPvp.push(o);
|
||||
} else if (o.warType == WAR_TYPE.DAILY) {
|
||||
@@ -84,7 +88,11 @@ export function loadWar() {
|
||||
dicDailyWarByType.set(o.dailyType, []);
|
||||
}
|
||||
dicDailyWarByType.get(o.dailyType).push(o);
|
||||
} else if (o.warType == WAR_TYPE.GUILD_TRAIN) {
|
||||
o.winReward = parseTrainReward(o.winReward);
|
||||
o.failReward = parseTrainReward(o.failReward);
|
||||
}
|
||||
dicWar.set(o.war_id, o);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -159,4 +167,29 @@ function parseForbiddenChara(str: string = '') {
|
||||
result.push({type: parseInt(type), id: parseInt(id)});
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
function parseTrainReward(str: string) {
|
||||
let result = new Map<number, number|RewardInter[]>();
|
||||
if(!str) return result;
|
||||
let decodeArr = decodeArrayListStr(str);
|
||||
for(let [type, str1, str2] of decodeArr) {
|
||||
if(parseInt(type) == TRAIN_REWARD_TYPE.SCORE) {
|
||||
if(isNaN(parseInt(str1))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
if(!result.has(parseInt(type))) {
|
||||
result.set(parseInt(type), parseInt(str1));
|
||||
}
|
||||
} else if (parseInt(type) == TRAIN_REWARD_TYPE.ITEM) {
|
||||
if(isNaN(parseInt(str1)) || isNaN(parseInt(str2))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
if(!result.has(parseInt(type))) {
|
||||
result.set(parseInt(type), []);
|
||||
}
|
||||
(<RewardInter[]>result.get(parseInt(type))).push({ id: parseInt(str1), count: parseInt(str2) });
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user