军团优化:拍卖行基础奖励
This commit is contained in:
@@ -17,6 +17,8 @@ export interface DicCentreBase {
|
||||
readonly managerNum: number;
|
||||
// 每日最大可获得资金
|
||||
readonly maxFund: number;
|
||||
// 许愿的品质
|
||||
readonly wishgoodsHero: { quality: number, count: number }[]
|
||||
}
|
||||
|
||||
const DicCenterKeys: KeysEnum<DicCentreBase> = {
|
||||
@@ -25,6 +27,7 @@ const DicCenterKeys: KeysEnum<DicCentreBase> = {
|
||||
peopleNum: true,
|
||||
managerNum: true,
|
||||
maxFund: true,
|
||||
wishgoodsHero: true
|
||||
};
|
||||
|
||||
// 炼器堂
|
||||
@@ -69,6 +72,8 @@ export interface DicBossBase {
|
||||
readonly ratio: number;
|
||||
// 鼓舞次数
|
||||
readonly encourageSum: number;
|
||||
// 基础分红
|
||||
readonly basicDividend: number;
|
||||
}
|
||||
|
||||
const DicBossKeys: KeysEnum<DicBossBase> = {
|
||||
@@ -83,7 +88,8 @@ const DicBossKeys: KeysEnum<DicBossBase> = {
|
||||
basicReward: true,
|
||||
damageRewardTotal: true,
|
||||
ratio: true,
|
||||
encourageSum: true
|
||||
encourageSum: true,
|
||||
basicDividend: true,
|
||||
};
|
||||
|
||||
// 练兵场
|
||||
@@ -124,34 +130,6 @@ const DicDonateKeys: KeysEnum<DicDonateBase> = {
|
||||
donateReward: true,
|
||||
};
|
||||
|
||||
// 许愿池
|
||||
export interface DicWishPoolBase {
|
||||
// id
|
||||
readonly id: number;
|
||||
// 等级
|
||||
readonly level: number;
|
||||
readonly wishgoodsDrawings: Array<{quality: number, count: number}>;
|
||||
readonly wishGoodsHeros: Array<{quality: number, count: number}>;
|
||||
readonly consume: number;
|
||||
}
|
||||
|
||||
const DicWishPoolKeys: KeysEnum<DicWishPoolBase> = {
|
||||
id: true,
|
||||
level: true,
|
||||
wishgoodsDrawings: true,
|
||||
wishGoodsHeros: true,
|
||||
consume: true,
|
||||
};
|
||||
// 商店
|
||||
export interface DicStoreBase {
|
||||
// id
|
||||
readonly id: number;
|
||||
// 等级
|
||||
readonly level: number;
|
||||
// 许愿物品
|
||||
readonly storeGoods: {id: number, count: number, num: number}[];
|
||||
}
|
||||
|
||||
|
||||
export const dicStructureConsume = new Map<number, Map<number, number>>(); // 升级消耗 structureId => level => consume
|
||||
export const dicCenterBase = new Map<number, DicCentreBase>(); // 中军大帐
|
||||
@@ -160,8 +138,6 @@ export const dicBossBase = new Map<number, DicBossBase>(); // 演武台
|
||||
export const dicBossBaseByBossLv = new Map<number, DicBossBase>(); // 演武台 boss等级=>dic
|
||||
export const dicTrainBase = new Map<number, DicTrainBase>(); // 练兵场
|
||||
export const dicDonateBase = new Map<number, DicDonateBase>(); // 捐献所
|
||||
export const dicWishPoolBase = new Map<number, DicWishPoolBase>(); // 许愿池
|
||||
export const dicStoreBase = new Map<number, DicWishPoolBase>(); // 许愿池
|
||||
export const maxMemberCnt = { max: 0 }; // 满配最大人数
|
||||
|
||||
export function loadStructure() {
|
||||
@@ -172,21 +148,15 @@ export function loadStructure() {
|
||||
dicBossBaseByBossLv.clear();
|
||||
dicTrainBase.clear();
|
||||
dicDonateBase.clear();
|
||||
dicWishPoolBase.clear();
|
||||
dicStoreBase.clear();
|
||||
maxMemberCnt.max = 0;
|
||||
|
||||
const DicStoreKeys: KeysEnum<DicStoreBase> = {
|
||||
id: true,
|
||||
level: true,
|
||||
storeGoods: true
|
||||
};
|
||||
// 中军大帐
|
||||
let arrCenter = readFileAndParse(FILENAME.DIC_GUILD_STRUCTURE_CENTER);
|
||||
arrCenter.forEach(o => {
|
||||
setStructureConsume(o);
|
||||
if(o.peopleNum > maxMemberCnt.max) maxMemberCnt.max = o.peopleNum;
|
||||
o.maxFund = o.feeLimit;
|
||||
o.wishgoodsHero = parseWishGoods(o.wishgoodsHero)
|
||||
dicCenterBase.set(o.level, _.pick(o, Object.keys(DicCenterKeys)));
|
||||
});
|
||||
arrCenter = undefined;
|
||||
@@ -235,31 +205,6 @@ export function loadStructure() {
|
||||
});
|
||||
arrDonate = undefined;
|
||||
|
||||
// 许愿池
|
||||
let arrWishPool = readFileAndParse(FILENAME.DIC_GUILD_WISH_POOL_BASE);
|
||||
arrWishPool.forEach(o => {
|
||||
setStructureConsume(o);
|
||||
o.wishgoodsDrawings = o.wishgoodsDrawing.split('|').map(wishgoodsDrawing=>{
|
||||
let wishgoodsDrawings = wishgoodsDrawing.split('&');
|
||||
return {quality: parseInt(wishgoodsDrawings[0]), count: parseInt(wishgoodsDrawings[1])};
|
||||
});
|
||||
o.wishGoodsHeros = o.wishgoodsHero.split('|').map(wishGoodsHero=>{
|
||||
let wishGoodsHeros = wishGoodsHero.split('&');
|
||||
return {quality: parseInt(wishGoodsHeros[0]), count: parseInt(wishGoodsHeros[1])};
|
||||
});
|
||||
dicWishPoolBase.set(o.level, _.pick(o, Object.keys(DicWishPoolKeys)));
|
||||
});
|
||||
arrWishPool = undefined;
|
||||
|
||||
// 商店
|
||||
let arrStore = readFileAndParse(FILENAME.DIC_GUILD_STORE_BASE);
|
||||
arrStore.forEach(o => {
|
||||
setStructureConsume(o);
|
||||
o.storeGoods = parseStoreGoods(o.storeGoods);
|
||||
dicStoreBase.set(o.level, _.pick(o, Object.keys(DicStoreKeys)));
|
||||
});
|
||||
arrStore = undefined;
|
||||
|
||||
// 升级消耗
|
||||
function setStructureConsume(o) {
|
||||
let map = dicStructureConsume.get(o.structureId);
|
||||
@@ -312,18 +257,4 @@ export function parseWishGoods(str: string) {
|
||||
result.push({ quality: parseInt(quality), count: parseInt(count) });
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// {"id": number, "count": number, "num": number}
|
||||
export function parseStoreGoods(str: string) {
|
||||
let result = new Array<{ id: number, count: number, num: number }>();
|
||||
if (!str) return result;
|
||||
let decodeArr = decodeArrayListStr(str);
|
||||
for (let [id, count, num] of decodeArr) {
|
||||
if (isNaN(parseInt(id)) || isNaN(parseInt(count))|| isNaN(parseInt(num))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
result.push({ id: parseInt(id), count: parseInt(count), num: parseInt(num) });
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user