Finished cc stats
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
getCopsAndCrimsExtraUpgrade,
|
||||
getCopsAndCrimsGunName,
|
||||
getCopsAndCrimsGunUgrade,
|
||||
getCopsAndCrimsGunUgradeColor,
|
||||
@@ -33,17 +34,27 @@ export default function CopsAndCrimsWeaponStats({ stats }: { stats: NonNullable<
|
||||
function KnifeStats({ gunId, stats }: { gunId: Parameters<typeof getCopsAndCrimsGunName>[0], stats: NonNullable<NonNullStats["CopsAndCrims"]> }) {
|
||||
const name = getCopsAndCrimsGunName(gunId)
|
||||
const upgrades = getCopsAndCrimsGunUgrade(gunId, stats)
|
||||
const extra = getCopsAndCrimsExtraUpgrade(stats)
|
||||
const sniperPercent = extra.sniper / 9 * 100
|
||||
const sniperColor = getCopsAndCrimsGunUgradeColor(extra.sniper)
|
||||
const knifePercent = extra.knife / 9 * 100
|
||||
const knifeColor = getCopsAndCrimsGunUgradeColor(extra.knife)
|
||||
return (
|
||||
<div>
|
||||
<h3 className="pb-1 font-bold text-md">{name}</h3>
|
||||
<div className="flex gap-2">
|
||||
<div className="space-y-2">
|
||||
<>
|
||||
{upgrades.map((u, i) => {
|
||||
const upgrade = getCopsAndCrimsUpgardeName(u.upgradeId)
|
||||
return <p key={i}>{upgrade}</p>
|
||||
})}
|
||||
{gunId === "knife" && <p>{getCopsAndCrimsUpgardeName("attack_delay")}</p>}
|
||||
{gunId === "sniper" && <p>{getCopsAndCrimsUpgardeName("charge_bonus")}</p>}
|
||||
</>
|
||||
</div>
|
||||
<div className="flex-1 space-y-2">
|
||||
<>
|
||||
{upgrades.map((u, i) => {
|
||||
const color = getCopsAndCrimsGunUgradeColor(u.value)
|
||||
const percent = u.value / 9 * 100
|
||||
@@ -55,6 +66,33 @@ function KnifeStats({ gunId, stats }: { gunId: Parameters<typeof getCopsAndCrims
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
{gunId === "knife" && (
|
||||
<div>
|
||||
{knifePercent !== 0 ?
|
||||
(
|
||||
<GenericProgressNoTooltip
|
||||
percent={knifePercent}
|
||||
text={romanize(extra.knife)}
|
||||
className={`bg-mc-${knifeColor}`}
|
||||
/>
|
||||
) :
|
||||
<div className="flex flex-1 justify-center rounded-md bg-background">-</div>}
|
||||
</div>
|
||||
)}
|
||||
{gunId === "sniper" && (
|
||||
<div>
|
||||
{sniperPercent !== 0 ?
|
||||
(
|
||||
<GenericProgressNoTooltip
|
||||
percent={sniperPercent}
|
||||
text={romanize(extra.sniper)}
|
||||
className={`bg-mc-${sniperColor}`}
|
||||
/>
|
||||
) :
|
||||
<div className="flex flex-1 justify-center rounded-md bg-background">-</div>}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user