军团:修改个人功勋→个人活跃
This commit is contained in:
@@ -51,6 +51,7 @@ import { dicGuildPosition } from "./dictionary/DicGuildPosition";
|
||||
import { dicMail } from "./dictionary/DicMail";
|
||||
import { dicArmyTrainJuDian } from './dictionary/dicArmyTrainJuDian';
|
||||
import { dicTrainSoloReward } from './dictionary/dicTrainSoloReward';
|
||||
import { RewardInter } from "./interface";
|
||||
|
||||
export const gameData = {
|
||||
blurprtCompose: dicBlueprtCompose,
|
||||
@@ -350,3 +351,12 @@ export function getTrainBaseByLv(lv: number) {
|
||||
}
|
||||
|
||||
|
||||
export function getGuildActiveWeekReward(point: number) {
|
||||
let result = gameData.guildActiveWeekReward.find(cur => {
|
||||
let {weekPointMax, weekPointMin} = cur;
|
||||
return point >= weekPointMin && point <= (weekPointMax || weekPointMax == -1);
|
||||
});
|
||||
let reward = new Array<RewardInter>();
|
||||
if(result) reward = result.reward;
|
||||
return reward;
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ export interface DicGuildActiveWeekReward {
|
||||
const str = readJsonFile(FILENAME.DIC_ACTIVE_DAY_REWARD);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicGuildActiveWeekReward = new Map<number, DicGuildActiveWeekReward>();
|
||||
export const dicGuildActiveWeekReward = new Array<DicGuildActiveWeekReward>();
|
||||
|
||||
arr.forEach(o => {
|
||||
o.reward = parseGoodStr(o.Reward)
|
||||
dicGuildActiveWeekReward.set(o.id, o);
|
||||
dicGuildActiveWeekReward.push(o);
|
||||
});
|
||||
arr = undefined;
|
||||
@@ -16,7 +16,7 @@ export interface DicGuildPosition {
|
||||
readonly activeRatio: number;
|
||||
}
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_BLUEPRT_COMPOSE);
|
||||
const str = readJsonFile(FILENAME.DIC_GUILD_POSITION);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicGuildPosition = new Map<number, DicGuildPosition>();
|
||||
|
||||
@@ -102,7 +102,7 @@ export interface DicDonateBase {
|
||||
// 捐献值
|
||||
readonly donateValue: {type: number, count: number}[];
|
||||
// 捐献奖励
|
||||
readonly donateReward: {fund: number, honour: number}[];
|
||||
readonly donateReward: {fund: number, active: number}[];
|
||||
// 今日捐献宝箱领取奖励系数
|
||||
readonly boxRewardRatio: number;
|
||||
}
|
||||
@@ -259,16 +259,16 @@ export function parseDonateValue(str: string) {
|
||||
return result
|
||||
}
|
||||
|
||||
// {"fund": number, "honour": number}
|
||||
// {"fund": number, "active": number}
|
||||
export function parseDonateReward(str: string) {
|
||||
let result = new Array<{ fund: number, honour: number }>();
|
||||
let result = new Array<{ fund: number, active: number }>();
|
||||
if (!str) return result;
|
||||
let decodeArr = decodeArrayListStr(str);
|
||||
for (let [fund, honour] of decodeArr) {
|
||||
if (isNaN(parseInt(fund)) || isNaN(parseInt(honour))) {
|
||||
for (let [fund, active] of decodeArr) {
|
||||
if (isNaN(parseInt(fund)) || isNaN(parseInt(active))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
result.push({ fund: parseInt(fund), honour: parseInt(honour) });
|
||||
result.push({ fund: parseInt(fund), active: parseInt(active) });
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -28,10 +28,6 @@ export async function addSkins(roleId: string, id: number) {
|
||||
export async function addBags(roleId: string, roleName: string, data: BagInter) {
|
||||
let { id, count, itemName, type, hid } = data;
|
||||
let item = await ItemModel.increaseItem(roleId, id, count, { roleId, roleName, itemName, id, type, hid });
|
||||
|
||||
if(item.id == CURRENCY_BY_TYPE.get(CURRENCY_TYPE.HONOUR) ) {
|
||||
await UserGuildModel.addHonourWeekly(roleId, count);
|
||||
}
|
||||
return { id: item.id, count: item.count };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user