Skip to content

Commit

Permalink
Fallbot tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
phulin committed Nov 9, 2024
1 parent f3a4761 commit 0717444
Showing 1 changed file with 47 additions and 72 deletions.
119 changes: 47 additions & 72 deletions src/sections/resources/2022/Autumnaton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,47 +74,6 @@ const Autumnaton = () => {
return null;
}

const description: JSX.Element[] = [];

if (have(autumnatonItem)) {
description.push(
<Line key="autumnaton-next-use">
Next use will take{" "}
<Text as="span" fontWeight="bold" color="red.500">
{autobotsReturnTime}
</Text>{" "}
adventures.
</Line>,
);
} else if (turncountWhereAutobotReturns > totalTurnsPlayed()) {
description.push(
<Line key="autumnaton-will-return">
Will return in{" "}
<Text as="span" fontWeight="bold" color="red.500">
{turncountWhereAutobotReturns + 1 - totalTurnsPlayed()}
</Text>{" "}
adventures.
</Line>,
);
description.push(
<Line key="autumnaton-currently-exploring">
<Text as="b">
Currently exploring: {autumnatonQuestLocation?.identifierString}
</Text>
</Line>,
);
} else if (turncountWhereAutobotReturns <= totalTurnsPlayed()) {
description.push(
<Line key="autumnaton-next-mission">
Next mission takes{" "}
<Text as="span" fontWeight="bold" color="red.500">
{autobotsReturnTime}
</Text>{" "}
adventures.
</Line>,
);
}

const upgradesToGet: string[] = [];
if (!autumnatonUpgrades.includes("cowcatcher")) {
upgradesToGet.push(
Expand All @@ -136,16 +95,6 @@ const Autumnaton = () => {
upgradesToGet.push("Visit mid indoor for -11 cooldown (Haunted Library?)");
}

if (upgradesToGet.length > 0) {
description.push(
<UnorderedList key="autumnaton-upgrades">
{upgradesToGet.map((text) => (
<ListItem key={text}>{text}</ListItem>
))}
</UnorderedList>,
);
}

const potentialTargets: [string, string][] = [];
if (get("_inRunBool") && currentPath.id !== 25) {
if (
Expand Down Expand Up @@ -189,33 +138,59 @@ const Autumnaton = () => {
}
}

if (potentialTargets.length > 0) {
description.push(
<AdviceTooltip
key="autumnaton-potential-targets"
text={
<VStack align="start">
<Heading size="sm">Potential Targets</Heading>
{potentialTargets.map(([item, location], index) => (
<Text key={`autumnaton-target-${index}`}>
<ItemButtons linkedContent={$item`${item}`} /> ({location})
</Text>
))}
</VStack>
}
label="Potential Autumnaton Targets"
/>,
);
}

return (
<Tile
header="Autumn-aton"
imageUrl="/images/itemimages/autumnaton.gif"
linkedContent={autumnatonItem}
>
<Line>Grabs items from a zone you've previously visited.</Line>,
{description}
<Line>Grabs items from a zone you've previously visited.</Line>
{have(autumnatonItem) ? (
<Line>
Next use will take{" "}
<Text as="span" fontWeight="bold" color="red.500">
{autobotsReturnTime}
</Text>{" "}
adventures.
</Line>
) : (
<>
<Line>
Will return in{" "}
<Text as="b" color="red.500">
{turncountWhereAutobotReturns + 1 - totalTurnsPlayed()}
</Text>{" "}
adventures.
</Line>
<Line>
<Text as="b">
Currently exploring: {autumnatonQuestLocation?.identifierString}.
</Text>
</Line>
</>
)}
{upgradesToGet.length > 0 && (
<UnorderedList>
{upgradesToGet.map((text) => (
<ListItem key={text}>{text}</ListItem>
))}
</UnorderedList>
)}
{potentialTargets.length > 0 && (
<AdviceTooltip
text={
<VStack align="start">
<Heading size="sm">Potential Targets</Heading>
{potentialTargets.map(([item, location], index) => (
<Text key={`autumnaton-target-${index}`}>
<ItemButtons linkedContent={$item`${item}`} /> ({location})
</Text>
))}
</VStack>
}
label="Potential Autumnaton Targets"
/>
)}
</Tile>
);
};
Expand Down

0 comments on commit 0717444

Please sign in to comment.