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