Add bomb def damage reduction stats

This commit is contained in:
Kalle
2022-09-17 18:19:38 +03:00
parent 5d9a3ea13c
commit 1f26fe68bf
4 changed files with 131 additions and 0 deletions

View File

@@ -87,6 +87,10 @@ export function buildStats({
subDefInkMineMarkedTimeInSeconds: subDefInkMineMarkedTimeInSeconds(input),
subDefAngleShooterMarkedTimeInSeconds:
subDefAngleShooterMarkedTimeInSeconds(input),
subDefToxicMistMovementReduction: subDefToxicMistMovementReduction(input),
subDefAngleShooterDamage: subDefAngleShooterDamage(input),
subDefSplashWallDamagePercentage: subDefSplashWallDamagePercentage(input),
subDefSprinklerDamagePercentage: subDefSprinklerDamagePercentage(input),
...subStats(input),
},
};
@@ -276,6 +280,7 @@ const damageTypeToParamsKey: Record<
MAX_CHARGE: "DamageParam_ValueMaxCharge",
TAP_SHOT: "DamageParam_ValueMinCharge",
BOMB_NORMAL: "DistanceDamage",
BOMB_DIRECT: "DirectDamage",
};
function damages(args: StatFunctionInput): AnalyzedBuild["stats"]["damages"] {
@@ -729,3 +734,89 @@ function subDefAngleShooterMarkedTimeInSeconds(
value: framesToSeconds(markingTimeEffect * effect),
};
}
function subDefToxicMistMovementReduction(
args: StatFunctionInput
): AnalyzedBuild["stats"]["subDefToxicMistMovementReduction"] {
const SUB_DEF_TOXIC_MIST_MOVEMENT_REDUCTION_KEY = "SRU";
const { baseEffect, effect } = abilityPointsToEffects({
abilityPoints: apFromMap({
abilityPoints: args.abilityPoints,
ability: SUB_DEF_TOXIC_MIST_MOVEMENT_REDUCTION_KEY,
}),
key: "MoveDownRt_PoisonMist",
weapon: args.mainWeaponParams,
});
return {
baseValue: roundToTwoDecimalPlaces(baseEffect * 100),
value: roundToTwoDecimalPlaces(effect * 100),
modifiedBy: SUB_DEF_TOXIC_MIST_MOVEMENT_REDUCTION_KEY,
};
}
function subDefAngleShooterDamage(
args: StatFunctionInput
): AnalyzedBuild["stats"]["subDefAngleShooterDamage"] {
const SUB_DEF_ANGLE_SHOOTER_DAMAGE_KEY = "SRU";
const { baseEffect, effect } = abilityPointsToEffects({
abilityPoints: apFromMap({
abilityPoints: args.abilityPoints,
ability: SUB_DEF_ANGLE_SHOOTER_DAMAGE_KEY,
}),
key: "DamageRt_LineMarker",
weapon: args.mainWeaponParams,
});
const angleShooterDirectDamage =
weaponParams().subWeapons[ANGLE_SHOOTER_ID].DirectDamage;
invariant(angleShooterDirectDamage);
return {
baseValue: roundToTwoDecimalPlaces(
(angleShooterDirectDamage * baseEffect) / 10
),
value: roundToTwoDecimalPlaces((angleShooterDirectDamage * effect) / 10),
modifiedBy: SUB_DEF_ANGLE_SHOOTER_DAMAGE_KEY,
};
}
function subDefSplashWallDamagePercentage(
args: StatFunctionInput
): AnalyzedBuild["stats"]["subDefSplashWallDamagePercentage"] {
const SUB_DEF_SPLASH_WALL_DAMAGE_PERCENTAGE_KEY = "SRU";
const { baseEffect, effect } = abilityPointsToEffects({
abilityPoints: apFromMap({
abilityPoints: args.abilityPoints,
ability: SUB_DEF_SPLASH_WALL_DAMAGE_PERCENTAGE_KEY,
}),
key: "DamageRt_Shield",
weapon: args.mainWeaponParams,
});
return {
baseValue: roundToTwoDecimalPlaces(baseEffect * 100),
value: roundToTwoDecimalPlaces(effect * 100),
modifiedBy: SUB_DEF_SPLASH_WALL_DAMAGE_PERCENTAGE_KEY,
};
}
function subDefSprinklerDamagePercentage(
args: StatFunctionInput
): AnalyzedBuild["stats"]["subDefSprinklerDamagePercentage"] {
const SUB_DEF_SPRINKLER_DAMAGE_PERCENTAGE_KEY = "SRU";
const { baseEffect, effect } = abilityPointsToEffects({
abilityPoints: apFromMap({
abilityPoints: args.abilityPoints,
ability: SUB_DEF_SPRINKLER_DAMAGE_PERCENTAGE_KEY,
}),
key: "DamageRt_Sprinkler",
weapon: args.mainWeaponParams,
});
return {
baseValue: roundToTwoDecimalPlaces(baseEffect * 100),
value: roundToTwoDecimalPlaces(effect * 100),
modifiedBy: SUB_DEF_SPRINKLER_DAMAGE_PERCENTAGE_KEY,
};
}

