mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
some of reload
This commit is contained in:
1 parent
03b8ffe7e5
commit
f5dc3684d2
4 files changed
+93
-11
No files matched your search
@@ -102,21 +102,23 @@ export const characteristics = {
|
|||||||
return gun.gun_type!.$case !== "auto_reloader";
|
return gun.gun_type!.$case !== "auto_reloader";
|
||||||
},
|
},
|
||||||
|
|
||||||
compute({ gun, script }) {
|
compute({ gun, script, degressive }) {
|
||||||
// should never happen! just for typescript
|
// should never happen! just for typescript
|
||||||
if (gun.gun_type!.$case === "auto_reloader") return -Infinity;
|
if (gun.gun_type!.$case === "auto_reloader") return -Infinity;
|
||||||
|
|
||||||
let coefficient = 1;
|
let c0 = 1;
|
||||||
|
|
||||||
script("protagonist", "miscAttrs/gunReloadTimeFactor", (effect) => {
|
script("protagonist", "miscAttrs/gunReloadTimeFactor", (effect) => {
|
||||||
coefficient += effect.bonusValues!.percent / 100;
|
c0 += effect.bonusValues!.percent / 100;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const c = c0 * degressive;
|
||||||
|
|
||||||
if (gun.gun_type!.$case === "regular") {
|
if (gun.gun_type!.$case === "regular") {
|
||||||
return coefficient * gun.gun_type!.value.reload;
|
return c * gun.gun_type!.value.reload;
|
||||||
}
|
}
|
||||||
|
|
||||||
return gun.gun_type!.value.clip_reload;
|
return c * gun.gun_type!.value.clip_reload;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} satisfies Record<string, Characteristic>;
|
} satisfies Record<string, Characteristic>;
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
import {
|
import {
|
||||||
|
CrewType,
|
||||||
degressiveStat,
|
degressiveStat,
|
||||||
isExplosive,
|
isExplosive,
|
||||||
normalizeBoundingBox,
|
normalizeBoundingBox,
|
||||||
progressiveStat,
|
progressiveStat,
|
||||||
resolveDpm,
|
resolveDpm,
|
||||||
resolvePenetrationCoefficient,
|
resolvePenetrationCoefficient,
|
||||||
|
ShellType,
|
||||||
sum,
|
sum,
|
||||||
unionBoundingBox,
|
|
||||||
} from "@blitzkit/core";
|
|
||||||
import { coefficient } from "@blitzkit/core/src/blitzkit/coefficient";
|
|
||||||
import {
|
|
||||||
CrewType,
|
|
||||||
TankClass,
|
TankClass,
|
||||||
|
unionBoundingBox,
|
||||||
type EngineDefinition,
|
type EngineDefinition,
|
||||||
type EquipmentDefinitions,
|
type EquipmentDefinitions,
|
||||||
type GunDefinition,
|
type GunDefinition,
|
||||||
@@ -21,8 +19,10 @@ import {
|
|||||||
type TankDefinition,
|
type TankDefinition,
|
||||||
type TrackDefinition,
|
type TrackDefinition,
|
||||||
type TurretDefinition,
|
type TurretDefinition,
|
||||||
} from "@blitzkit/protos";
|
} from "@blitzkit/core";
|
||||||
|
import { coefficient } from "@blitzkit/core/src/blitzkit/coefficient";
|
||||||
import type { EquipmentMatrix } from "../../stores/duel";
|
import type { EquipmentMatrix } from "../../stores/duel";
|
||||||
|
import { SPALL_LINER_HE_DAMAGE_DELTA } from "./spallLiner";
|
||||||
import { defaultEqualizer } from "./tankToDuelMember";
|
import { defaultEqualizer } from "./tankToDuelMember";
|
||||||
|
|
||||||
export type TankCharacteristics = ReturnType<typeof tankCharacteristics>;
|
export type TankCharacteristics = ReturnType<typeof tankCharacteristics>;
|
||||||
@@ -166,6 +166,22 @@ 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 armorDamageCoefficient =
|
||||||
|
coefficient([hasTungsten, 0.15]) *
|
||||||
|
coefficient(
|
||||||
|
[applyReactiveArmor && shell.type !== ShellType.SHELL_TYPE_HE, -0.27],
|
||||||
|
[applyDynamicArmor, -0.1],
|
||||||
|
[
|
||||||
|
applySpallLiner && shell.type === ShellType.SHELL_TYPE_HE,
|
||||||
|
SPALL_LINER_HE_DAMAGE_DELTA,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
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]) *
|
||||||
@@ -334,6 +350,10 @@ 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,
|
||||||
@@ -362,6 +382,7 @@ export function tankCharacteristics(
|
|||||||
: undefined;
|
: undefined;
|
||||||
const damageWithoutAssault =
|
const damageWithoutAssault =
|
||||||
shell.armor_damage * damageCoefficientWithoutAssault;
|
shell.armor_damage * damageCoefficientWithoutAssault;
|
||||||
|
const damage = shell.armor_damage * damageCoefficient;
|
||||||
const dpmEffective =
|
const dpmEffective =
|
||||||
gun.gun_type!.$case === "auto_reloader"
|
gun.gun_type!.$case === "auto_reloader"
|
||||||
? gun.gun_type!.value.shell_reloads[0] >
|
? gun.gun_type!.value.shell_reloads[0] >
|
||||||
@@ -599,3 +620,56 @@ export function tankCharacteristics(
|
|||||||
burstInterShell,
|
burstInterShell,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum TankCharacteristicsCondition {
|
||||||
|
Regular,
|
||||||
|
AutoLoader,
|
||||||
|
AutoReloader,
|
||||||
|
}
|
||||||
|
|
||||||
|
export const characteristicsOrder: {
|
||||||
|
name: string;
|
||||||
|
items: TankCharacteristicsKey[];
|
||||||
|
}[] = [
|
||||||
|
{
|
||||||
|
name: "Firepower",
|
||||||
|
items: [
|
||||||
|
"gunType",
|
||||||
|
"dpm",
|
||||||
|
"shells",
|
||||||
|
"shellReload",
|
||||||
|
"shellReloads",
|
||||||
|
"intraClip",
|
||||||
|
"penetration",
|
||||||
|
"penetrationAt250m",
|
||||||
|
"damage",
|
||||||
|
"clipDamage",
|
||||||
|
"moduleDamage",
|
||||||
|
"caliber",
|
||||||
|
"shellNormalization",
|
||||||
|
"shellRicochet",
|
||||||
|
"shellVelocity",
|
||||||
|
"shellRange",
|
||||||
|
"shellCapacity",
|
||||||
|
"aimTime",
|
||||||
|
"dispersion",
|
||||||
|
"dispersionMoving",
|
||||||
|
"dispersionHullTraversing",
|
||||||
|
"dispersionTurretTraversing",
|
||||||
|
"dispersionShooting",
|
||||||
|
"dispersionGunDamaged",
|
||||||
|
"gunDepression",
|
||||||
|
"gunElevation",
|
||||||
|
"gunFrontalDepression",
|
||||||
|
"gunFrontalElevation",
|
||||||
|
"gunRearDepression",
|
||||||
|
"gunRearElevation",
|
||||||
|
"azimuthLeft",
|
||||||
|
"azimuthRight",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Crew",
|
||||||
|
items: ["crewCount"],
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -102,6 +102,9 @@ export function computeCharacteristics(
|
|||||||
|
|
||||||
equalizer: tank.equalizer ?? defaultEqualizer,
|
equalizer: tank.equalizer ?? defaultEqualizer,
|
||||||
|
|
||||||
|
progressive,
|
||||||
|
degressive,
|
||||||
|
|
||||||
tank,
|
tank,
|
||||||
engine,
|
engine,
|
||||||
track,
|
track,
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ export interface CharacteristicContext {
|
|||||||
|
|
||||||
equalizer: Equalizer;
|
equalizer: Equalizer;
|
||||||
|
|
||||||
|
progressive: number;
|
||||||
|
degressive: number;
|
||||||
|
|
||||||
tank: TankDefinition;
|
tank: TankDefinition;
|
||||||
engine: EngineDefinition;
|
engine: EngineDefinition;
|
||||||
track: TrackDefinition;
|
track: TrackDefinition;
|
||||||
|
|||||||
Reference in new issue
Block a user