actual ap values for non-lde abilities

This commit is contained in:
Sendou
2020-05-24 13:06:16 +03:00
parent b5b63b3366
commit 47dc9b36bd
3 changed files with 64 additions and 5 deletions

View File

@@ -30,9 +30,7 @@ const BuildStats: React.FC<BuildStatsProps> = ({
hideExtra,
}) => {
const { colorMode } = useContext(MyThemeContext)
const [expandedCharts, setExpandedCharts] = useState<Set<string>>(
new Set(["Shots per ink tank"])
)
const [expandedCharts, setExpandedCharts] = useState<Set<string>>(new Set())
const abilityArrays: Ability[][] = [
build.headgear ?? [],
@@ -158,6 +156,7 @@ const BuildStats: React.FC<BuildStatsProps> = ({
ap={ap}
otherAp={otherAp}
getEffect={getEffect}
ability={ability}
/>
</Box>
)}

View File

@@ -10,12 +10,15 @@ import {
Line,
} from "recharts"
import MyThemeContext from "../../themeContext"
import { Ability } from "../../types"
import { possibleAps } from "../../utils/lists"
interface StatChartProps {
title: string
getEffect: (ap: number) => number
ap: number
otherAp?: number
ability: Ability
}
const StatChart: React.FC<StatChartProps> = ({
@@ -23,13 +26,21 @@ const StatChart: React.FC<StatChartProps> = ({
ap,
otherAp,
getEffect,
ability,
}) => {
const { themeColorHex, darkerBgColor } = useContext(MyThemeContext)
const getData = () => {
const toReturn = []
for (let i = 0; i < 58; i++) {
toReturn.push({ name: `${i}AP`, [title]: getEffect(i) })
const LDEAbilities = ["ISM", "ISS", "REC"]
if (LDEAbilities.includes(ability)) {
for (let i = 0; i < 58; i++) {
toReturn.push({ name: `${i}AP`, [title]: getEffect(i) })
}
} else {
possibleAps.forEach((ap) => {
toReturn.push({ name: `${ap}AP`, [title]: getEffect(ap) })
})
}
return toReturn

View File

@@ -1,5 +1,54 @@
import { Weapon, Ability, HeadGear, ClothingGear, ShoesGear } from "../types"
export const possibleAps = [
0,
3,
6,
9,
10,
12,
13,
15,
16,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
50,
51,
53,
54,
56,
57,
] as const
export const weaponCodes: Record<string, Weapon> = {
"sploosh-o-matic": "Sploosh-o-matic",
"neo_sploosh-o-matic": "Neo Sploosh-o-matic",