ps99-api 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/runConfigurations/test.xml +11 -0
- package/.idea/runConfigurations/test_changing.xml +11 -0
- package/.idea/runConfigurations/test_snapshot.xml +11 -0
- package/.idea/runConfigurations/test_snapshot_changing.xml +12 -0
- package/.idea/webResources.xml +14 -0
- package/.releaserc +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ps99-api.d.ts +3 -3
- package/dist/ps99-api.js +2 -2
- package/dist/ps99-api.js.map +1 -1
- package/dist/responses/collection/achievement.d.ts +2 -9
- package/dist/responses/collection/boost.d.ts +2 -9
- package/dist/responses/collection/booth.d.ts +15 -22
- package/dist/responses/collection/box.d.ts +14 -21
- package/dist/responses/collection/buff.d.ts +2 -9
- package/dist/responses/collection/charm.d.ts +13 -20
- package/dist/responses/collection/collection-data.d.ts +9 -0
- package/dist/responses/collection/collection-data.js +3 -0
- package/dist/responses/collection/collection-data.js.map +1 -0
- package/dist/responses/collection/currency.d.ts +22 -29
- package/dist/responses/collection/egg.d.ts +25 -31
- package/dist/responses/collection/enchantment.d.ts +18 -25
- package/dist/responses/collection/fishing-rod.d.ts +9 -16
- package/dist/responses/collection/fruit.d.ts +15 -22
- package/dist/responses/collection/guild-battle.d.ts +6 -13
- package/dist/responses/collection/hoverboard.d.ts +27 -34
- package/dist/responses/collection/index.d.ts +7 -5
- package/dist/responses/collection/lootbox.d.ts +12 -19
- package/dist/responses/collection/mastery.d.ts +5 -12
- package/dist/responses/collection/merchant.d.ts +6 -13
- package/dist/responses/collection/misc-item.d.ts +10 -17
- package/dist/responses/collection/pet.d.ts +20 -27
- package/dist/responses/collection/potion.d.ts +17 -24
- package/dist/responses/collection/random-event.d.ts +9 -16
- package/dist/responses/collection/rank.d.ts +7 -22
- package/dist/responses/collection/rarity.d.ts +6 -13
- package/dist/responses/collection/rebirth.d.ts +4 -11
- package/dist/responses/collection/secret-room.d.ts +4 -41
- package/dist/responses/collection/seed.d.ts +47 -1
- package/dist/responses/collection/shovel.d.ts +4 -11
- package/dist/responses/collection/sprinkler.d.ts +14 -21
- package/dist/responses/collection/ultimate.d.ts +17 -23
- package/dist/responses/collection/upgrade.d.ts +26 -33
- package/dist/responses/collection/watering-can.d.ts +5 -12
- package/dist/responses/collection/world.d.ts +6 -13
- package/dist/responses/collection/zone-flag.d.ts +14 -21
- package/dist/responses/collection/zone.d.ts +25 -102
- package/dump-result.js +16 -3
- package/example-web/react2/package-lock.json +45 -8
- package/example-web/react2/package.json +4 -3
- package/example-web/react2/public/_redirects +1 -0
- package/example-web/react2/public/index.html +1 -1
- package/example-web/react2/public/service-worker.js +2 -1
- package/example-web/react2/src/App.tsx +26 -141
- package/example-web/react2/src/components/AchievementsComponent.tsx +34 -30
- package/example-web/react2/src/components/BoostsComponent.tsx +17 -31
- package/example-web/react2/src/components/BoothsComponent.tsx +25 -31
- package/example-web/react2/src/components/BoxesComponent.tsx +28 -31
- package/example-web/react2/src/components/BuffsComponent.tsx +19 -31
- package/example-web/react2/src/components/CharmsComponent.tsx +33 -38
- package/example-web/react2/src/components/CollectionConfigIndex.tsx +53 -0
- package/example-web/react2/src/components/CollectionsIndex.tsx +33 -0
- package/example-web/react2/src/components/CurrencyComponent.tsx +58 -31
- package/example-web/react2/src/components/DynamicCollectionConfigData.tsx +94 -0
- package/example-web/react2/src/components/EggsComponent.tsx +55 -32
- package/example-web/react2/src/components/EnchantsComponent.tsx +37 -40
- package/example-web/react2/src/components/FishingRodsComponent.tsx +35 -31
- package/example-web/react2/src/components/FruitsComponent.tsx +29 -37
- package/example-web/react2/src/components/GenericFetchComponent.tsx +53 -0
- package/example-web/react2/src/components/GuildBattlesComponent.tsx +70 -40
- package/example-web/react2/src/components/Header.tsx +27 -0
- package/example-web/react2/src/components/HomePage.tsx +14 -0
- package/example-web/react2/src/components/HoverboardsComponent.tsx +40 -31
- package/example-web/react2/src/components/ImageComponent.tsx +37 -19
- package/example-web/react2/src/components/LootboxesComponent.tsx +19 -31
- package/example-web/react2/src/components/MasteryComponent.tsx +48 -30
- package/example-web/react2/src/components/MerchantsComponent.tsx +39 -28
- package/example-web/react2/src/components/MiscItemsComponent.tsx +28 -46
- package/example-web/react2/src/components/PetsComponent.tsx +53 -34
- package/example-web/react2/src/components/PotionsComponent.tsx +42 -37
- package/example-web/react2/src/components/RandomEventsComponent.tsx +39 -32
- package/example-web/react2/src/components/RanksComponent.tsx +80 -29
- package/example-web/react2/src/components/RarityComponent.tsx +18 -27
- package/example-web/react2/src/components/RebirthsComponent.tsx +32 -29
- package/example-web/react2/src/components/SecretRoomsComponent.tsx +18 -28
- package/example-web/react2/src/components/SeedsComponent.tsx +66 -31
- package/example-web/react2/src/components/ShovelsComponent.tsx +22 -32
- package/example-web/react2/src/components/SprinklersComponent.tsx +23 -32
- package/example-web/react2/src/components/UltimatesComponent.tsx +29 -33
- package/example-web/react2/src/components/UpgradesComponent.tsx +68 -43
- package/example-web/react2/src/components/WateringCansComponent.tsx +25 -34
- package/example-web/react2/src/components/WorldsComponent.tsx +31 -29
- package/example-web/react2/src/components/ZoneFlagsComponent.tsx +27 -32
- package/example-web/react2/src/components/ZonesComponent.tsx +84 -29
- package/example-web/react2/src/index.tsx +4 -2
- package/example-web/react2/tsconfig.json +1 -1
- package/example-web/react2/webpack.config.js +2 -6
- package/package.json +5 -3
- package/src/__tests__/__snapshots__/ps99-api-changes.ts.snap +9852 -7851
- package/src/__tests__/__snapshots__/ps99-api-live.ts.snap +1313 -86
- package/src/__tests__/ps99-api-changes.ts +1 -1
- package/src/index.ts +1 -0
- package/src/ps99-api.ts +5 -5
- package/src/responses/collection/achievement.ts +12 -9
- package/src/responses/collection/boost.ts +9 -9
- package/src/responses/collection/booth.ts +17 -22
- package/src/responses/collection/box.ts +16 -21
- package/src/responses/collection/buff.ts +4 -9
- package/src/responses/collection/charm.ts +14 -20
- package/src/responses/collection/collection-data.ts +14 -0
- package/src/responses/collection/currency.ts +27 -29
- package/src/responses/collection/egg.ts +26 -31
- package/src/responses/collection/enchantment.ts +19 -25
- package/src/responses/collection/fishing-rod.ts +13 -16
- package/src/responses/collection/fruit.ts +16 -22
- package/src/responses/collection/guild-battle.ts +10 -13
- package/src/responses/collection/hoverboard.ts +31 -34
- package/src/responses/collection/index.ts +10 -6
- package/src/responses/collection/lootbox.ts +13 -19
- package/src/responses/collection/mastery.ts +6 -12
- package/src/responses/collection/merchant.ts +7 -13
- package/src/responses/collection/misc-item.ts +11 -17
- package/src/responses/collection/pet.ts +21 -27
- package/src/responses/collection/potion.ts +18 -24
- package/src/responses/collection/random-event.ts +13 -16
- package/src/responses/collection/rank.ts +8 -24
- package/src/responses/collection/rarity.ts +7 -13
- package/src/responses/collection/rebirth.ts +5 -11
- package/src/responses/collection/secret-room.ts +8 -44
- package/src/responses/collection/seed.ts +55 -0
- package/src/responses/collection/shovel.ts +5 -11
- package/src/responses/collection/sprinkler.ts +15 -21
- package/src/responses/collection/ultimate.ts +18 -23
- package/src/responses/collection/upgrade.ts +27 -33
- package/src/responses/collection/watering-can.ts +9 -12
- package/src/responses/collection/world.ts +7 -13
- package/src/responses/collection/zone-flag.ts +15 -21
- package/src/responses/collection/zone.ts +26 -119
- package/.release.rc +0 -8
|
@@ -1,42 +1,61 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const PetsComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchPets = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("Pets");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setPets(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchPets();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const PetsComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Pets">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Pets">>
|
|
11
|
+
collectionName="Pets"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>{data.name}</h2>
|
|
16
|
+
<ImageComponent src={data.thumbnail} alt={data.name} />
|
|
17
|
+
{data.goldenThumbnail && (
|
|
25
18
|
<ImageComponent
|
|
26
|
-
src={
|
|
27
|
-
alt={
|
|
19
|
+
src={data.goldenThumbnail}
|
|
20
|
+
alt={`${data.name} (Golden)`}
|
|
28
21
|
/>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
)}
|
|
23
|
+
<p>From World Number: {data.fromWorldNumber}</p>
|
|
24
|
+
<p>From Zone Number: {data.fromZoneNumber}</p>
|
|
25
|
+
{data.indexObtainable && <p>Index Obtainable: Yes</p>}
|
|
26
|
+
{data.huge && <p>Huge: Yes</p>}
|
|
27
|
+
{data.fly && <p>Can Fly: Yes</p>}
|
|
28
|
+
{data.tradable && <p>Tradable: Yes</p>}
|
|
29
|
+
{data.secret && <p>Secret: Yes</p>}
|
|
30
|
+
{data.hidden && <p>Hidden: Yes</p>}
|
|
31
|
+
{data.cachedPower && (
|
|
32
|
+
<div>
|
|
33
|
+
<h3>Cached Power:</h3>
|
|
34
|
+
<ul>
|
|
35
|
+
{data.cachedPower.map((power, index) => (
|
|
36
|
+
<li key={index}>{power}</li>
|
|
37
|
+
))}
|
|
38
|
+
</ul>
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
41
|
+
{data.animations && (
|
|
42
|
+
<div>
|
|
43
|
+
<h3>Animations:</h3>
|
|
44
|
+
<ul>
|
|
45
|
+
{Object.entries(data.animations).map(([key, value], index) => (
|
|
46
|
+
<li key={index}>
|
|
47
|
+
{key}: {JSON.stringify(value)}
|
|
48
|
+
</li>
|
|
49
|
+
))}
|
|
50
|
+
</ul>
|
|
51
|
+
</div>
|
|
52
|
+
)}
|
|
53
|
+
{data.indexDesc && <p>Description: {data.indexDesc}</p>}
|
|
54
|
+
{data.exclusiveLevel && <p>Exclusive Level: {data.exclusiveLevel}</p>}
|
|
55
|
+
{data.power && <p>Power: {data.power}</p>}
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
/>
|
|
40
59
|
);
|
|
41
60
|
};
|
|
42
61
|
|
|
@@ -1,43 +1,48 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const PotionsComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchPotions = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("Potions");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setPotions(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchPotions();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const PotionsComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Potions">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Potions">>
|
|
11
|
+
collectionName="Potions"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>Potion: {data.Tiers[0].DisplayName}</h2>
|
|
16
|
+
<div>
|
|
17
|
+
<ImageComponent
|
|
18
|
+
src={data.Tiers[0].Icon}
|
|
19
|
+
alt={data.Tiers[0].DisplayName}
|
|
20
|
+
/>
|
|
21
|
+
<p>Description: {data.Tiers[0].Desc}</p>
|
|
22
|
+
<p>Primary Color: {data.PrimaryColor}</p>
|
|
23
|
+
<p>Secondary Color: {data.SecondaryColor}</p>
|
|
24
|
+
<p>Base Tier: {data.BaseTier}</p>
|
|
25
|
+
<p>Max Tier: {data.MaxTier}</p>
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<h3>Tiers:</h3>
|
|
29
|
+
<ul>
|
|
30
|
+
{data.Tiers.map((tier, index) => (
|
|
31
|
+
<li key={index}>
|
|
32
|
+
<p>Tier {index + 1}:</p>
|
|
33
|
+
<p>Display Name: {tier.DisplayName}</p>
|
|
34
|
+
<p>Description: {tier.Desc}</p>
|
|
35
|
+
<ImageComponent src={tier.Icon} alt={tier.DisplayName} />
|
|
36
|
+
<p>Power: {tier.Power}</p>
|
|
37
|
+
<p>Time: {tier.Time}</p>
|
|
38
|
+
<p>Rarity: {tier.Rarity.DisplayName}</p>
|
|
39
|
+
</li>
|
|
40
|
+
))}
|
|
41
|
+
</ul>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
/>
|
|
41
46
|
);
|
|
42
47
|
};
|
|
43
48
|
|
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const RandomEventsComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchRandomEvents = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("RandomEvents");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setRandomEvents(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchRandomEvents();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const RandomEventsComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"RandomEvents">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"RandomEvents">>
|
|
11
|
+
collectionName="RandomEvents"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>Random Event: {data.Name}</h2>
|
|
16
|
+
<div>
|
|
17
|
+
<ImageComponent src={data.Icon} alt={data.Name} />
|
|
18
|
+
<p>Color: {data.Color}</p>
|
|
19
|
+
<p>Duration: {data.Duration} seconds</p>
|
|
20
|
+
<p>Breaking Requirement: {data.BreakingRequirement}</p>
|
|
21
|
+
<p>Playtime Requirement: {data.PlaytimeRequirement} minutes</p>
|
|
22
|
+
<p>Chance: {data.Chance}</p>
|
|
23
|
+
<p>Allow in Zones: {data.AllowInZones ? "Yes" : "No"}</p>
|
|
24
|
+
<p>Allow in Instances: {data.AllowInInstances ? "Yes" : "No"}</p>
|
|
25
|
+
<p>Allow Multiple: {data.AllowMultiple ? "Yes" : "No"}</p>
|
|
26
|
+
{data.MinimumZone && <p>Minimum Zone: {data.MinimumZone}</p>}
|
|
27
|
+
</div>
|
|
28
|
+
<div>
|
|
29
|
+
<h3>Area Whitelist:</h3>
|
|
30
|
+
<ul>
|
|
31
|
+
{Object.entries(data.AreaWhitelist).map(
|
|
32
|
+
([area, allowed], index) => (
|
|
33
|
+
<li key={index}>
|
|
34
|
+
{area.replace("_", " ")}: {allowed ? "Yes" : "No"}
|
|
35
|
+
</li>
|
|
36
|
+
),
|
|
37
|
+
)}
|
|
38
|
+
</ul>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
)}
|
|
42
|
+
/>
|
|
36
43
|
);
|
|
37
44
|
};
|
|
38
45
|
|
|
@@ -1,35 +1,86 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
|
|
4
|
-
const RanksComponent: React.FC
|
|
5
|
-
|
|
5
|
+
const RanksComponent: React.FC<{
|
|
6
|
+
configData?: CollectionConfigData<"Ranks">;
|
|
7
|
+
}> = ({ configData }) => {
|
|
8
|
+
return (
|
|
9
|
+
<GenericFetchComponent<CollectionConfigData<"Ranks">>
|
|
10
|
+
collectionName="Ranks"
|
|
11
|
+
configData={configData}
|
|
12
|
+
render={(data) => (
|
|
13
|
+
<div>
|
|
14
|
+
<h2>Rank: {data.Title}</h2>
|
|
15
|
+
<p>Rank Number: {data.RankNumber}</p>
|
|
16
|
+
<p>Max Enchants Equipped: {data.MaxEnchantsEquipped}</p>
|
|
17
|
+
<p>Maximum Active Goals: {data.MaximumActiveGoals}</p>
|
|
18
|
+
<p>Unlockable Egg Slots: {data.UnlockableEggSlots}</p>
|
|
19
|
+
<p>Unlockable Pet Slots: {data.UnlockablePetSlots}</p>
|
|
20
|
+
{data.RequiredRebirth && (
|
|
21
|
+
<p>Required Rebirth: {data.RequiredRebirth}</p>
|
|
22
|
+
)}
|
|
23
|
+
{data.RequiredZone && <p>Required Zone: {data.RequiredZone}</p>}
|
|
6
24
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
<div>
|
|
26
|
+
<h3>Goals:</h3>
|
|
27
|
+
{data.Goals.map((goalSet, index) => (
|
|
28
|
+
<div key={index}>
|
|
29
|
+
<h4>Goal Set {index + 1}</h4>
|
|
30
|
+
<ul>
|
|
31
|
+
{goalSet.map((goal, goalIndex) => (
|
|
32
|
+
<li key={goalIndex}>
|
|
33
|
+
<p>Type: {goal.Type}</p>
|
|
34
|
+
<p>Amount: {goal.Amount}</p>
|
|
35
|
+
<p>Weight: {goal.Weight}</p>
|
|
36
|
+
{goal.CurrencyID && <p>Currency ID: {goal.CurrencyID}</p>}
|
|
37
|
+
{goal.BreakableType && (
|
|
38
|
+
<p>Breakable Type: {goal.BreakableType}</p>
|
|
39
|
+
)}
|
|
40
|
+
{goal.PotionTier && <p>Potion Tier: {goal.PotionTier}</p>}
|
|
41
|
+
{goal.EnchantTier && (
|
|
42
|
+
<p>Enchant Tier: {goal.EnchantTier}</p>
|
|
43
|
+
)}
|
|
44
|
+
</li>
|
|
45
|
+
))}
|
|
46
|
+
</ul>
|
|
47
|
+
</div>
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
17
50
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
<div>
|
|
52
|
+
<h3>Rewards:</h3>
|
|
53
|
+
<ul>
|
|
54
|
+
{data.Rewards.map((reward, rewardIndex) => (
|
|
55
|
+
<li key={rewardIndex}>
|
|
56
|
+
<p>Stars Required: {reward.StarsRequired}</p>
|
|
57
|
+
<p>Reward Item ID: {reward.Item._data.id}</p>
|
|
58
|
+
{reward.Item._data._am && (
|
|
59
|
+
<p>Amount: {reward.Item._data._am}</p>
|
|
60
|
+
)}
|
|
61
|
+
{reward.Item._data.tn && <p>TN: {reward.Item._data.tn}</p>}
|
|
62
|
+
</li>
|
|
63
|
+
))}
|
|
64
|
+
</ul>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{data.RankUpRewards && (
|
|
68
|
+
<div>
|
|
69
|
+
<h3>Rank Up Rewards:</h3>
|
|
70
|
+
<ul>
|
|
71
|
+
{data.RankUpRewards.map((reward, rewardIndex) => (
|
|
72
|
+
<li key={rewardIndex}>
|
|
73
|
+
<p>Reward Item ID: {reward._data.id}</p>
|
|
74
|
+
{reward._data._am && <p>Amount: {reward._data._am}</p>}
|
|
75
|
+
{reward._data.tn && <p>TN: {reward._data.tn}</p>}
|
|
76
|
+
</li>
|
|
77
|
+
))}
|
|
78
|
+
</ul>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
)}
|
|
83
|
+
/>
|
|
33
84
|
);
|
|
34
85
|
};
|
|
35
86
|
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const RarityComponent: React.FC = () => {
|
|
5
|
-
const [rarityItems, setRarityItems] = useState<RarityData[]>([]);
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const fetchRarityItems = async () => {
|
|
9
|
-
const api = new PetSimulator99API();
|
|
10
|
-
const response = await api.getCollection("Rarity");
|
|
11
|
-
if (response.status === "ok") {
|
|
12
|
-
setRarityItems(response.data);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
fetchRarityItems();
|
|
16
|
-
}, []);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
17
4
|
|
|
5
|
+
const RarityComponent: React.FC<{
|
|
6
|
+
configData?: CollectionConfigData<"Rarity">;
|
|
7
|
+
}> = ({ configData }) => {
|
|
18
8
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
<GenericFetchComponent<CollectionConfigData<"Rarity">>
|
|
10
|
+
collectionName="Rarity"
|
|
11
|
+
configData={configData}
|
|
12
|
+
render={(data) => (
|
|
13
|
+
<div>
|
|
14
|
+
<h2>Rarity: {data.DisplayName}</h2>
|
|
15
|
+
<p>Rarity Number: {data.RarityNumber}</p>
|
|
16
|
+
<p>Color: {data.Color}</p>
|
|
17
|
+
<p>Announce: {data.Announce ? "Yes" : "No"}</p>
|
|
18
|
+
</div>
|
|
19
|
+
)}
|
|
20
|
+
/>
|
|
30
21
|
);
|
|
31
22
|
};
|
|
32
23
|
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const [rebirths, setRebirths] = useState<RebirthData[]>([]);
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const fetchRebirths = async () => {
|
|
9
|
-
const api = new PetSimulator99API();
|
|
10
|
-
const response = await api.getCollection("Rebirths");
|
|
11
|
-
if (response.status === "ok") {
|
|
12
|
-
setRebirths(response.data);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
fetchRebirths();
|
|
16
|
-
}, []);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData, RebirthUnlock } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
|
+
import ImageComponent from "./ImageComponent";
|
|
17
5
|
|
|
6
|
+
const RebirthComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Rebirths">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
18
9
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Rebirths">>
|
|
11
|
+
collectionName="Rebirths"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>Rebirth: {data.DisplayName}</h2>
|
|
16
|
+
<p>Rebirth Number: {data.RebirthNumber}</p>
|
|
17
|
+
<p>Zone Number Required: {data.ZoneNumberRequired}</p>
|
|
18
|
+
<p>Strength Power Boost: {data.StrengthPowerBoost}%</p>
|
|
19
|
+
<p>Boost Description: {data.BoostDesc}</p>
|
|
20
|
+
{data.ResetZone && <p>Reset Zone: {data.ResetZone}</p>}
|
|
21
|
+
<h3>Unlocks:</h3>
|
|
22
|
+
<ul>
|
|
23
|
+
{data.RebirthUnlocks.map((unlock: RebirthUnlock, index: number) => (
|
|
24
|
+
<li key={index}>
|
|
25
|
+
<ImageComponent src={unlock.Icon} alt={unlock.Title} />
|
|
26
|
+
<strong>{unlock.GuiTitle || unlock.Title}</strong>:{" "}
|
|
27
|
+
{unlock.Desc}
|
|
28
|
+
</li>
|
|
29
|
+
))}
|
|
30
|
+
</ul>
|
|
31
|
+
</div>
|
|
32
|
+
)}
|
|
33
|
+
/>
|
|
31
34
|
);
|
|
32
35
|
};
|
|
33
36
|
|
|
34
|
-
export default
|
|
37
|
+
export default RebirthComponent;
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const SecretRoomsComponent: React.FC = () => {
|
|
5
|
-
const [secretRooms, setSecretRooms] = useState<SecretRoomData[]>([]);
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const fetchSecretRooms = async () => {
|
|
9
|
-
const api = new PetSimulator99API();
|
|
10
|
-
const response = await api.getCollection("SecretRooms");
|
|
11
|
-
if (response.status === "ok") {
|
|
12
|
-
setSecretRooms(response.data);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
fetchSecretRooms();
|
|
16
|
-
}, []);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
17
4
|
|
|
5
|
+
const SecretRoomComponent: React.FC<{
|
|
6
|
+
configData?: CollectionConfigData<"SecretRooms">;
|
|
7
|
+
}> = ({ configData }) => {
|
|
18
8
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
<GenericFetchComponent<CollectionConfigData<"SecretRooms">>
|
|
10
|
+
collectionName="SecretRooms"
|
|
11
|
+
configData={configData}
|
|
12
|
+
render={(data) => (
|
|
13
|
+
<div>
|
|
14
|
+
<h2>Secret Room: {data.DisplayName}</h2>
|
|
15
|
+
<p>Instance ID: {data.InstanceId}</p>
|
|
16
|
+
<p>Required Zone: {data.RequiredZone}</p>
|
|
17
|
+
</div>
|
|
18
|
+
)}
|
|
19
|
+
/>
|
|
30
20
|
);
|
|
31
21
|
};
|
|
32
22
|
|
|
33
|
-
export default
|
|
23
|
+
export default SecretRoomComponent;
|
|
@@ -1,39 +1,74 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
CollectionConfigData,
|
|
4
|
+
LootTableRoot,
|
|
5
|
+
LootTableEntry,
|
|
6
|
+
RawStackKey,
|
|
7
|
+
LootTableData,
|
|
8
|
+
} from "ps99-api";
|
|
9
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
10
|
import ImageComponent from "./ImageComponent";
|
|
4
11
|
|
|
5
|
-
const
|
|
6
|
-
|
|
12
|
+
const parseRawStackKey = (rawStackKey: RawStackKey): LootTableData => {
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(rawStackKey);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error("Failed to parse RawStackKey:", rawStackKey, error);
|
|
17
|
+
return {} as LootTableData;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
7
20
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
const renderLootTable = (lootTable: LootTableRoot | LootTableRoot[]) => {
|
|
22
|
+
const lootTableArray = Array.isArray(lootTable) ? lootTable : [lootTable];
|
|
23
|
+
return lootTableArray.map((table, index) => (
|
|
24
|
+
<div key={index}>
|
|
25
|
+
{table.entries.map((entry: LootTableEntry, entryIndex: number) => {
|
|
26
|
+
const parsedStackKey = entry.Value._stackKey
|
|
27
|
+
? parseRawStackKey(entry.Value._stackKey)
|
|
28
|
+
: null;
|
|
29
|
+
return (
|
|
30
|
+
<div key={entryIndex}>
|
|
31
|
+
<h4>Loot Entry {entryIndex + 1}</h4>
|
|
32
|
+
<p>Weight: {entry.Weight}</p>
|
|
33
|
+
{parsedStackKey && (
|
|
34
|
+
<>
|
|
35
|
+
<p>Item ID: {parsedStackKey.id}</p>
|
|
36
|
+
{parsedStackKey.tn && <p>Item TN: {parsedStackKey.tn}</p>}
|
|
37
|
+
{parsedStackKey._am && <p>Amount: {parsedStackKey._am}</p>}
|
|
38
|
+
</>
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
})}
|
|
43
|
+
</div>
|
|
44
|
+
));
|
|
45
|
+
};
|
|
18
46
|
|
|
47
|
+
const SeedComponent: React.FC<{
|
|
48
|
+
configData?: CollectionConfigData<"Seeds">;
|
|
49
|
+
}> = ({ configData }) => {
|
|
19
50
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
51
|
+
<GenericFetchComponent<CollectionConfigData<"Seeds">>
|
|
52
|
+
collectionName="Seeds"
|
|
53
|
+
configData={configData}
|
|
54
|
+
render={(data) => (
|
|
55
|
+
<div>
|
|
56
|
+
<h2>Seed: {data.DisplayName}</h2>
|
|
57
|
+
<p>Description: {data.Desc}</p>
|
|
58
|
+
<p>Grow Time: {data.GrowTime} seconds</p>
|
|
59
|
+
<p>
|
|
60
|
+
Rarity: {data.Rarity.DisplayName} (Rarity Number:{" "}
|
|
61
|
+
{data.Rarity.RarityNumber})
|
|
62
|
+
</p>
|
|
63
|
+
<ImageComponent src={data.Icon} alt={data.DisplayName} />
|
|
64
|
+
<div>
|
|
65
|
+
<h3>Loot Table</h3>
|
|
66
|
+
{renderLootTable(data.LootTable)}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
/>
|
|
36
71
|
);
|
|
37
72
|
};
|
|
38
73
|
|
|
39
|
-
export default
|
|
74
|
+
export default SeedComponent;
|