远征:修改机器人模板计算
This commit is contained in:
@@ -3,6 +3,7 @@ import { CeAttrDataRole } from '../../db/Role';
|
||||
import { CeAttrData } from '../../db/Hero';
|
||||
import { gameData } from '../../pubUtils/data';
|
||||
import { decodeArrayListStr, reduceCe } from '../../pubUtils/util';
|
||||
import { ATTRIBUTE } from '../../pubUtils/dicParam';
|
||||
|
||||
export class AttributeCal {
|
||||
attrs: Map<number, number> = new Map<number, number>();
|
||||
@@ -104,18 +105,31 @@ export class AttributeCal {
|
||||
}
|
||||
|
||||
// 战力计算
|
||||
public calCe() {
|
||||
// calType 1-全部 2-只算主属性 3-只算次属性
|
||||
public calCe(calType: number = 1) {
|
||||
let ce = gameData.ceRatio.reduce((pre, cur) => {
|
||||
let { type, val } = cur;
|
||||
if(ABI_TYPE_MAIN.includes(type)) {
|
||||
return pre + val * (this.attrs.get(type)|| 0)
|
||||
if(calType == 3) {
|
||||
return 0
|
||||
} else {
|
||||
return pre + val * (this.attrs.get(type)|| 0)
|
||||
}
|
||||
} else {
|
||||
return pre + val * (this.attrs.get(type)|| 0) * this.lv
|
||||
if(calType == 2) {
|
||||
return 0
|
||||
} else {
|
||||
return pre + val * (this.attrs.get(type)|| 0) * this.lv / ATTRIBUTE.ATTRIBUTE_POWER_DIVISOR;
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
return Math.floor(ce);
|
||||
}
|
||||
|
||||
public calSubAttrCeAndReduce() {
|
||||
return Math.floor(this.calCe(3) / HERO_CE_RATIO / HERO_CE_RATIO);
|
||||
}
|
||||
|
||||
public calCelAndReduce() {
|
||||
return Math.floor(this.calCe() / HERO_CE_RATIO / HERO_CE_RATIO);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user