From 9c0fdf0dfea550c347a4c7df48d35d19b8b9ce14 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 18 Jun 2023 14:56:46 +0300 Subject: [PATCH] Special damages: Ultra Stamp --- .../build-analyzer/analyzer-constants.ts | 6 +++++ app/features/build-analyzer/analyzer-types.ts | 3 +++ app/features/build-analyzer/core/stats.ts | 3 +++ .../build-analyzer/core/weapon-params.json | 23 ++++++++++++++++++- .../calculator-constants.ts | 6 ++--- .../calculator-hooks.ts | 3 +++ public/locales/en/analyzer.json | 3 +++ scripts/create-analyzer-json.ts | 21 +++++++++++++++++ 8 files changed, 64 insertions(+), 4 deletions(-) diff --git a/app/features/build-analyzer/analyzer-constants.ts b/app/features/build-analyzer/analyzer-constants.ts index 7b07c60fa..e473e5c3f 100644 --- a/app/features/build-analyzer/analyzer-constants.ts +++ b/app/features/build-analyzer/analyzer-constants.ts @@ -31,6 +31,9 @@ export const DAMAGE_TYPE = [ "ROLL_OVER", "SPECIAL_MAX_CHARGE", "SPECIAL_MIN_CHARGE", + "SPECIAL_THROW_DIRECT", + "SPECIAL_THROW", + "SPECIAL_SWING", ] as const; export const damageTypeToWeaponType: Record< @@ -64,6 +67,9 @@ export const damageTypeToWeaponType: Record< WAVE: "SPECIAL", SPECIAL_MAX_CHARGE: "SPECIAL", SPECIAL_MIN_CHARGE: "SPECIAL", + SPECIAL_SWING: "SPECIAL", + SPECIAL_THROW: "SPECIAL", + SPECIAL_THROW_DIRECT: "SPECIAL", }; export const multiShot: Partial> = { diff --git a/app/features/build-analyzer/analyzer-types.ts b/app/features/build-analyzer/analyzer-types.ts index d0696c69f..7f9b0e703 100644 --- a/app/features/build-analyzer/analyzer-types.ts +++ b/app/features/build-analyzer/analyzer-types.ts @@ -127,6 +127,9 @@ export type SpecialWeaponParams = SpecialWeaponParamsObject[SpecialWeaponId] & { WaveDamage?: number; ExhaleBlastParamMaxChargeDistanceDamage?: Array; ExhaleBlastParamMinChargeDistanceDamage?: Array; + SwingDamage?: Array; + ThrowDamage?: Array; + ThrowDirectDamage?: number; }; export type ParamsJson = { diff --git a/app/features/build-analyzer/core/stats.ts b/app/features/build-analyzer/core/stats.ts index 24b04bddc..7449ea956 100644 --- a/app/features/build-analyzer/core/stats.ts +++ b/app/features/build-analyzer/core/stats.ts @@ -425,6 +425,9 @@ const damageTypeToParamsKey: Record< WAVE: "WaveDamage", SPECIAL_MAX_CHARGE: "ExhaleBlastParamMaxChargeDistanceDamage", SPECIAL_MIN_CHARGE: "ExhaleBlastParamMinChargeDistanceDamage", + SPECIAL_SWING: "SwingDamage", + SPECIAL_THROW: "ThrowDamage", + SPECIAL_THROW_DIRECT: "ThrowDirectDamage", }; function damages(args: StatFunctionInput): AnalyzedBuild["stats"]["damages"] { diff --git a/app/features/build-analyzer/core/weapon-params.json b/app/features/build-analyzer/core/weapon-params.json index e7627da21..34954a393 100644 --- a/app/features/build-analyzer/core/weapon-params.json +++ b/app/features/build-analyzer/core/weapon-params.json @@ -1879,7 +1879,28 @@ "Low": 450, "Mid": 570 } - } + }, + "SwingDamage": [ + { + "Damage": 1000, + "Distance": 0 + }, + { + "Damage": 400, + "Distance": 4 + } + ], + "ThrowDamage": [ + { + "Damage": 600, + "Distance": 4 + }, + { + "Damage": 300, + "Distance": 8 + } + ], + "ThrowDirectDamage": 2200 }, "12": { "ArmorHP": 5000, diff --git a/app/features/object-damage-calculator/calculator-constants.ts b/app/features/object-damage-calculator/calculator-constants.ts index 21b957eb3..87961b10d 100644 --- a/app/features/object-damage-calculator/calculator-constants.ts +++ b/app/features/object-damage-calculator/calculator-constants.ts @@ -158,9 +158,9 @@ export const objectDamageJsonKeyPriority: Record< SuperLanding: null, TripleTornado: null, UltraShot: ["BOMB_NORMAL", "BOMB_DIRECT"], - UltraStamp_Swing: null, - UltraStamp_Throw_BombCore: null, - UltraStamp_Throw: null, + UltraStamp_Swing: ["SPECIAL_SWING"], + UltraStamp_Throw_BombCore: ["SPECIAL_THROW_DIRECT"], + UltraStamp_Throw: ["SPECIAL_THROW"], }; export const damageTypesToCombine: Partial< diff --git a/app/features/object-damage-calculator/calculator-hooks.ts b/app/features/object-damage-calculator/calculator-hooks.ts index 27dc340ba..263ff7d38 100644 --- a/app/features/object-damage-calculator/calculator-hooks.ts +++ b/app/features/object-damage-calculator/calculator-hooks.ts @@ -127,6 +127,9 @@ export const damageTypePriorityList = [ "ROLL_OVER", "SPECIAL_MAX_CHARGE", "SPECIAL_MIN_CHARGE", + "SPECIAL_THROW_DIRECT", + "SPECIAL_THROW", + "SPECIAL_SWING", ] as const; assertType< (typeof damageTypePriorityList)[number], diff --git a/public/locales/en/analyzer.json b/public/locales/en/analyzer.json index 3e3f4782e..edd8ff6ec 100644 --- a/public/locales/en/analyzer.json +++ b/public/locales/en/analyzer.json @@ -113,6 +113,9 @@ "damage.WAVE": "Wave", "damage.SPECIAL_MAX_CHARGE": "Maximum charge", "damage.SPECIAL_MIN_CHARGE": "Minimum charge", + "damage.SPECIAL_THROW_DIRECT": "Throw (Direct)", + "damage.SPECIAL_THROW": "Throw", + "damage.SPECIAL_SWING": "Swing", "suffix.seconds": "s", "suffix.hp": "hp", "suffix.specialPointsShort": "p", diff --git a/scripts/create-analyzer-json.ts b/scripts/create-analyzer-json.ts index f0bdceb70..687708213 100644 --- a/scripts/create-analyzer-json.ts +++ b/scripts/create-analyzer-json.ts @@ -410,6 +410,8 @@ function parametersToSubWeaponResult( }; } +// some specials lack damage values in the params +// so they are instead hardcoded here as a workaround function parametersToSpecialWeaponResult(params: any) { const result: any = {}; @@ -458,6 +460,22 @@ function parametersToSpecialWeaponResult(params: any) { resultUnwrapped["SplashAroundPaintRadius"] = undefined; } + const isUltraStamp = () => !!params["SwingBigBlastParam"]; + const SwingDamage = () => { + if (!isUltraStamp()) return; + + return [ + { Damage: 1000, Distance: 0 }, + ...params["SwingBigBlastParam"]["DistanceDamage"], + ]; + }; + + const ThrowDamage = () => { + if (!isUltraStamp()) return; + + return params["ThrowBlastParam"]["DistanceDamage"]; + }; + return { ArmorHP: params["WeaponSpChariotParam"]?.["ArmorHP"], overwrites: resultUnwrapped, @@ -479,6 +497,9 @@ function parametersToSpecialWeaponResult(params: any) { params["ExhaleBlastParamMinCharge"]?.["DistanceDamage"], ExhaleBlastParamMaxChargeDistanceDamage: params["ExhaleBlastParamMaxCharge"]?.["DistanceDamage"], + SwingDamage: SwingDamage(), + ThrowDamage: ThrowDamage(), + ThrowDirectDamage: params["ThrowMoveParam"]?.["DirectDamageValue"], }; }