View File

@@ -145,6 +145,7 @@ export const DAMAGE_TYPE = [
"TAP_SHOT",
"DISTANCE",
"BOMB_NORMAL",
"BOMB_DIRECT",
] as const;
export type DamageType = typeof DAMAGE_TYPE[number];
@@ -189,6 +190,10 @@ export interface AnalyzedBuild {
subDefPointSensorMarkedTimeInSeconds: Stat;
subDefInkMineMarkedTimeInSeconds: Stat;
subDefAngleShooterMarkedTimeInSeconds: Stat;
subDefToxicMistMovementReduction: Stat;
subDefAngleShooterDamage: Stat;
subDefSplashWallDamagePercentage: Stat;
subDefSprinklerDamagePercentage: Stat;
// subDefBombDamageLight: Stat;
// subDefBombDamageHeavy: Stat;
// subDefAngleShooterDamage: Stat;

View File

@@ -20,6 +20,11 @@ import type {
SpecialEffectType,
} from "~/modules/analyzer/types";
import type { BuildAbilitiesTupleWithUnknown } from "~/modules/in-game-lists";
import {
SPLASH_WALL_ID,
SPRINKLER_ID,
TOXIC_MIST_ID,
} from "~/modules/in-game-lists";
import { ANGLE_SHOOTER_ID } from "~/modules/in-game-lists";
import { INK_MINE_ID, POINT_SENSOR_ID } from "~/modules/in-game-lists";
import {
@@ -210,6 +215,34 @@ export default function BuildAnalyzerPage() {
/>
</StatCategory>
<StatCategory title={t("analyzer:stat.category.subDef")}>
<StatCard
stat={analyzed.stats.subDefAngleShooterDamage}
title={t("analyzer:stat.damage", {
weapon: t(`weapons:SUB_${ANGLE_SHOOTER_ID}`),
})}
suffix={t("analyzer:suffix.hp")}
/>
<StatCard
stat={analyzed.stats.subDefSplashWallDamagePercentage}
title={t("analyzer:stat.damage", {
weapon: t(`weapons:SUB_${SPLASH_WALL_ID}`),
})}
suffix="%"
/>
<StatCard
stat={analyzed.stats.subDefSprinklerDamagePercentage}
title={t("analyzer:stat.damage", {
weapon: t(`weapons:SUB_${SPRINKLER_ID}`),
})}
suffix="%"
/>
<StatCard
stat={analyzed.stats.subDefToxicMistMovementReduction}
title={t("analyzer:stat.movementReduction", {
weapon: t(`weapons:SUB_${TOXIC_MIST_ID}`),
})}
suffix="%"
/>
<StatCard
stat={analyzed.stats.subDefPointSensorMarkedTimeInSeconds}
title={t("analyzer:stat.markedTime", {

View File

@@ -28,6 +28,8 @@
"stat.damageTakenInEnemyInkPerSecond": "Damage from enemy ink per second",
"stat.enemyInkDamageLimit": "Max damage from enemy ink",
"stat.markedTime": "{{weapon}} tracking time",
"stat.movementReduction": "{{weapon}} movement reduction",
"stat.damage": "{{weapon}} damage",
"stat.consumption.NORMAL": "Shots",
"stat.consumption.SWING": "Swings",
"stat.consumption.SLOSH": "Sloshes",