🐞 fix(guild): 捐赠宝箱重复领取&领取之后展示问题修复

This commit is contained in:
dingchaolin
2023-03-16 14:30:20 +08:00
parent 739ea2da6b
commit 36c81751bd
5 changed files with 125 additions and 127 deletions
+7 -1
View File
@@ -43,7 +43,7 @@ import { dicTrainSoloReward, loadTrainSoloReward } from './dictionary/DicTrainSo
import { RewardInter } from "./interface";
import { dicArmyDevelopConsume, loadArmyDevelopConsume } from './dictionary/DicArmyDevelopConsume';
import { dicArmyBossRank, loadArmyBossRank } from './dictionary/DicArmyBossRank';
import { dicArmyDonate, loadArmyDonate } from './dictionary/DicArmyDonateBoxReward';
import { dicArmyDonate, loadArmyDonate, dicArmyDonateBoxIdByIndexAndLv } from './dictionary/DicArmyDonateBoxReward';
import { dicRoleFriend, DicRoleFriend, loadRoleFriend } from "./dictionary/DicRoleFriend";
import { dicRoleFriendLv, loadRoleFriendLv } from "./dictionary/DicRoleFriendLv";
import { AttributeCal } from "../domain/roleField/attribute";
@@ -208,6 +208,7 @@ export const gameData = {
armyDevelopConsume: dicArmyDevelopConsume,
armyBossRank: dicArmyBossRank,
armyDonateBox: dicArmyDonate,
armyDonateBoxByIndexAndLv: dicArmyDonateBoxIdByIndexAndLv,
roleFriend: dicRoleFriend,
roleFriendLv: dicRoleFriendLv,
figureCondition: figureCondition,
@@ -679,6 +680,11 @@ export function getArmyDonateBaseByLv(lv: number) {
export function getArmyDonateBoxBaseById(id: number) {
return gameData.armyDonateBox.get(id);
}
export function getArmyDonateBoxBaseByLvAndIndex(lv: number, index: number) {
return gameData.armyDonateBoxByIndexAndLv.get(`${lv}_${index}`);
}
export function getFriendLvByExp(exp: number) {
let resultLv = 1;
for (let [lv, { sum }] of gameData.roleFriendLv.entries()) {
@@ -6,6 +6,7 @@ const _ = require('lodash');
export interface DicArmyDonate {
readonly id: number;
readonly index: number;
readonly level: number;
readonly fund: number;
readonly boxRewards: Array<RewardInter>;
@@ -13,12 +14,14 @@ export interface DicArmyDonate {
const DicArmyDonateKeys: KeysEnum<DicArmyDonate> = {
id: true,
index: true,
level: true,
fund: true,
boxRewards: true
};
export const dicArmyDonate = new Map<number, DicArmyDonate>();
export const dicArmyDonateBoxIdByIndexAndLv = new Map<string, DicArmyDonate>();
export function loadArmyDonate() {
dicArmyDonate.clear();
let arr = readFileAndParse(FILENAME.DIC_ARMY_DONATE_BOX_REWARD);
@@ -26,6 +29,7 @@ export function loadArmyDonate() {
arr.forEach(o => {
o.boxRewards = parseGoodStr(o.boxReward);
dicArmyDonate.set(o.id, _.pick(o, Object.keys(DicArmyDonateKeys)));
dicArmyDonateBoxIdByIndexAndLv.set(`${o.level}_${o.index}`, _.pick(o, Object.keys(DicArmyDonateKeys)));
});
arr = undefined;
}
@@ -1,322 +1,282 @@
[
{
"id": 1,
"index": 1,
"level": 1,
"fund": 10000,
"boxReward": "40005&500",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&500"
},
{
"id": 2,
"index": 2,
"level": 1,
"fund": 20000,
"boxReward": "17052&250",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&250"
},
{
"id": 3,
"index": 3,
"level": 1,
"fund": 40000,
"boxReward": "40005&1000",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1000"
},
{
"id": 4,
"index": 4,
"level": 1,
"fund": 60000,
"boxReward": "17053&5",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&5"
},
{
"id": 5,
"index": 1,
"level": 2,
"fund": 10000,
"boxReward": "40005&550",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&550"
},
{
"id": 6,
"index": 2,
"level": 2,
"fund": 20000,
"boxReward": "17052&275",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&275"
},
{
"id": 7,
"index": 3,
"level": 2,
"fund": 40000,
"boxReward": "40005&1100",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1100"
},
{
"id": 8,
"index": 4,
"level": 2,
"fund": 60000,
"boxReward": "17053&6",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&6"
},
{
"id": 9,
"index": 1,
"level": 3,
"fund": 10000,
"boxReward": "40005&600",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&600"
},
{
"id": 10,
"index": 2,
"level": 3,
"fund": 20000,
"boxReward": "17052&300",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&300"
},
{
"id": 11,
"index": 3,
"level": 3,
"fund": 40000,
"boxReward": "40005&1200",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1200"
},
{
"id": 12,
"index": 4,
"level": 3,
"fund": 60000,
"boxReward": "17053&7",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&7"
},
{
"id": 13,
"index": 1,
"level": 4,
"fund": 10000,
"boxReward": "40005&650",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&650"
},
{
"id": 14,
"index": 2,
"level": 4,
"fund": 20000,
"boxReward": "17052&325",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&325"
},
{
"id": 15,
"index": 3,
"level": 4,
"fund": 40000,
"boxReward": "40005&1300",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1300"
},
{
"id": 16,
"index": 4,
"level": 4,
"fund": 60000,
"boxReward": "17053&8",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&8"
},
{
"id": 17,
"index": 1,
"level": 5,
"fund": 10000,
"boxReward": "40005&700",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&700"
},
{
"id": 18,
"index": 2,
"level": 5,
"fund": 20000,
"boxReward": "17052&350",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&350"
},
{
"id": 19,
"index": 3,
"level": 5,
"fund": 40000,
"boxReward": "40005&1400",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1400"
},
{
"id": 20,
"index": 4,
"level": 5,
"fund": 60000,
"boxReward": "17053&9",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&9"
},
{
"id": 21,
"index": 1,
"level": 6,
"fund": 10000,
"boxReward": "40005&750",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&750"
},
{
"id": 22,
"index": 2,
"level": 6,
"fund": 20000,
"boxReward": "17052&375",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&375"
},
{
"id": 23,
"index": 3,
"level": 6,
"fund": 40000,
"boxReward": "40005&1500",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1500"
},
{
"id": 24,
"index": 4,
"level": 6,
"fund": 60000,
"boxReward": "17053&10",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&10"
},
{
"id": 25,
"index": 1,
"level": 7,
"fund": 10000,
"boxReward": "40005&800",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&800"
},
{
"id": 26,
"index": 2,
"level": 7,
"fund": 20000,
"boxReward": "17052&400",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&400"
},
{
"id": 27,
"index": 3,
"level": 7,
"fund": 40000,
"boxReward": "40005&1600",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1600"
},
{
"id": 28,
"index": 4,
"level": 7,
"fund": 60000,
"boxReward": "17053&11",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&11"
},
{
"id": 29,
"index": 1,
"level": 8,
"fund": 10000,
"boxReward": "40005&850",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&850"
},
{
"id": 30,
"index": 2,
"level": 8,
"fund": 20000,
"boxReward": "17052&425",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&425"
},
{
"id": 31,
"index": 3,
"level": 8,
"fund": 40000,
"boxReward": "40005&1700",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1700"
},
{
"id": 32,
"index": 4,
"level": 8,
"fund": 60000,
"boxReward": "17053&12",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&12"
},
{
"id": 33,
"index": 1,
"level": 9,
"fund": 10000,
"boxReward": "40005&900",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&900"
},
{
"id": 34,
"index": 2,
"level": 9,
"fund": 20000,
"boxReward": "17052&450",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&450"
},
{
"id": 35,
"index": 3,
"level": 9,
"fund": 40000,
"boxReward": "40005&1800",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1800"
},
{
"id": 36,
"index": 4,
"level": 9,
"fund": 60000,
"boxReward": "17053&13",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&13"
},
{
"id": 37,
"index": 1,
"level": 10,
"fund": 10000,
"boxReward": "40005&1000",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&1000"
},
{
"id": 38,
"index": 2,
"level": 10,
"fund": 20000,
"boxReward": "17052&500",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17052&500"
},
{
"id": 39,
"index": 3,
"level": 10,
"fund": 40000,
"boxReward": "40005&2000",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "40005&2000"
},
{
"id": 40,
"index": 4,
"level": 10,
"fund": 60000,
"boxReward": "17053&15",
"__EMPTY": 0,
"__EMPTY_1": 0
"boxReward": "17053&15"
}
]