mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: some implementation
This commit is contained in:
1 parent
81e480f983
commit
ba97a9f28b
9 files changed
+1422
-882
No files matched your search
@@ -162,6 +162,7 @@ message GunDefinitionBase {
|
||||
|
||||
message AssaultRanges {
|
||||
repeated AssaultRange ranges = 1;
|
||||
repeated ShellType types = 2;
|
||||
}
|
||||
|
||||
message AssaultRange {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1250,7 +1250,7 @@ export async function definitions() {
|
||||
let assault_ranges: AssaultRanges | undefined;
|
||||
|
||||
if (gun.extras?.trayShell) {
|
||||
const kinds = gun.extras.trayShell.kinds
|
||||
const types = gun.extras.trayShell.kinds
|
||||
.split(' ')
|
||||
.map((string) => {
|
||||
const trimmed = string.trim();
|
||||
@@ -1270,6 +1270,7 @@ export async function definitions() {
|
||||
const sector = gun.extras.trayShell.sectors.sector;
|
||||
|
||||
assault_ranges = {
|
||||
types,
|
||||
ranges: sector.map((value) => ({
|
||||
factor: value.factor,
|
||||
distance: value.distance,
|
||||
|
||||
+1
@@ -118,6 +118,7 @@ export function InfoWithDelta({
|
||||
tank,
|
||||
track: member.track,
|
||||
turret: member.turret,
|
||||
assaultDistance: 0,
|
||||
},
|
||||
{
|
||||
equipmentDefinitions,
|
||||
|
||||
+1
@@ -58,6 +58,7 @@ export function Characteristics() {
|
||||
applyReactiveArmor: false,
|
||||
applyDynamicArmor: false,
|
||||
applySpallLiner: false,
|
||||
assaultDistance: 0,
|
||||
},
|
||||
{
|
||||
tankModelDefinition,
|
||||
|
||||
+1
@@ -96,6 +96,7 @@ export function SceneProps() {
|
||||
stockTurret: tank.turrets[0],
|
||||
stockTrack: tank.tracks[0],
|
||||
track,
|
||||
assaultDistance: 0,
|
||||
},
|
||||
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
||||
);
|
||||
|
||||
@@ -46,6 +46,7 @@ export function tankCharacteristics(
|
||||
applyReactiveArmor,
|
||||
applyDynamicArmor,
|
||||
applySpallLiner,
|
||||
assaultDistance,
|
||||
}: {
|
||||
tank: TankDefinition;
|
||||
turret: TurretDefinition;
|
||||
@@ -65,6 +66,7 @@ export function tankCharacteristics(
|
||||
applyReactiveArmor: boolean;
|
||||
applyDynamicArmor: boolean;
|
||||
applySpallLiner: boolean;
|
||||
assaultDistance: number;
|
||||
},
|
||||
{
|
||||
tankModelDefinition,
|
||||
@@ -157,6 +159,13 @@ export function tankCharacteristics(
|
||||
[applyDynamicArmor, -0.1],
|
||||
[applySpallLiner && shell.type === ShellType.HE, -0.2],
|
||||
);
|
||||
const assaultDamageCoefficient =
|
||||
gun.gun_type!.value.base.assault_ranges &&
|
||||
gun.gun_type!.value.base.assault_ranges.types.includes(shell.type)
|
||||
? (gun.gun_type!.value.base.assault_ranges.ranges.find(
|
||||
({ distance }) => distance >= assaultDistance,
|
||||
)?.factor ?? 0)
|
||||
: 1;
|
||||
const moduleDamageCoefficient = coefficient([hasTungsten, 0.15]);
|
||||
const reloadCoefficient =
|
||||
(coefficient([hasGunRammer, -0.05]) *
|
||||
@@ -326,10 +335,11 @@ export function tankCharacteristics(
|
||||
stockTurret.weight +
|
||||
stockGun.gun_type!.value.base.weight;
|
||||
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
||||
const damageCoefficient = armorDamageCoefficient * assaultDamageCoefficient;
|
||||
const dpm = resolveDpm(
|
||||
gun,
|
||||
shell,
|
||||
armorDamageCoefficient,
|
||||
damageCoefficient,
|
||||
reloadCoefficient,
|
||||
intraClipCoefficient,
|
||||
);
|
||||
@@ -352,7 +362,7 @@ export function tankCharacteristics(
|
||||
return current;
|
||||
}, null)!.index
|
||||
: undefined;
|
||||
const damage = shell.armor_damage * armorDamageCoefficient;
|
||||
const damage = shell.armor_damage * damageCoefficient;
|
||||
const dpmEffective =
|
||||
gun.gun_type!.$case === 'auto_reloader'
|
||||
? gun.gun_type!.value.extension.shell_reloads[0] >
|
||||
|
||||
@@ -85,6 +85,7 @@ function Content() {
|
||||
member.key !== thisMember.key &&
|
||||
member.provisions.includes(101),
|
||||
),
|
||||
assaultDistance: 0,
|
||||
},
|
||||
{
|
||||
equipmentDefinitions: equipmentDefinitions,
|
||||
|
||||
@@ -60,6 +60,7 @@ const url = import.meta.env.SITE + Astro.url.pathname;
|
||||
const icon = asset(`icons/tanks/big/${id}.webp`);
|
||||
const turret = tank.turrets.at(-1)!;
|
||||
const gun = turret.guns.at(-1)!;
|
||||
const shell = gun.gun_type!.value.base.shells[0];
|
||||
const characteristics = tankCharacteristics(
|
||||
{
|
||||
tank,
|
||||
@@ -74,12 +75,13 @@ const characteristics = tankCharacteristics(
|
||||
turret,
|
||||
gun,
|
||||
provisions: createDefaultProvisions(tank, gun, provisionDefinitions),
|
||||
shell: gun.gun_type!.value.base.shells[0],
|
||||
shell,
|
||||
stockEngine: tank.engines[0],
|
||||
stockGun: tank.turrets[0].guns[0],
|
||||
stockTurret: tank.turrets[0],
|
||||
stockTrack: tank.tracks[0],
|
||||
track: tank.tracks.at(-1)!,
|
||||
assaultDistance: 0,
|
||||
},
|
||||
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user