mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
reload
This commit is contained in:
1 parent
474e71843d
commit
7cb3df3da2
5 files changed
+51
-21
No files matched your search
@@ -87,12 +87,36 @@ export const characteristics = {
|
||||
let coefficient = 1;
|
||||
|
||||
script("protagonist", "CalibratedShells", (effect) => {
|
||||
coefficient *=
|
||||
1 +
|
||||
coefficient +=
|
||||
effect.piercingFactors![blitzkitToBlitzShellKind[shell.type]] / 100;
|
||||
});
|
||||
|
||||
return coefficient * shell.penetration!.near;
|
||||
},
|
||||
},
|
||||
|
||||
reload: {
|
||||
type: CharacteristicType.Number,
|
||||
|
||||
should_render({ gun }) {
|
||||
return gun.gun_type!.$case !== "auto_reloader";
|
||||
},
|
||||
|
||||
compute({ gun, script }) {
|
||||
// should never happen! just for typescript
|
||||
if (gun.gun_type!.$case === "auto_reloader") return -Infinity;
|
||||
|
||||
let coefficient = 1;
|
||||
|
||||
script("protagonist", "miscAttrs/gunReloadTimeFactor", (effect) => {
|
||||
coefficient += effect.bonusValues!.percent / 100;
|
||||
});
|
||||
|
||||
if (gun.gun_type!.$case === "regular") {
|
||||
return coefficient * gun.gun_type!.value.reload;
|
||||
}
|
||||
|
||||
return gun.gun_type!.value.clip_reload;
|
||||
},
|
||||
},
|
||||
} satisfies Record<string, Characteristic>;
|
||||
@@ -362,7 +362,6 @@ export function tankCharacteristics(
|
||||
: undefined;
|
||||
const damageWithoutAssault =
|
||||
shell.armor_damage * damageCoefficientWithoutAssault;
|
||||
const damage = shell.armor_damage * damageCoefficient;
|
||||
const dpmEffective =
|
||||
gun.gun_type!.$case === "auto_reloader"
|
||||
? gun.gun_type!.value.shell_reloads[0] >
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { literalsArray } from "@blitzkit/i18n/src/literals";
|
||||
import { useMemo, type ReactNode } from "react";
|
||||
import { type ReactNode } from "react";
|
||||
import { Text } from "../components/Text";
|
||||
import { characteristicsGroups } from "../config/characteristicsGroups";
|
||||
import type {
|
||||
CharacteristicRenderConfig,
|
||||
CharacteristicReturnType,
|
||||
@@ -10,20 +9,6 @@ import { useLocale } from "./useLocale";
|
||||
import { useStrings } from "./useStrings";
|
||||
|
||||
export function useCharacteristicRenderer() {
|
||||
const groups = useMemo(() => {
|
||||
const groups: string[] = [];
|
||||
|
||||
for (const group of characteristicsGroups) {
|
||||
for (const item of group.order) {
|
||||
if ("strings" in item && item.strings) {
|
||||
groups.push(item.strings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return groups;
|
||||
}, []);
|
||||
|
||||
const locale = useLocale();
|
||||
const strings = useStrings();
|
||||
|
||||
|
||||
Reference in new issue
Block a user