import React from "react"; import { Grid, Table, TableBody, TableCell, TableRow, Tooltip, Typography } from "@mui/material"; import { GoOpponent } from "@enums"; import { Go } from "../Go"; import { getOpponentStats, getScore } from "../boardAnalysis/scoring"; import { GoGameboard } from "./GoGameboard"; import { boardStyles } from "../boardState/goStyles"; import { useRerender } from "../../ui/React/hooks"; import { getBonusText, getMaxFavor } from "../effects/effect"; import { formatNumber } from "../../ui/formatNumber"; import { GoScoreSummaryTable } from "./GoScoreSummaryTable"; import { getNewBoardState } from "../boardState/boardState"; import { CorruptableText } from "../../ui/React/CorruptableText"; import { getRecordKeys } from "../../Types/Record"; export const GoHistoryPage = (): React.ReactElement => { useRerender(400); const { classes } = boardStyles({}); const priorBoard = Go.previousGame ?? getNewBoardState(7); const score = getScore(priorBoard); const opponent = priorBoard.ai; const opponentsToShow = getRecordKeys(Go.stats); return (
Previous Subnet:
({ x, y })} hover={false} />


Faction Stats: {opponentsToShow.map((faction, index) => { const data = getOpponentStats(faction); return ( {" "} {faction === GoOpponent.w0r1d_d43m0n ? ( ) : ( faction )} Wins:{faction === GoOpponent.none ? " (Black / White)" : ""} {data.wins} / {data.losses + data.wins} Current winstreak{faction === GoOpponent.none ? " for black" : ""}: {data.winStreak} Highest winstreak{faction === GoOpponent.none ? " for black" : ""}: {data.highestWinStreak} The total number of empty points and routers
you took control of, across all subnets } > Captured nodes: {data.nodes}
Node power is what stat bonuses scale from, and is gained on each completed subnet.
It is calculated from the number of nodes you control, multiplied by modifiers for the
opponent difficulty, if you won or lost, and your current winstreak. } > Node power: {formatNumber(data.nodePower, 2)}
Win streaks against a faction will give you +1 favor to that faction
at certain numbers of wins (up to a max of {getMaxFavor()} favor),
if you are currently a member of that faction } > Favor from winstreaks: {data.favor ?? 0} {data.favor === getMaxFavor() ? "(max)" : ""}

The total stat multiplier gained via your current node power.}> Bonus:
{getBonusText(faction)}
); })}
); };