🐞 fix(军团活动): 诸侯混战城门血量比例读表

This commit is contained in:
luying
2023-03-14 14:06:23 +08:00
parent aa1cdf4684
commit 4cc79137fd
4 changed files with 26 additions and 12 deletions
@@ -792,13 +792,13 @@ export async function getCityActivityGateHp(serverId: number, cityId: number) {
console.log(`getCityActivityGateHp: gateHpBase ${gateHpBase}, N ${N}`); console.log(`getCityActivityGateHp: gateHpBase ${gateHpBase}, N ${N}`);
let playerGuildRatio = activePlayerCnt/activeGuildCnt; let playerGuildRatio = activePlayerCnt/activeGuildCnt;
if(playerGuildRatio < 10) playerGuildRatio = 10; if(playerGuildRatio < dicCityActivity.playerCount) playerGuildRatio = dicCityActivity.playerCount;
let gateHp = Math.floor(gateHpBase * playerGuildRatio * N); let gateHp = Math.floor(gateHpBase * playerGuildRatio * N);
console.log(`getCityActivityGateHp: gateHp ${gateHp}`); console.log(`getCityActivityGateHp: gateHp ${gateHp}`);
saveGuildGateHpLog(serverId, cityId, { activePlayerCnt, activePlayerCe, activeTopPlayerCnt, activeGuildCnt, atk, A, hpBase: gateHpBase, N, gateHp }); saveGuildGateHpLog(serverId, cityId, { activePlayerCnt, activePlayerCe, activeTopPlayerCnt, activeGuildCnt, atk, A, hpBase: gateHpBase, N, gateHp, playerGuildRatio });
if(gateHp <= dicCityActivity.hp) { if(gateHp <= dicCityActivity.hp) {
gateHp = dicCityActivity.hp; gateHp = dicCityActivity.hp;
+2
View File
@@ -28,6 +28,8 @@ export class GateHpLog {
N: number; N: number;
@prop({ required: false }) @prop({ required: false })
gateHp: number; gateHp: number;
@prop({ required: false })
playerGuildRatio: number;
} }
export class BossHpLog { export class BossHpLog {
@@ -24,6 +24,8 @@ export interface DicCityActivity {
readonly hpN: number; readonly hpN: number;
// 城门用于计算血量的攻击值模板 // 城门用于计算血量的攻击值模板
readonly atkTemplate: number; readonly atkTemplate: number;
// 玩家和军团比例
readonly playerCount: number;
} }
export const dicJuniorCities: number[] = []; export const dicJuniorCities: number[] = [];
+20 -10
View File
@@ -10,7 +10,8 @@
"hp": 20000000, "hp": 20000000,
"week": "2&4&6", "week": "2&4&6",
"hpN": 80, "hpN": 80,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 10
}, },
{ {
"id": 2, "id": 2,
@@ -23,7 +24,8 @@
"hp": 20000000, "hp": 20000000,
"week": "2&4&6", "week": "2&4&6",
"hpN": 80, "hpN": 80,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 10
}, },
{ {
"id": 3, "id": 3,
@@ -36,7 +38,8 @@
"hp": 20000000, "hp": 20000000,
"week": "2&4&6", "week": "2&4&6",
"hpN": 80, "hpN": 80,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 10
}, },
{ {
"id": 4, "id": 4,
@@ -49,7 +52,8 @@
"hp": 20000000, "hp": 20000000,
"week": "2&4&6", "week": "2&4&6",
"hpN": 80, "hpN": 80,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 10
}, },
{ {
"id": 5, "id": 5,
@@ -62,7 +66,8 @@
"hp": 20000000, "hp": 20000000,
"week": "2&4&6", "week": "2&4&6",
"hpN": 80, "hpN": 80,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 10
}, },
{ {
"id": 6, "id": 6,
@@ -75,7 +80,8 @@
"hp": 20000000, "hp": 20000000,
"week": "2&4&6", "week": "2&4&6",
"hpN": 80, "hpN": 80,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 10
}, },
{ {
"id": 7, "id": 7,
@@ -88,7 +94,8 @@
"hp": 25000000, "hp": 25000000,
"week": "4&6", "week": "4&6",
"hpN": 100, "hpN": 100,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 15
}, },
{ {
"id": 8, "id": 8,
@@ -101,7 +108,8 @@
"hp": 25000000, "hp": 25000000,
"week": "4&6", "week": "4&6",
"hpN": 100, "hpN": 100,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 15
}, },
{ {
"id": 9, "id": 9,
@@ -114,7 +122,8 @@
"hp": 25000000, "hp": 25000000,
"week": "4&6", "week": "4&6",
"hpN": 100, "hpN": 100,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 15
}, },
{ {
"id": 10, "id": 10,
@@ -127,6 +136,7 @@
"hp": 30000000, "hp": 30000000,
"week": "6&", "week": "6&",
"hpN": 120, "hpN": 120,
"atkTemplate": 3000 "atkTemplate": 3000,
"playerCount": 20
} }
] ]