Skip to content

Commit 7e29b97

Browse files
committed
feat: 2.0.32
1 parent b98d7d6 commit 7e29b97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+7893
-5377
lines changed

__test__/process.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import '../polyfills';
2+
import 'core-js/modules/web.structured-clone';
3+
import { parseData } from '@parsers/index';
4+
import first from './fixtures/first.json';
5+
import second from './fixtures/first.json';
6+
import third from './fixtures/first.json';
7+
import fourth from './fixtures/first.json';
8+
9+
describe('Check different configuration processing', () => {
10+
it('Checks first json', () => {
11+
const { data, charNames, companion, guildData, serverVars } = first;
12+
const result = parseData(data, charNames, companion, guildData, serverVars);
13+
expect(result).toBeDefined();
14+
})
15+
it('Checks second json', () => {
16+
const { data, charNames, companion, guildData, serverVars } = second;
17+
const result = parseData(data, charNames, companion, guildData, serverVars);
18+
expect(result).toBeDefined();
19+
})
20+
it('Checks third json', () => {
21+
const { data, charNames, companion, guildData, serverVars } = third;
22+
const result = parseData(data, charNames, companion, guildData, serverVars);
23+
expect(result).toBeDefined();
24+
})
25+
it('Checks fourth json', () => {
26+
const { data, charNames, companion, guildData, serverVars } = fourth;
27+
const result = parseData(data, charNames, companion, guildData, serverVars);
28+
expect(result).toBeDefined();
29+
})
30+
})

