quick respawn for analyzer

This commit is contained in:
Sendou 2020-05-22 20:33:51 +03:00
parent 7d8d4acc30
commit de6bc3bbdf
4 changed files with 210 additions and 3674 deletions

View File

@ -1,4 +1,4 @@
import { Box, FormLabel, Switch } from "@chakra-ui/core"
import { Box, FormLabel, Switch, Badge } from "@chakra-ui/core"
import { RouteComponentProps } from "@reach/router"
import React, { useState, useContext } from "react"
import { Helmet } from "react-helmet-async"
@ -29,6 +29,7 @@ const BuildAnalyzerPage: React.FC<RouteComponentProps> = () => {
<title>Build Analyzer | sendou.ink</title>
</Helmet>
<PageHeader title="Build Analyzer" />
<Badge variantColor={themeColor}>Patch 5.2.</Badge>
<Box my="1em">
<WeaponSelector
value={build.weapon}
@ -37,13 +38,7 @@ const BuildAnalyzerPage: React.FC<RouteComponentProps> = () => {
menuIsOpen={!build.weapon}
/>
</Box>
<Box my="1em">
<BuildStats
build={build}
explanations={explanations}
hideExtra={hideExtra}
/>
</Box>
<EditableBuild build={build} setBuild={setBuild} />
<Box my="1em">
<FormLabel htmlFor="show-all">Hide stats at base value</FormLabel>
<Switch
@ -53,7 +48,13 @@ const BuildAnalyzerPage: React.FC<RouteComponentProps> = () => {
onChange={() => setHideExtra(!hideExtra)}
/>
</Box>
<EditableBuild build={build} setBuild={setBuild} />
<Box my="1em">
<BuildStats
build={build}
explanations={explanations}
hideExtra={hideExtra}
/>
</Box>
</>
)
}

View File

@ -9,6 +9,7 @@ export interface Explanation {
effect: string
effectFromMax: number
ability: Ability
info?: string
}
interface WeaponDataFromJson {
@ -471,6 +472,10 @@ export default function useAbilityEffects(build: Partial<Build>) {
)} seconds)`,
effectFromMax: effect[1] * 100,
ability: "SPU" as Ability,
info:
specialWeapon === "Inkjet"
? "Special Power Up also increases Ink Jet's shots' painting and blast radius"
: undefined,
})
}
@ -508,9 +513,198 @@ export default function useAbilityEffects(build: Partial<Build>) {
})
}
if (specialWeapon === "Splashdown") {
const highNear = specialWeaponData.mBurst_Radius_Near_H
const lowNear = specialWeaponData.mBurst_Radius_Near
const midNear = (highNear + lowNear) / 2
const highMidLowNear = [highNear, midNear, lowNear]
const effectNear = getEffect(highMidLowNear, amount)
const effectAtZeroNear = getEffect(highMidLowNear, 0)
const highMiddle = specialWeaponData.mBurst_Radius_Middle_H
const lowMiddle = specialWeaponData.mBurst_Radius_Middle
const midMiddle = (highMiddle + lowMiddle) / 2
const highMidLowMiddle = [highMiddle, midMiddle, lowMiddle]
const effectMiddle = getEffect(highMidLowMiddle, amount)
const effectAtZeroMiddle = getEffect(highMidLowMiddle, 0)
toReturn.push({
title: "Splashdown 180dmg hitbox size",
effect: `${parseFloat(
((effectNear[0] / effectAtZeroNear[0]) * 100).toFixed(2)
)}%`,
effectFromMax: effectNear[1] * 100,
ability: "SPU" as Ability,
})
toReturn.push({
title: "Splashdown 70dmg hitbox size",
effect: `${parseFloat(
((effectMiddle[0] / effectAtZeroMiddle[0]) * 100).toFixed(2)
)}%`,
effectFromMax: effectMiddle[1] * 100,
ability: "SPU" as Ability,
info:
"55dmg hitbox can't be increased with Special Power Up so the total radius of the special doesn't change",
})
}
if (specialWeapon === "Ink Armor") {
const high = specialWeaponData.mEnergyAbsorbFrmH
const mid = specialWeaponData.mEnergyAbsorbFrmM
const low = specialWeaponData.mEnergyAbsorbFrm
const highMidLow = [high, mid, low]
const effect = getEffect(highMidLow, amount)
toReturn.push({
title: `Ink Armor activation time`,
effect: `${Math.ceil(effect[0])} frames (${parseFloat(
(effect[0] / 60).toFixed(2)
)} seconds)`,
effectFromMax: effect[1] * 100,
ability: "SPU" as Ability,
})
}
if (specialWeapon === "Ink Storm") {
const high = specialWeaponData.mRainAreaFrameHigh
const mid = specialWeaponData.mRainAreaFrameMid
const low = specialWeaponData.mRainAreaFrame
const highMidLow = [high, mid, low]
const effect = getEffect(highMidLow, amount)
toReturn.push({
title: `Ink Storm duration`,
effect: `${Math.ceil(effect[0])} frames (${parseFloat(
(effect[0] / 60).toFixed(2)
)} seconds)`,
effectFromMax: effect[1] * 100,
ability: "SPU" as Ability,
info:
"Amount inked by Ink Storm is not increased only in how long distance the droplets are spread",
})
}
if (specialWeapon === "Baller") {
const high = specialWeaponData.mHP_High
const mid = specialWeaponData.mHP_Mid
const low = specialWeaponData.mHP_Low
const highMidLow = [high, mid, low]
const effect = getEffect(highMidLow, amount)
const effectAtZero = getEffect(highMidLow, 0)
toReturn.push({
title: `Baller durability`,
effect: `${parseFloat(
((effect[0] / effectAtZero[0]) * 100).toFixed(2)
)}%`,
effectFromMax: effect[1] * 100,
ability: "SPU" as Ability,
})
const highHit = specialWeaponData.mBurst_Radius_FarHigh
const midHit = specialWeaponData.mBurst_Radius_FarMid
const lowHit = specialWeaponData.mBurst_Radius_Far
const highMidLowHit = [highHit, midHit, lowHit]
const effectHit = getEffect(highMidLowHit, amount)
const effectAtZeroHit = getEffect(highMidLowHit, 0)
toReturn.push({
title: `Baller 55dmg explosion hitbox size`,
effect: `${parseFloat(
((effectHit[0] / effectAtZeroHit[0]) * 100).toFixed(2)
)}%`,
effectFromMax: effectHit[1] * 100,
ability: "SPU" as Ability,
})
}
if (specialWeapon === "Bubble Blower") {
const highSize = specialWeaponData.mBombCoreRadiusRateHigh
const midSize = specialWeaponData.mBombCoreRadiusRateMid
const lowSize = 1.0
const highMidLowSize = [highSize, midSize, lowSize]
const effectSize = getEffect(highMidLowSize, amount)
const effectAtZeroSize = getEffect(highMidLowSize, 0)
toReturn.push({
title: `Bubble Blower bubble size`,
effect: `${parseFloat(
((effectSize[0] / effectAtZeroSize[0]) * 100).toFixed(2)
)}%`,
effectFromMax: effectSize[1] * 100,
ability: "SPU" as Ability,
})
const highHit = specialWeaponData.mCollisionPlayerRadiusMaxHigh
const midHit = specialWeaponData.mCollisionPlayerRadiusMaxMid
const lowHit = specialWeaponData.mCollisionPlayerRadiusMax
const highMidLowHit = [highHit, midHit, lowHit]
const effectHit = getEffect(highMidLowHit, amount)
const effectAtZeroHit = getEffect(highMidLowHit, 0)
toReturn.push({
title: `Bubble Blower explosion hitbox`,
effect: `${parseFloat(
((effectHit[0] / effectAtZeroHit[0]) * 100).toFixed(2)
)}%`,
effectFromMax: effectHit[1] * 100,
ability: "SPU" as Ability,
})
}
if (specialWeapon === "Booyah Bomb") {
const high = specialWeaponData.mChargeRtAutoIncr_High
const mid = specialWeaponData.mChargeRtAutoIncr_Mid
const low = specialWeaponData.mChargeRtAutoIncr_Low
const highMidLow = [high, mid, low]
const effect = getEffect(highMidLow, amount)
const effectAtZero = getEffect(highMidLow, 0)
toReturn.push({
title: `Booyah Bomb autocharge speed`,
effect: `${parseFloat(
((effect[0] / effectAtZero[0]) * 100).toFixed(2)
)}%`,
effectFromMax: effect[1] * 100,
ability: "SPU" as Ability,
})
}
return toReturn
}
function calculateQR(amount: number) {
const QR = abilityJson["Quick Respawn"]
const highAround = QR.Dying_AroudFrm_High
const midAround = QR.Dying_AroudFrm_Mid
const lowAround = QR.Dying_AroudFrm_Low
const highMidLowAround = [highAround, midAround, lowAround]
const effectAround = getEffect(highMidLowAround, amount)
const highChase = QR.Dying_ChaseFrm_High
const midChase = QR.Dying_ChaseFrm_Mid
const lowChase = QR.Dying_ChaseFrm_Low
const highMidLowChase = [highChase, midChase, lowChase]
const effectChase = getEffect(highMidLowChase, amount)
const totalFrames = Math.ceil(150 + effectAround[0] + effectChase[0])
return [
{
title: "Quick Respawn time",
effect: `${totalFrames} frames (${parseFloat(
(totalFrames / 60).toFixed(2)
)} seconds)`,
effectFromMax: effectAround[1] * 100,
ability: "QR" as Ability,
info:
"Quick Respawn activates when enemy kills you twice without you getting a kill in between",
},
]
}
const abilityFunctions: Partial<Record<
string,
(amount: number) => Explanation[]
@ -523,6 +717,7 @@ export default function useAbilityEffects(build: Partial<Build>) {
SCU: calculateSCU,
SS: calculateSS,
SPU: calculateSPU,
QR: calculateQR,
} as const
useEffect(() => {

File diff suppressed because one or more lines are too long

View File

@ -84,13 +84,13 @@ special_power_keys = {
"mEnergyAbsorbFrm": "Armor Wind Up Time", # armor
"mPaintGauge_SpecialFrm": "Special Duration Time", # generic duration
"mBurst_SplashPaintR": "Splash Paint Radius", # inkjet
"mBurst_SplashVelL": "Splash Velocity L", # splashdown
"mBurst_SplashVelH": "Splash Velocity H", # splashdown
"mBurst_SplashVelL": "Splash Velocity L",
"mBurst_SplashVelH": "Splash Velocity H",
# "mBurst_Landing_AddHeight": "Additional High", unused probably splashdown values
# "mBurst_Landing_AddHeight_SJ": "Additional High (Super Jump)",
"mRainAreaFrame": "Rain Duration", # ink storm
"mBurst_Radius_Far": "Explosion Radius (Far)", # baller
"mBurst_Radius_Middle": "Explosion Radius (Middle)", # baller
"mBurst_Radius_Near": "Explosion Radius (Near)",
"mBurst_Radius_Middle": "Explosion Radius (Middle)",
# "mBurst_Radius_Near": "Explosion Radius (Near)", # baller commented out because currently unchanged by SPU
"mHP": "HP", # baller
"mBombCoreRadiusRate": "Bubble Size Radius Rate", # bubble blower