feat(军团): 修改boss和城门血条逻辑

This commit is contained in:
luying
2023-09-19 20:13:56 +08:00
parent e8ba038bb5
commit 9797f41652
10 changed files with 330 additions and 89 deletions

View File

@@ -693,6 +693,7 @@ export const FILENAME = {
DIC_ROUGE_TECH: "dic_rougeTech",
DIC_ROUGE_TECH_CIRCLE: "dic_rougeTechCircle",
DIC_ROUGE_TECH_LEVEL: "dic_rougeTechLevel",
DIC_GUILD_HP_RATIO: "dic_army_hpRatio",
}
export const WAR_RELATE_TABLES = [
@@ -1419,4 +1420,10 @@ export enum TEAM_TYPE {
export enum CHECT_BLOCK_TYPE {
OPEN = 0, //开
CLOSE = 1, //关
}
export enum BOSS_HP_RATIO_TYPE {
BOSS_RATIO = 1, // 演武台按开服天数
CITY_RATIO = 2, // 诸侯混战按开服天数
CITY_PLAYER_RATIO = 3, // 最低玩家人数
}

View File

@@ -19,17 +19,18 @@ export class GateHpLog {
@prop({ required: false })
activeGuildCnt: number;
@prop({ required: false })
atk: number;
ratio: number;
@prop({ required: false })
A: number;
playerAtkAvg: number;
@prop({ required: false })
hpBase: number;
player5Damage: number;
@prop({ required: false })
N: number;
guildPlayerCntAvg: number;
@prop({ required: false })
cityRatio: number;
@prop({ required: false })
gateHp: number;
@prop({ required: false })
playerGuildRatio: number;
}
export class BossHpLog {
@@ -38,14 +39,16 @@ export class BossHpLog {
@prop({ required: false })
bossHpRatio: number;
@prop({ required: false })
hp: number;
ratio: number;
@prop({ required: false })
playerAtkAvg: number;
@prop({ required: false })
player10Damage: number;
@prop({ required: false })
activeCe: number;
@prop({ required: false })
playerCnt: number;
@prop({ required: false })
subCe: number;
@prop({ required: false })
B: number;
@prop({ required: false })
bossHp: number;

View File

@@ -1,4 +1,4 @@
import { getAtrrNameById, ABI_TYPE_MAIN } from '../../consts';
import { getAtrrNameById, ABI_TYPE_MAIN, ABI_TYPE } from '../../consts';
import { gameData } from '../../pubUtils/data';
import { decodeArrayListStr } from '../../pubUtils/util';
import { ATTRIBUTE } from '../../pubUtils/dicParam';
@@ -116,6 +116,10 @@ export class AttributeCal {
public calSubAttrCe() {
return Math.floor(this.calCe(3));
}
public getAtk() {
return this.attrs.get(ABI_TYPE.ABI_ATK)||0;
}
}
export class Attribute {

View File

@@ -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');
}
// 后台调用重载资源

View 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;
}

View File

@@ -22,8 +22,6 @@ export interface DicCityActivity {
readonly hp: number;
// 城门倍率
readonly hpN: number;
// 城门用于计算血量的攻击值模板
readonly atkTemplate: number;
// 玩家和军团比例
readonly playerCount: number;
}

View File

@@ -0,0 +1,116 @@
[
{
"id": 1,
"type": 1,
"serverOpen": 7,
"ratio": 1
},
{
"id": 2,
"type": 1,
"serverOpen": 14,
"ratio": 2
},
{
"id": 3,
"type": 1,
"serverOpen": 30,
"ratio": 3
},
{
"id": 4,
"type": 1,
"serverOpen": 60,
"ratio": 4
},
{
"id": 5,
"type": 1,
"serverOpen": 90,
"ratio": 5
},
{
"id": 6,
"type": 1,
"serverOpen": 120,
"ratio": 6
},
{
"id": 7,
"type": 1,
"serverOpen": 150,
"ratio": 7
},
{
"id": 8,
"type": 1,
"serverOpen": 180,
"ratio": 8
},
{
"id": 9,
"type": 2,
"serverOpen": 7,
"ratio": 1
},
{
"id": 10,
"type": 2,
"serverOpen": 14,
"ratio": 2
},
{
"id": 11,
"type": 2,
"serverOpen": 30,
"ratio": 3
},
{
"id": 12,
"type": 2,
"serverOpen": 60,
"ratio": 4
},
{
"id": 13,
"type": 2,
"serverOpen": 90,
"ratio": 5
},
{
"id": 14,
"type": 2,
"serverOpen": 120,
"ratio": 6
},
{
"id": 15,
"type": 2,
"serverOpen": 150,
"ratio": 7
},
{
"id": 16,
"type": 2,
"serverOpen": 180,
"ratio": 8
},
{
"id": 17,
"type": 3,
"serverOpen": 7,
"ratio": 10
},
{
"id": 18,
"type": 3,
"serverOpen": 30,
"ratio": 15
},
{
"id": 19,
"type": 3,
"serverOpen": -1,
"ratio": 20
}
]

View File

@@ -9,7 +9,7 @@
"warid": 7002,
"hp": 20000000,
"week": "2&4&6",
"hpN": 80,
"hpN": 1,
"atkTemplate": 3000,
"playerCount": 10
},
@@ -23,7 +23,7 @@
"warid": 7002,
"hp": 20000000,
"week": "2&4&6",
"hpN": 80,
"hpN": 1,
"atkTemplate": 3000,
"playerCount": 10
},
@@ -37,7 +37,7 @@
"warid": 7002,
"hp": 20000000,
"week": "2&4&6",
"hpN": 80,
"hpN": 1,
"atkTemplate": 3000,
"playerCount": 10
},
@@ -51,7 +51,7 @@
"warid": 7002,
"hp": 20000000,
"week": "2&4&6",
"hpN": 80,
"hpN": 1,
"atkTemplate": 3000,
"playerCount": 10
},
@@ -65,7 +65,7 @@
"warid": 7002,
"hp": 20000000,
"week": "2&4&6",
"hpN": 80,
"hpN": 1,
"atkTemplate": 3000,
"playerCount": 10
},
@@ -79,7 +79,7 @@
"warid": 7002,
"hp": 20000000,
"week": "2&4&6",
"hpN": 80,
"hpN": 1,
"atkTemplate": 3000,
"playerCount": 10
},
@@ -93,7 +93,7 @@
"warid": 7003,
"hp": 25000000,
"week": "4&6",
"hpN": 100,
"hpN": 2,
"atkTemplate": 3000,
"playerCount": 15
},
@@ -107,7 +107,7 @@
"warid": 7003,
"hp": 25000000,
"week": "4&6",
"hpN": 100,
"hpN": 2,
"atkTemplate": 3000,
"playerCount": 15
},
@@ -121,7 +121,7 @@
"warid": 7003,
"hp": 25000000,
"week": "4&6",
"hpN": 100,
"hpN": 2,
"atkTemplate": 3000,
"playerCount": 15
},
@@ -135,7 +135,7 @@
"warid": 7004,
"hp": 30000000,
"week": "6&",
"hpN": 120,
"hpN": 3,
"atkTemplate": 3000,
"playerCount": 20
}