mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-12 20:26:10 +01: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: {
|
||||
type: CharacteristicType.Number,
|
||||
compute({ shell, environment, equalizer, script }) {
|
||||
compute({ shell, environment, equalizer, script, gun }) {
|
||||
let coefficient = 1;
|
||||
|
||||
if (environment.equalize) coefficient *= equalizer.damage;
|
||||
@@ -55,6 +55,14 @@ export const characteristics = {
|
||||
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;
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user