mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +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: {
|
damage: {
|
||||||
type: CharacteristicType.Number,
|
type: CharacteristicType.Number,
|
||||||
compute({ shell, environment, equalizer, script }) {
|
compute({ shell, environment, equalizer, script, gun }) {
|
||||||
let coefficient = 1;
|
let coefficient = 1;
|
||||||
|
|
||||||
if (environment.equalize) coefficient *= equalizer.damage;
|
if (environment.equalize) coefficient *= equalizer.damage;
|
||||||
@@ -55,6 +55,14 @@ export const characteristics = {
|
|||||||
coefficient *= effect.bonusValues!.factor;
|
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;
|
return coefficient * shell.armor_damage;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -166,12 +166,6 @@ export function tankCharacteristics(
|
|||||||
const intraClipCoefficient = coefficient([hasShellReloadBoost, -0.3]);
|
const intraClipCoefficient = coefficient([hasShellReloadBoost, -0.3]);
|
||||||
const burstShells = gun.burst?.count ?? 1;
|
const burstShells = gun.burst?.count ?? 1;
|
||||||
const burstInterShell = gun.burst?.interval;
|
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 moduleDamageCoefficient = coefficient([hasTungsten, 0.15]);
|
||||||
const reloadCoefficient =
|
const reloadCoefficient =
|
||||||
(coefficient([hasGunRammer, -0.05]) *
|
(coefficient([hasGunRammer, -0.05]) *
|
||||||
@@ -340,10 +334,6 @@ export function tankCharacteristics(
|
|||||||
stockTurret.weight +
|
stockTurret.weight +
|
||||||
stockGun.weight;
|
stockGun.weight;
|
||||||
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
||||||
const damageCoefficientWithoutAssault =
|
|
||||||
armorDamageCoefficient * equalizer.damage;
|
|
||||||
const damageCoefficient =
|
|
||||||
damageCoefficientWithoutAssault * assaultDamageCoefficient;
|
|
||||||
const dpm = resolveDpm(
|
const dpm = resolveDpm(
|
||||||
gun,
|
gun,
|
||||||
shell,
|
shell,
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export enum TankopediaRelativeAgainst {
|
|||||||
|
|
||||||
export interface TankEnvironment {
|
export interface TankEnvironment {
|
||||||
equalize: boolean;
|
equalize: boolean;
|
||||||
assault_distance: number;
|
distance: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Tankopedia {
|
interface Tankopedia {
|
||||||
@@ -125,7 +125,7 @@ export const Tankopedia = new Soapstone<Tankopedia, [TankDefinition]>(
|
|||||||
antagonist: createTankState(tank),
|
antagonist: createTankState(tank),
|
||||||
model: models.models[tank.id],
|
model: models.models[tank.id],
|
||||||
|
|
||||||
environment: { equalize: false, assault_distance: 0 },
|
environment: { equalize: false, distance: 0 },
|
||||||
|
|
||||||
relativeAgainst: TankopediaRelativeAgainst.Class,
|
relativeAgainst: TankopediaRelativeAgainst.Class,
|
||||||
editStatic: false,
|
editStatic: false,
|
||||||
|
|||||||
Reference in new issue
Block a user