-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/HasangerGames/suroi-wiki
- Loading branch information
Showing
7 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import GenericArticlePage from "@/components/generics/GenericArticlePage"; | ||
import PerkSidebar from "@/components/sidebars/PerkSidebar"; | ||
import { Perks } from "@/vendor/suroi/common/src/definitions/perks"; | ||
|
||
const toExport = GenericArticlePage({ | ||
items: Perks.definitions, | ||
path: "perks", | ||
Sidebar: PerkSidebar, | ||
combinedArticles: [] | ||
}); | ||
|
||
export const { generateMetadata, generateStaticParams } = toExport; | ||
export default toExport.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import GenericListingPageFactory from "@/components/layouts/GenericListingPageFactory"; | ||
import { PerkCategories, PerkQualities, Perks } from "@/vendor/suroi/common/src/definitions/perks"; | ||
|
||
const perkDefs = Perks.definitions; | ||
const normalPerks = perkDefs.filter(perk => perk.categories[0] === PerkCategories.Normal); | ||
const halloweenPerks = perkDefs.filter(perk => perk.categories[0] === PerkCategories.Halloween); | ||
const halloweenPerkCountOfType = (type: PerkQualities): number => halloweenPerks.filter(perk => perk.type === type).length; | ||
|
||
export default GenericListingPageFactory( | ||
perkDefs, | ||
"Perks", | ||
"/perks", | ||
`There are currently ${perkDefs.length} perks in the game. | ||
${normalPerks.length} of these are normal perks, and ${halloweenPerks.length} are Halloween perks. | ||
All normal perks are positive. | ||
Of the Halloween perks, ${halloweenPerkCountOfType(PerkQualities.Positive)} are positive, ${halloweenPerkCountOfType(PerkQualities.Neutral)} are neutral, and ${halloweenPerkCountOfType(PerkQualities.Negative)} are negative. | ||
` | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import { | ||
getSuroiImageLink | ||
} from "@/lib/util/suroi"; | ||
import GenericSidebar from "./utils/GenericSidebar"; | ||
import InfoboxColumn from "./utils/InfoboxColumn"; | ||
import InfoboxHeader from "./utils/InfoboxHeader"; | ||
import InfoboxRow from "./utils/InfoboxRow"; | ||
import { PerkCategories, PerkDefinition, PerkQualities } from "@/vendor/suroi/common/src/definitions/perks"; | ||
|
||
export default function PerkSidebar({ | ||
item | ||
}: { | ||
item: PerkDefinition | ||
}) { | ||
let category; | ||
switch (item.categories[0]) { | ||
case PerkCategories.Normal: | ||
category = "Normal"; | ||
break; | ||
case PerkCategories.Halloween: | ||
category = "Halloween"; | ||
break; | ||
} | ||
|
||
let type; | ||
switch (item.type) { | ||
case PerkQualities.Positive: | ||
type = "Positive"; | ||
break; | ||
case PerkQualities.Neutral: | ||
type = "Neutral"; | ||
break; | ||
case PerkQualities.Negative: | ||
type = "Negative"; | ||
break; | ||
} | ||
|
||
const modifiers = Object.entries({ | ||
updateInterval: "Update Interval", | ||
cutoff: "Cutoff", | ||
split: "Split", | ||
deviation: "Deviation", | ||
damageMod: "Damage Modifier", | ||
rangeMod: "Range Modifier", | ||
speedMod: "Speed Modifier", | ||
spreadMod: "Spread Modifier", | ||
reloadMod: "Reload Speed Modifier", | ||
usageMod: "Usage Speed Modifier", | ||
explosionMod: "Explosion Modifier", | ||
sizeMod: "Size Modifier", | ||
healthMod: "Health Modifier", | ||
hpMod: "Health Modifier", | ||
tracerLengthMod: "Tracer Length Modifier", | ||
waterSpeedMod: "Water Speed Modifier", | ||
smokeSpeedMod: "Smoke Speed Modifier", | ||
airdropCallerLimit: "Radio Use Limit", | ||
regenRate: "Regen Rate", | ||
speedBoostDuration: "Speed Boost Duration", | ||
healthLoss: "Health Loss", | ||
adrenLoss: "Adrenaline Loss", | ||
healBonus: "Heal Bonus", | ||
adrenalineBonus: "Adrenaline Bonus", | ||
adrenDecay: "Adrenaline Decay Modifier", | ||
adrenSet: "Adrenaline Value", | ||
killsLimit: "Kills Limit", | ||
dropCount: "Drop Count", | ||
healDmgRate: "Heal Damage Rate", | ||
lowerHpLimit: "Minimum Health" | ||
}); | ||
|
||
return ( | ||
<GenericSidebar | ||
title={item.name} | ||
image={getSuroiImageLink(item)} | ||
> | ||
<InfoboxHeader>Basic Info</InfoboxHeader> | ||
<InfoboxRow> | ||
<InfoboxColumn title="Category">{category}</InfoboxColumn> | ||
<InfoboxColumn title="Type">{type}</InfoboxColumn> | ||
</InfoboxRow> | ||
<InfoboxRow> | ||
<InfoboxColumn title="Droppable?">{item.noDrop ? "No" : "Yes"}</InfoboxColumn> | ||
<InfoboxColumn title="Swappable?">{item.noSwap ? "No" : "Yes"}</InfoboxColumn> | ||
</InfoboxRow> | ||
|
||
{modifiers.some(([prop]) => prop in item) && ( | ||
<> | ||
<InfoboxHeader>Stats & Modifiers</InfoboxHeader> | ||
<InfoboxRow> | ||
{modifiers.map(([prop, name]) => prop in item && <InfoboxColumn title={name}>{Math.round(item[prop as keyof PerkDefinition] as number * 100) / 100}{prop === "updateInterval" || prop === "speedBoostDuration" ? "ms" : ""}</InfoboxColumn>)} | ||
</InfoboxRow> | ||
</> | ||
)} | ||
|
||
<InfoboxHeader>Advanced Stats</InfoboxHeader> | ||
<InfoboxRow> | ||
<InfoboxColumn title="Internal ID"> | ||
<span className="font-mono">{item.idString}</span> | ||
</InfoboxColumn> | ||
</InfoboxRow> | ||
</GenericSidebar> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters