✨ feat(军团): 修改boss和城门血条逻辑
This commit is contained in:
@@ -13,7 +13,7 @@ import { dicTower, loadTower } from "./dictionary/DicTower";
|
||||
import { dicTowerTask, loadTowerTask } from "./dictionary/DicTowerTask";
|
||||
import { dicWar, dicWarPvp, dicDailyWarByType, loadWar, dicHeroIdByWar, dicComBattleReward } from "./dictionary/DicWar";
|
||||
import { dicWarJson, loadWarJson } from "./dictionary/DicWarJson";
|
||||
import { AUCTION_TIME } from "../consts";
|
||||
import { AUCTION_TIME, BOSS_HP_RATIO_TYPE } from "../consts";
|
||||
import { dicFashions, dicFashionsByHeroId, loadFashions } from "./dictionary/DicFashions";
|
||||
import { friendShips, friendShipsByLv, friendShipsMax, loadFriendShip } from "./dictionary/DicFriendShip";
|
||||
import { dicHeroQualityUp, loadHeroQualityUp } from "./dictionary/DicHeroQualityUp";
|
||||
@@ -172,6 +172,7 @@ import { dicSpiritPlan, loadSpiritPlan } from "./dictionary/DicSpiritPlan";
|
||||
import { dicRougePassiveWeight, loadRougePassiveWeight } from "./dictionary/DicRougePassiveWeight";
|
||||
import { dicRougeCharaCardPlan, loadRougeCharaCardPlan } from "./dictionary/DicRougeCharaCardPlan";
|
||||
import { dicRougeHolyCardPlan, loadRougeHolyCardPlan } from "./dictionary/DicRougeHolyCardPlan";
|
||||
import { dicBossHpRatio, loadBossHpRatio } from "./dictionary/DicBossHpRatio";
|
||||
|
||||
export const gameData = {
|
||||
daily: dicDaily,
|
||||
@@ -431,6 +432,7 @@ export const gameData = {
|
||||
rougeCircleByTech: dicRougeTechCircleByTechId,
|
||||
rougeTechByRow: dicRougeTechIdByRow,
|
||||
rougeTechLevel: dicRougeTechLevel,
|
||||
bossHpRatio: dicBossHpRatio,
|
||||
};
|
||||
|
||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||
@@ -1378,6 +1380,16 @@ export function getRougeEffectTypeKind(effectTypes: number[]) {
|
||||
return kinds;
|
||||
}
|
||||
|
||||
export function getBossHpRatio(type: BOSS_HP_RATIO_TYPE, day: number) {
|
||||
let arr = gameData.bossHpRatio.get(type)||[];
|
||||
let bossHpRatio = 1;
|
||||
for(let { serverOpen, ratio } of arr) {
|
||||
bossHpRatio = ratio;
|
||||
if (serverOpen != -1 && serverOpen >= day) break;
|
||||
}
|
||||
return bossHpRatio;
|
||||
}
|
||||
|
||||
// 初始加载
|
||||
function initDatas() {
|
||||
parseDicParam();
|
||||
@@ -1790,8 +1802,10 @@ function loadDatas(type?: string) {
|
||||
if (type == undefined || type == 'loadRougeTech') loadRougeTech();
|
||||
if (type == undefined || type == 'loadRougeTechCircle') loadRougeTechCircle();
|
||||
if (type == undefined || type == 'loadRougeTechLevel') loadRougeTechLevel();
|
||||
if (type == undefined || type == 'loadBossHpRatio') loadBossHpRatio();
|
||||
|
||||
console.log('loadDatas type: ', type || 'all');
|
||||
|
||||
}
|
||||
|
||||
// 后台调用重载资源
|
||||
|
||||
24
shared/pubUtils/dictionary/DicBossHpRatio.ts
Normal file
24
shared/pubUtils/dictionary/DicBossHpRatio.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// 演武台&诸侯混战
|
||||
import { readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicBossHpRatio {
|
||||
// 类型 1-演武台按开服天数 2-诸侯混战按开服天数 3-最低玩家人数
|
||||
readonly type: number;
|
||||
// 开服时间
|
||||
readonly serverOpen: number;
|
||||
// 倍率
|
||||
readonly ratio: number;
|
||||
}
|
||||
|
||||
export const dicBossHpRatio = new Map<number, DicBossHpRatio[]>();
|
||||
export function loadBossHpRatio() {
|
||||
dicBossHpRatio.clear();
|
||||
let arr = readFileAndParse(FILENAME.DIC_GUILD_HP_RATIO);
|
||||
|
||||
arr.forEach(o => {
|
||||
if(!dicBossHpRatio.has(o.type)) dicBossHpRatio.set(o.type, []);
|
||||
dicBossHpRatio.get(o.type)?.push(o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
@@ -22,8 +22,6 @@ export interface DicCityActivity {
|
||||
readonly hp: number;
|
||||
// 城门倍率
|
||||
readonly hpN: number;
|
||||
// 城门用于计算血量的攻击值模板
|
||||
readonly atkTemplate: number;
|
||||
// 玩家和军团比例
|
||||
readonly playerCount: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user