mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +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 {
|
message AssaultRanges {
|
||||||
repeated AssaultRange ranges = 1;
|
repeated AssaultRange ranges = 1;
|
||||||
|
repeated ShellType types = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AssaultRange {
|
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;
|
let assault_ranges: AssaultRanges | undefined;
|
||||||
|
|
||||||
if (gun.extras?.trayShell) {
|
if (gun.extras?.trayShell) {
|
||||||
const kinds = gun.extras.trayShell.kinds
|
const types = gun.extras.trayShell.kinds
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.map((string) => {
|
.map((string) => {
|
||||||
const trimmed = string.trim();
|
const trimmed = string.trim();
|
||||||
@@ -1270,6 +1270,7 @@ export async function definitions() {
|
|||||||
const sector = gun.extras.trayShell.sectors.sector;
|
const sector = gun.extras.trayShell.sectors.sector;
|
||||||
|
|
||||||
assault_ranges = {
|
assault_ranges = {
|
||||||
|
types,
|
||||||
ranges: sector.map((value) => ({
|
ranges: sector.map((value) => ({
|
||||||
factor: value.factor,
|
factor: value.factor,
|
||||||
distance: value.distance,
|
distance: value.distance,
|
||||||
|
|||||||
+1
@@ -118,6 +118,7 @@ export function InfoWithDelta({
|
|||||||
tank,
|
tank,
|
||||||
track: member.track,
|
track: member.track,
|
||||||
turret: member.turret,
|
turret: member.turret,
|
||||||
|
assaultDistance: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
equipmentDefinitions,
|
equipmentDefinitions,
|
||||||
|
|||||||
+1
@@ -58,6 +58,7 @@ export function Characteristics() {
|
|||||||
applyReactiveArmor: false,
|
applyReactiveArmor: false,
|
||||||
applyDynamicArmor: false,
|
applyDynamicArmor: false,
|
||||||
applySpallLiner: false,
|
applySpallLiner: false,
|
||||||
|
assaultDistance: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tankModelDefinition,
|
tankModelDefinition,
|
||||||
|
|||||||
+1
@@ -96,6 +96,7 @@ export function SceneProps() {
|
|||||||
stockTurret: tank.turrets[0],
|
stockTurret: tank.turrets[0],
|
||||||
stockTrack: tank.tracks[0],
|
stockTrack: tank.tracks[0],
|
||||||
track,
|
track,
|
||||||
|
assaultDistance: 0,
|
||||||
},
|
},
|
||||||
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ export function tankCharacteristics(
|
|||||||
applyReactiveArmor,
|
applyReactiveArmor,
|
||||||
applyDynamicArmor,
|
applyDynamicArmor,
|
||||||
applySpallLiner,
|
applySpallLiner,
|
||||||
|
assaultDistance,
|
||||||
}: {
|
}: {
|
||||||
tank: TankDefinition;
|
tank: TankDefinition;
|
||||||
turret: TurretDefinition;
|
turret: TurretDefinition;
|
||||||
@@ -65,6 +66,7 @@ export function tankCharacteristics(
|
|||||||
applyReactiveArmor: boolean;
|
applyReactiveArmor: boolean;
|
||||||
applyDynamicArmor: boolean;
|
applyDynamicArmor: boolean;
|
||||||
applySpallLiner: boolean;
|
applySpallLiner: boolean;
|
||||||
|
assaultDistance: number;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tankModelDefinition,
|
tankModelDefinition,
|
||||||
@@ -157,6 +159,13 @@ export function tankCharacteristics(
|
|||||||
[applyDynamicArmor, -0.1],
|
[applyDynamicArmor, -0.1],
|
||||||
[applySpallLiner && shell.type === ShellType.HE, -0.2],
|
[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 moduleDamageCoefficient = coefficient([hasTungsten, 0.15]);
|
||||||
const reloadCoefficient =
|
const reloadCoefficient =
|
||||||
(coefficient([hasGunRammer, -0.05]) *
|
(coefficient([hasGunRammer, -0.05]) *
|
||||||
@@ -326,10 +335,11 @@ export function tankCharacteristics(
|
|||||||
stockTurret.weight +
|
stockTurret.weight +
|
||||||
stockGun.gun_type!.value.base.weight;
|
stockGun.gun_type!.value.base.weight;
|
||||||
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
||||||
|
const damageCoefficient = armorDamageCoefficient * assaultDamageCoefficient;
|
||||||
const dpm = resolveDpm(
|
const dpm = resolveDpm(
|
||||||
gun,
|
gun,
|
||||||
shell,
|
shell,
|
||||||
armorDamageCoefficient,
|
damageCoefficient,
|
||||||
reloadCoefficient,
|
reloadCoefficient,
|
||||||
intraClipCoefficient,
|
intraClipCoefficient,
|
||||||
);
|
);
|
||||||
@@ -352,7 +362,7 @@ export function tankCharacteristics(
|
|||||||
return current;
|
return current;
|
||||||
}, null)!.index
|
}, null)!.index
|
||||||
: undefined;
|
: undefined;
|
||||||
const damage = shell.armor_damage * armorDamageCoefficient;
|
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.extension.shell_reloads[0] >
|
? gun.gun_type!.value.extension.shell_reloads[0] >
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ function Content() {
|
|||||||
member.key !== thisMember.key &&
|
member.key !== thisMember.key &&
|
||||||
member.provisions.includes(101),
|
member.provisions.includes(101),
|
||||||
),
|
),
|
||||||
|
assaultDistance: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
equipmentDefinitions: equipmentDefinitions,
|
equipmentDefinitions: equipmentDefinitions,
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ const url = import.meta.env.SITE + Astro.url.pathname;
|
|||||||
const icon = asset(`icons/tanks/big/${id}.webp`);
|
const icon = asset(`icons/tanks/big/${id}.webp`);
|
||||||
const turret = tank.turrets.at(-1)!;
|
const turret = tank.turrets.at(-1)!;
|
||||||
const gun = turret.guns.at(-1)!;
|
const gun = turret.guns.at(-1)!;
|
||||||
|
const shell = gun.gun_type!.value.base.shells[0];
|
||||||
const characteristics = tankCharacteristics(
|
const characteristics = tankCharacteristics(
|
||||||
{
|
{
|
||||||
tank,
|
tank,
|
||||||
@@ -74,12 +75,13 @@ const characteristics = tankCharacteristics(
|
|||||||
turret,
|
turret,
|
||||||
gun,
|
gun,
|
||||||
provisions: createDefaultProvisions(tank, gun, provisionDefinitions),
|
provisions: createDefaultProvisions(tank, gun, provisionDefinitions),
|
||||||
shell: gun.gun_type!.value.base.shells[0],
|
shell,
|
||||||
stockEngine: tank.engines[0],
|
stockEngine: tank.engines[0],
|
||||||
stockGun: tank.turrets[0].guns[0],
|
stockGun: tank.turrets[0].guns[0],
|
||||||
stockTurret: tank.turrets[0],
|
stockTurret: tank.turrets[0],
|
||||||
stockTrack: tank.tracks[0],
|
stockTrack: tank.tracks[0],
|
||||||
track: tank.tracks.at(-1)!,
|
track: tank.tracks.at(-1)!,
|
||||||
|
assaultDistance: 0,
|
||||||
},
|
},
|
||||||
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user