components/account/Worlds/World5/Hole/Bonuses.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ const Bonuses = ({ hole }) => {
3232
{majik.map(({ description, bonus, level, hasDoot, godsLinks, maxLevel }, bonusIndex) => {
3333
let desc = description.replace('}', Math.round(100 * (1 + bonus / 100)) / 100)
3434
.replace('{', bonus)
35-
.replace('|', Math.round(bonus * hole?.cosmoSchematics));
35+
.replace('|', Math.round(bonus * hole?.cosmoSchematics))
36+
.replace('\$', Math.round(Math.floor((hole?.leastOpalInvestedVillager ?? 0) / 5) * bonus));
3637
if (hasDoot){
3738
desc = desc.replace('@_Y', '').replace('@_Z', '');
3839
}

components/account/Worlds/World5/Hole/Caverns/Gambit.jsx

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,53 @@
1-
import { Typography } from '@mui/material';
21
import React from 'react';
2+
import { CardTitleAndValue } from '@components/common/styles';
3+
import { cleanUnderscore, commaNotation, msToDate, notateNumber, numberWithCommas } from '@utility/helpers';
4+
import { Card, CardContent, Divider, Stack, Typography } from '@mui/material';
5+
import Tooltip from '@components/Tooltip';
6+
import InfoIcon from '@mui/icons-material/Info';
7+
8+
const Gambit = ({ hole }) => {
9+
const nextUnlock = hole?.caverns?.gambit?.nextUnlock;
310

4-
const Gambit = () => {
511
return <>
6-
<Typography textAlign={'center'} variant={'h4'}>No content for gambit yet</Typography>
12+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
13+
{hole?.caverns?.gambit?.times?.map((time, index) => <CardTitleAndValue
14+
title={''} key={`rupie-${index}`} stackProps icon={`etc/Gambit_${index}.png`}
15+
imgStyle={{ width: 24, height: 24, objectFit:'contain' }}
16+
value={msToDate(time * 1000)}/>)}
17+
</Stack>
18+
<Divider />
19+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
20+
<CardTitleAndValue title={'Base points'} value={numberWithCommas(Math.floor(hole?.caverns?.gambit?.basePoints))}/>
21+
<CardTitleAndValue title={'Points'} value={numberWithCommas(Math.floor(hole?.caverns?.gambit?.points))}/>
22+
<CardTitleAndValue title={'PointsMulti'}
23+
value={`${notateNumber(hole?.caverns?.gambit?.pointsMulti, 'MultiplierInfo')}x`}/>
24+
{nextUnlock ? <CardTitleAndValue title={'Next upgrade'} value={<Tooltip title={<Stack gap={1}>
25+
<Typography sx={{ fontWeight: 'bold' }}>{cleanUnderscore(nextUnlock?.name)}</Typography>
26+
<Typography>{cleanUnderscore(nextUnlock?.description)}</Typography>
27+
</Stack>}>
28+
<Stack direction={'row'} gap={1}>
29+
{commaNotation(nextUnlock?.pointsReq)}
30+
<InfoIcon/>
31+
</Stack>
32+
</Tooltip>}/> : null}
33+
<CardTitleAndValue title={'Summoning Doublers'}
34+
value={`${hole?.caverns?.gambit?.summoningDoublers?.appointed}/${hole?.caverns?.gambit?.summoningDoublers?.total}`}/>
35+
</Stack>
36+
<Divider sx={{ mb: 2 }}/>
37+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
38+
{hole?.caverns?.gambit?.bonuses?.map(({ name, description, pointsReq }, index) => <Card
39+
key={`collectible-${index}`}>
40+
<CardContent sx={{
41+
width: 350,
42+
minHeight: 215,
43+
opacity: hole?.caverns?.gambit?.points > pointsReq ? 1 : .5
44+
}}>
45+
<Typography variant={'body1'}>{cleanUnderscore(name)}</Typography>
46+
<Typography variant={'body1'} mt={2}>{cleanUnderscore(description)}</Typography>
47+
<Typography variant={'body1'} mt={2}>Req: {commaNotation(pointsReq)}</Typography>
48+
</CardContent>
49+
</Card>)}
50+
</Stack>
751
</>
852
};
953

components/account/Worlds/World5/Hole/Caverns/TheBell.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ const TheBell = ({ hole }) => {
6969
alt={'particles-cost-' + index}/>
7070
<Typography>{notateNumber(owned, 'Big')} / {notateNumber(cost, 'Big')}</Typography>
7171
</Stack> : null}
72+
{costType === 'rupie' ? <Stack direction={'row'} alignItems={'center'} gap={2}>
73+
<img src={`${prefix}data/HoleJarR5.png`}
74+
alt={'rupie-cost-' + index}/>
75+
<Typography>{notateNumber(owned, 'Big')} / {notateNumber(cost, 'Big')}</Typography>
76+
</Stack> : null}
7277
{costType === 'unknown' ? <Stack direction={'row'} alignItems={'center'} gap={2}>
7378
<img src={`${prefix}afk_targets/Nothing.png`}
7479
alt={'unknown-cost-' + index}/>

components/account/Worlds/World5/Hole/Caverns/TheJars.jsx

Lines changed: 54 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { Card, CardContent, Divider, Stack, Typography } from '@mui/material';
2-
import { cleanUnderscore, msToDate, notateNumber, numberWithCommas, prefix } from '@utility/helpers';
2+
import { cleanUnderscore, getTabs, msToDate, notateNumber, numberWithCommas, prefix } from '@utility/helpers';
33
import { CardTitleAndValue } from '@components/common/styles';
44
import { IconInfoCircleFilled } from '@tabler/icons-react';
55
import Tooltip from '@components/Tooltip';
6+
import Tabber from '@components/common/Tabber';
7+
import { PAGES } from '@components/constants';
68

79
const TheJars = ({ hole }) => {
810
return <>
911
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
1012
{hole?.caverns?.theJars?.rupies?.map((amount, index) => <CardTitleAndValue
1113
title={''} key={`rupie-${index}`} stackProps icon={`data/HoleJarR${index}.png`}
12-
value={amount}/>)}
14+
value={numberWithCommas(Math.floor(amount))}/>)}
1315
</Stack>
1416
<Divider sx={{ mt: 1 }}/>
1517
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
@@ -27,41 +29,64 @@ const TheJars = ({ hole }) => {
2729
value={`${numberWithCommas(Math.floor(progress))} / ${numberWithCommas(Math.floor(req))}`}/>)}
2830
</Stack>
2931
<Divider sx={{ mb: 2 }}/>
30-
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
31-
{hole?.caverns?.theJars?.jars?.map(({ name, unlocked, req, effect, perHour }, index) => {
32-
return <Card key={`jar-${index}`}>
32+
<Tabber tabs={getTabs(PAGES.ACCOUNT['world 5'].categories, 'hole', 'Explore', 'The Jars')} queryKey={'dnt'}>
33+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
34+
{hole?.caverns?.theJars?.jars?.map(({ name, unlocked, req, effect }, index) => {
35+
return <Card key={`jar-${index}`}>
36+
<CardContent sx={{
37+
width: 350,
38+
minHeight: 215,
39+
opacity: unlocked ? 1 : .5
40+
}}>
41+
<Stack direction={'row'} alignItems={'center'} gap={1}>
42+
<img style={{ width: 26, height: 26, objectFit: 'contain' }} src={`${prefix}etc/Jar_${index}.png`}
43+
alt={`jar-${index}`}/>
44+
<Typography variant={'body1'}>{cleanUnderscore(name)}</Typography>
45+
</Stack>
46+
<Typography sx={{ height: 41, display: 'flex', alignItems: 'center' }}
47+
variant={'body1'}>{effect}</Typography>
48+
<Divider sx={{ mt: .5, mb: 1 }}/>
49+
<Stack direction={'row'} alignItems={'center'} gap={1}>
50+
<Typography variant={'body1'}>Jars per
51+
hour: {Math.floor(hole?.caverns?.theJars?.perHour / req)}</Typography>
52+
<Tooltip title={<Stack>
53+
<Typography variant={'body2'}>2
54+
slots: {Math.floor((hole?.caverns?.theJars?.perHour * 2) / req)} / hr</Typography>
55+
<Typography variant={'body2'}>3
56+
slots: {Math.floor((hole?.caverns?.theJars?.perHour * 3) / req)} / hr</Typography>
57+
</Stack>}>
58+
<IconInfoCircleFilled size={18}/>
59+
</Tooltip>
60+
</Stack>
61+
<Typography variant={'body1'}>Time to
62+
full: {msToDate(req / hole?.caverns?.theJars?.perHour * 1000 * 3600)}</Typography>
63+
<Typography variant={'body1'}>Req: {numberWithCommas(Math.floor(req))}</Typography>
64+
</CardContent>
65+
</Card>
66+
})}
67+
</Stack>
68+
<Stack mt={2} direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
69+
{hole?.caverns?.theJars?.collectibles?.map(({ name, level, description, doubled }, index) => <Card
70+
key={`collectible-${index}`}>
3371
<CardContent sx={{
3472
width: 350,
35-
minHeight: 215,
36-
opacity: unlocked ? 1 : .5
73+
opacity: level > 0 ? 1 : .5
3774
}}>
3875
<Stack direction={'row'} alignItems={'center'} gap={1}>
39-
<img style={{ width: 26, height: 26, objectFit: 'contain' }} src={`${prefix}etc/Jar_${index}.png`}
76+
<img style={{ width: 26, height: 26, objectFit: 'contain' }} src={`${prefix}data/HoleJarC${index}.png`}
4077
alt={`jar-${index}`}/>
41-
<Typography variant={'body1'}>{cleanUnderscore(name)}</Typography>
78+
<Stack sx={{ width: '100%' }} direction={'row'} alignItems={'center'} justifyContent={'space-between'}>
79+
<Typography color={doubled ? '#c471d2' : 'inherit'}
80+
variant={'body1'}>{cleanUnderscore(name)}</Typography>
81+
<Typography variant={'body1'}>(Lv. {level})</Typography>
82+
</Stack>
4283
</Stack>
4384
<Typography sx={{ height: 41, display: 'flex', alignItems: 'center' }}
44-
variant={'body1'}>{effect}</Typography>
45-
<Divider sx={{ mt: .5, mb: 1 }}/>
46-
<Stack direction={'row'} alignItems={'center'} gap={1}>
47-
<Typography variant={'body1'}>Jars per
48-
hour: {Math.floor(hole?.caverns?.theJars?.perHour / req)}</Typography>
49-
<Tooltip title={<Stack>
50-
<Typography variant={'body2'}>2
51-
slots: {Math.floor((hole?.caverns?.theJars?.perHour * 2) / req)} / hr</Typography>
52-
<Typography variant={'body2'}>3
53-
slots: {Math.floor((hole?.caverns?.theJars?.perHour * 3) / req)} / hr</Typography>
54-
</Stack>}>
55-
<IconInfoCircleFilled size={18}/>
56-
</Tooltip>
57-
</Stack>
58-
<Typography variant={'body1'}>Time to
59-
full: {msToDate(req / hole?.caverns?.theJars?.perHour * 1000 * 3600)}</Typography>
60-
<Typography variant={'body1'}>Req: {numberWithCommas(Math.floor(req))}</Typography>
85+
variant={'body1'}>{cleanUnderscore(description)}</Typography>
6186
</CardContent>
62-
</Card>
63-
})}
64-
</Stack>
87+
</Card>)}
88+
</Stack>
89+
</Tabber>
6590
</>
6691
};
6792

components/account/Worlds/World5/Hole/Explore.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const Explore = ({ hole }) => {
4040
<Divider sx={{ mb: 3 }}/>
4141
<Tabber
4242
queryKey={'nt'}
43+
clearOnChange={['dnt']}
4344
iconsOnly
4445
forceScroll={breakpoint}
4546
tabs={getTabs(PAGES.ACCOUNT['world 5'].categories, 'hole', 'Explore')}

0 commit comments

Comments
 (0)