mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
assaultDamageCoefficient
This commit is contained in:
1 parent
16637dac71
commit
474e71843d
3 files changed
+11
-13
No files matched your search
@@ -28,7 +28,7 @@ export const characteristics = {
|
||||
|
||||
damage: {
|
||||
type: CharacteristicType.Number,
|
||||
compute({ shell, environment, equalizer, script }) {
|
||||
compute({ shell, environment, equalizer, script, gun }) {
|
||||
let coefficient = 1;
|
||||
|
||||
if (environment.equalize) coefficient *= equalizer.damage;
|
||||
@@ -55,6 +55,14 @@ export const characteristics = {
|
||||
coefficient *= effect.bonusValues!.factor;
|
||||
});
|
||||
|
||||
if (gun.assault_ranges && gun.assault_ranges.types.includes(shell.type)) {
|
||||
const range = gun.assault_ranges.ranges.find(
|
||||
({ distance }) => distance >= environment.distance,
|
||||
);
|
||||
|
||||
if (range) coefficient *= range.factor;
|
||||
}
|
||||
|
||||
return coefficient * shell.armor_damage;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -166,12 +166,6 @@ export function tankCharacteristics(
|
||||
const intraClipCoefficient = coefficient([hasShellReloadBoost, -0.3]);
|
||||
const burstShells = gun.burst?.count ?? 1;
|
||||
const burstInterShell = gun.burst?.interval;
|
||||
const assaultDamageCoefficient =
|
||||
gun.assault_ranges && gun.assault_ranges.types.includes(shell.type)
|
||||
? (gun.assault_ranges.ranges.find(
|
||||
({ distance }) => distance >= assaultDistance,
|
||||
)?.factor ?? 0)
|
||||
: 1;
|
||||
const moduleDamageCoefficient = coefficient([hasTungsten, 0.15]);
|
||||
const reloadCoefficient =
|
||||
(coefficient([hasGunRammer, -0.05]) *
|
||||
@@ -340,10 +334,6 @@ export function tankCharacteristics(
|
||||
stockTurret.weight +
|
||||
stockGun.weight;
|
||||
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
||||
const damageCoefficientWithoutAssault =
|
||||
armorDamageCoefficient * equalizer.damage;
|
||||
const damageCoefficient =
|
||||
damageCoefficientWithoutAssault * assaultDamageCoefficient;
|
||||
const dpm = resolveDpm(
|
||||
gun,
|
||||
shell,
|
||||
|
||||
@@ -77,7 +77,7 @@ export enum TankopediaRelativeAgainst {
|
||||
|
||||
export interface TankEnvironment {
|
||||
equalize: boolean;
|
||||
assault_distance: number;
|
||||
distance: number;
|
||||
}
|
||||
|
||||
interface Tankopedia {
|
||||
@@ -125,7 +125,7 @@ export const Tankopedia = new Soapstone<Tankopedia, [TankDefinition]>(
|
||||
antagonist: createTankState(tank),
|
||||
model: models.models[tank.id],
|
||||
|
||||
environment: { equalize: false, assault_distance: 0 },
|
||||
environment: { equalize: false, distance: 0 },
|
||||
|
||||
relativeAgainst: TankopediaRelativeAgainst.Class,
|
||||
editStatic: false,
|
||||
|
||||
Reference in new issue
Block a user