属性: 修改好感度添加方法

This commit is contained in:
luying
2021-02-24 11:36:28 +08:00
parent dd995e67eb
commit b14f751d92
9 changed files with 9754 additions and 111 deletions

View File

@@ -9,17 +9,19 @@ export interface DicFriendShipLevel {
readonly exp: number;
// 加成百分比
readonly add: number;
// 到这一级的总经验
readonly expSum: number;
}
const str = readJsonFile(FILENAME.DIC_FRIEND_SHIP_LEVEL);
let arr = JSON.parse(str);
export const dicFriendShipLevel = new Array<DicFriendShipLevel>();
export let maxFriendShipLv = 0;
export const dicFriendShipLevelMap = new Map<number, DicFriendShipLevel>();
let expSum = 0;
arr.forEach(o => {
dicFriendShipLevel.push(o);
expSum += o.exp;
o.expSum = expSum;
dicFriendShipLevelMap.set(o.level, o);
});
dicFriendShipLevel.sort(function(a, b) {
return a.level - b.level;
if(o.level > maxFriendShipLv) maxFriendShipLv = o.level;
});