军团:改表

This commit is contained in:
luying
2021-12-21 19:26:33 +08:00
parent 75da9edc85
commit b304995c5d
17 changed files with 7838 additions and 2469 deletions
+16 -1
View File
@@ -18,7 +18,7 @@ import { dicTowerTask, loadTowerTask } from "./dictionary/DicTowerTask";
import { dicWar, dicWarPvp, dicDailyWarByType, loadWar } from "./dictionary/DicWar";
import { dicWarJson, loadWarJson } from "./dictionary/DicWarJson";
import { dicXunbao, loadXunbao } from "./dictionary/DicXunbao";
import { AUCTION_TIME, SPECIAL_ATTR } from "../consts";
import { AUCTION_TIME, CONSUME_TYPE, ITID, SPECIAL_ATTR } from "../consts";
import { dicFashions, dicFashionsByHeroId, loadFashions } from "./dictionary/DicFashions";
import { friendShips, friendShipHidAandIds, loadFriendShip } from "./dictionary/DicFriendShip";
import { maxFriendShipLv, dicFriendShipLevelMap, loadFriendShipLevel } from "./dictionary/DicFriendShipLevel";
@@ -95,6 +95,7 @@ import { dicAuctionPool, loadAuctionReward } from './dictionary/DicAuctionReward
import { dicGuildTrainInfo, loadGuildTrainInfo } from './dictionary/DicGuildTrainInfo';
import { dicPvpDifficultRatio, loadPvpDifficultRatio } from './dictionary/DicPvpDifficultRatio';
import { dicWhiteIp, loadWhiteIp } from './dictionary/DicWhiteIp';
import { dicGuildWishReward, loadGuildWishReward } from './dictionary/DicGuildWishReward';
import { pick } from "underscore";
import _ = require("underscore");
@@ -240,6 +241,7 @@ export const gameData = {
auctionPool: dicAuctionPool,
auctionTime: new Map<number, { hour: number, minute: number, seconds: number}>(),
whiteip: dicWhiteIp,
guildWishReward: dicGuildWishReward,
};
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
@@ -756,6 +758,18 @@ export function getQuenchGradeByValue(quality: number, value: number) {
return grade;
}
export function getWishPoolReward(id: number) {
let dicGoods = gameData.goods.get(id);
if(!dicGoods) return false;
let dicItid = ITID.get(dicGoods.itid);
let starLevel = 0;
if(dicItid.type == CONSUME_TYPE.PIECE) {
starLevel = dicGoods.equipLvl;
}
console.log('*****', dicGoods.itid, starLevel, dicGoods.quality)
return gameData.guildWishReward.get(`${dicGoods.itid}_${starLevel}_${dicGoods.quality}`);
}
/**
* 根绝品质和品相获得上下限,当grade为0,获取该品质下全阶的上下限
* @param quality 品质
@@ -975,6 +989,7 @@ function loadDatas() {
loadPvpDifficultRatio();
loadWhiteIp();
treatTaskGroup();
loadGuildWishReward();
}
// 重载dicParam
@@ -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
};
// 许愿池
+35 -2
View File
@@ -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
}