You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
|
3 weeks ago
|
import { SkillCostType, getSkillWeightRow } from '../../game/SkillWeightDefaults';
|
||
|
|
import type { ComposedUnit } from 'db://assets/mx/module/merge';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 战斗理论秒伤:已激活塔每秒可造成伤害之和(与旧 BattleCore.dps 同源)。
|
||
|
|
* 配表 Const_weight 1203=三选1 危险系数最少塔数(默认 5)。
|
||
|
|
*/
|
||
|
|
export class BattleDpsMeter {
|
||
|
|
private _minTowerCount = 5;
|
||
|
|
|
||
|
|
loadConfig(): void {
|
||
|
|
const minRow = getSkillWeightRow(SkillCostType.skillCostType_1203);
|
||
|
|
if (minRow?.constValue > 0) this._minTowerCount = minRow.constValue;
|
||
|
|
}
|
||
|
|
|
||
|
|
get minTowerCount(): number {
|
||
|
|
return this._minTowerCount;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 场上合成单位理论秒伤总和 */
|
||
|
|
compute(
|
||
|
|
skills: readonly ITableSkill[],
|
||
|
|
compositions: readonly ComposedUnit[],
|
||
|
|
): number {
|
||
|
|
return gg.data.project.getBattlefieldDps(skills, compositions);
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 三选1 危险系数:塔数不足时返回 0 */
|
||
|
|
getEffectiveDps(theoreticalDps: number, deployedCount: number): number {
|
||
|
|
if (deployedCount < this._minTowerCount) return 0;
|
||
|
|
return theoreticalDps;
|
||
|
|
}
|
||
|
|
}
|