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

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

@@ -21,7 +21,7 @@ import { dicXunbao } from "./dictionary/DicXunbao";
import { SPECIAL_ATTR } from "../consts/consts";
import { dicFashions } from "./dictionary/DicFashions";
import { friendShips, friendShipHidAandIds } from "./dictionary/DicFriendShip";
import { dicFriendShipLevel, dicFriendShipLevelMap } from "./dictionary/DicFriendShipLevel";
import { maxFriendShipLv, dicFriendShipLevelMap } from "./dictionary/DicFriendShipLevel";
import { dicHeroQualityUp } from "./dictionary/DicHeroQualityUp";
import { dicHeroStar } from "./dictionary/DicHeroStar";
import { dicHeroWake } from "./dictionary/DicHeroWake";
@@ -93,7 +93,7 @@ export const gameData = {
fashion: dicFashions,
friendShips: friendShips,
friendShipHidAandIds: friendShipHidAandIds,
friendShipLevel: dicFriendShipLevel,
maxFriendShipLv: maxFriendShipLv,
friendShipLevelMap: dicFriendShipLevelMap,
randomEffectPool: dicRandomEffectPool,
strengthenCost: dicStrengthenCost,
@@ -189,6 +189,20 @@ export function getHeroExpByLv(lv: number) {
return gameData.charexp.get(lv);
}
/**
* 根据武将当前好感获得好感等级
* @param exp 累积经验
*/
export function getFavourLvByExp(exp: number) {
let curLv = 0;
let entries = gameData.friendShipLevelMap.entries();
for (let [lv, { expSum: sum }] of entries) {
curLv = lv;
if(exp < sum) break;
}
return curLv;
}
export function getBossHpByWarId(warId: number) {
let bossHpSum = gameData.btlBossHpSum.get(warId) || 0;