Skip to content

Commit 9293c61

Browse files
committed
Add 5.0 gacha calc
1 parent 59cbd9e commit 9293c61

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

pages/tools/gachacalc.tsx

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function pityRate(baseRate: number, pityStart: number, increaseRate?: number): (
2525

2626
const gachas: Record<string, Banner> = {
2727
char: {
28-
bannerName: "5* banner character [Genshin Impact/Honkai: Star Rail]",
29-
banner: 0.5,
28+
bannerName: "5* banner character [Genshin Impact (5.0+)]",
29+
banner: 0.55,
3030
guaranteed: 1,
3131
minConst: -1,
3232
maxConst: 6,
@@ -35,6 +35,18 @@ const gachas: Record<string, Banner> = {
3535
maxPity: 90,
3636
rate: pityRate(0.6, Math.ceil(44 / 0.6))
3737
},
38+
weapon: {
39+
bannerName: "Specific 5* banner weapon [Genshin Impact (5.0+)]",
40+
banner: 0.75,
41+
guaranteed: 1 / 2,
42+
guaranteedPity: 2,
43+
minConst: 0,
44+
maxConst: 5,
45+
constFormat: "R",
46+
constName: "Refinement",
47+
maxPity: 80,
48+
rate: pityRate(0.7, Math.ceil(44 / 0.7))
49+
},
3850
"4*char": {
3951
bannerName: "Specific 4* banner character [Genshin Impact/Honkai: Star Rail]",
4052
banner: 0.5,
@@ -46,28 +58,39 @@ const gachas: Record<string, Banner> = {
4658
maxPity: 10,
4759
rate: pityRate(5.1, Math.ceil(44 / 5.1))
4860
},
49-
weapon: {
50-
bannerName: "Specific 5* banner weapon [Genshin Impact]",
61+
"4*weapon": {
62+
bannerName: "Specific 4* banner weapon [Genshin Impact]",
5163
banner: 0.75,
52-
guaranteed: 1 / 2,
53-
guaranteedPity: 3,
64+
guaranteed: 1 / 5,
5465
minConst: 0,
5566
maxConst: 5,
5667
constFormat: "R",
5768
constName: "Refinement",
58-
maxPity: 80,
59-
rate: pityRate(0.7, Math.ceil(44 / 0.7))
69+
maxPity: 10,
70+
rate: pityRate(6.0, Math.ceil(44 / 6.0))
6071
},
61-
"4*weapon": {
62-
bannerName: "Specific 4* banner weapon [Genshin Impact]",
72+
charOld: {
73+
bannerName: "5* banner character [Genshin Impact (PRE 5.0)/Honkai: Star Rail]",
74+
banner: 0.5,
75+
guaranteed: 1,
76+
minConst: -1,
77+
maxConst: 6,
78+
constFormat: "C",
79+
constName: "Constellation",
80+
maxPity: 90,
81+
rate: pityRate(0.6, Math.ceil(44 / 0.6))
82+
},
83+
weaponOld: {
84+
bannerName: "Specific 5* banner weapon [Genshin Impact (PRE 5.0)]",
6385
banner: 0.75,
64-
guaranteed: 1 / 5,
86+
guaranteed: 1 / 2,
87+
guaranteedPity: 3,
6588
minConst: 0,
6689
maxConst: 5,
6790
constFormat: "R",
6891
constName: "Refinement",
69-
maxPity: 10,
70-
rate: pityRate(6.0, Math.ceil(44 / 6.0))
92+
maxPity: 80,
93+
rate: pityRate(0.7, Math.ceil(44 / 0.7))
7194
},
7295
weaponHSR: {
7396
bannerName: "5* banner weapon [Honkai: Star Rail]",
@@ -125,9 +148,9 @@ export default function GachaCalc({ location }: { location: string }) {
125148
const [guaranteed, setGuaranteed] = useState(false)
126149
const [guaranteedPity, setGuaranteedPity] = useState(0)
127150

128-
const [gachaName, setGacha] = useState(Object.values(gachas).map(g => g.bannerName)[0])
151+
const [gachaName, setGacha] = useState(Object.values(gachas).map(g => g.bannerName)[1])
129152

130-
const banner = Object.values(gachas).find(x => x.bannerName == gachaName) ?? Object.values(gachas)[0]
153+
const banner = Object.values(gachas).find(x => x.bannerName == gachaName) ?? Object.values(gachas)[1]
131154

132155
const calculated = useMemo(
133156
() => calcSimsRegular(current, pity, pulls, guaranteed, guaranteedPity, banner),
@@ -312,6 +335,7 @@ export default function GachaCalc({ location }: { location: string }) {
312335
<p>The calculator uses the statistical model for drop-rates of Cgg/<FormattedLink href="https://genshin-wishes.com/" target="_blank">genshin-wishes.com</FormattedLink>.
313336
For more information about drop rates, please refer to <FormattedLink href="https://www.hoyolab.com/article/497840" target="_blank"> their HoYoLAB post</FormattedLink>.</p>
314337
<p>Rates indicate the chance to get exactly {banner.constFormat}x within Y pulls, cumulative rate chance to get {banner.constFormat}x or higher within Y pulls. Big graph indicates cumulative rate at each pull (read: Z% to get {banner.constFormat}x <i>within</i> Y pulls).</p>
338+
<p>Exact details of &apos;Capturing Radiance&apos; are not yet known. The calculator assumes the consolidated rate of 55% mentioned in the <a href="https://www.hoyolab.com/article/32168979">HoYoLAB article</a>.</p>
315339
<p><i><b>NOTE</b>: To reduce the amount of calculations, the 4-star character banner calculator will assume there are no 5-stars being dropped.
316340
These can prevent a 4 star from dropping, but they still increase the pity counter. It is possible (in-game) to not get a 4-star within 10 pity,
317341
but the next pull is guaranteed to be a 4-star if it&apos;s not a 5-star.</i></p>

0 commit comments

Comments
 (0)