属性: 修改好感度添加方法
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user