Skip to content

Commit

Permalink
Tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
phulin committed Nov 17, 2024
1 parent 8caa075 commit 051a419
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/sections/ResourceSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import MayDayPackage from "./resources/2022/MaydaySupplyPackage";
import ModelTrainSet from "./resources/2022/ModelTrainSet";
import TinyStillsuit from "./resources/2022/TinyStillsuit";
import UnbreakableUmbrella from "./resources/2022/UnbreakableUmbrella";
import MrStore2002 from "./resources/2023/2002Catalog";
import BurningLeaves from "./resources/2023/AGuidetoBurningLeaves";
import AugustScepter from "./resources/2023/AugustScepter";
import BookOfFacts from "./resources/2023/BookOfFacts";
Expand All @@ -52,6 +51,7 @@ import CinchoDeMayo from "./resources/2023/CinchoDeMayo";
import ClosedCircuitPayPhone from "./resources/2023/ClosedCircuitPayPhone";
import CursedMonkeysPaw from "./resources/2023/CursedMonkeyPaw";
import JillOfAllTrades from "./resources/2023/JillOfAllTrades";
import MrStore2002Catalog from "./resources/2023/MrStore2002Catalog";
import PatrioticEagle from "./resources/2023/PatrioticEagle";
import RockGarden from "./resources/2023/RockGarden";
import SITCertificate from "./resources/2023/SITCourseCertificate";
Expand Down Expand Up @@ -144,7 +144,7 @@ const ResourceSection = () => (
ClosedCircuitPayPhone,
CursedMonkeysPaw,
CinchoDeMayo,
MrStore2002,
MrStore2002Catalog,
PatrioticEagle,
AugustScepter,
BookOfFacts,
Expand Down
64 changes: 29 additions & 35 deletions src/sections/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ const ENV_RESULTS: Record<string, string> = {
};

const CMCTimeline: FC = () => {
const cabinet = $item`cold medicine cabinet`;
const workshed = getWorkshed();
const consults = get("_coldMedicineConsults");
const nextConsult = get("_nextColdMedicineConsult");

const turnsToConsult = nextConsult - totalTurnsPlayed();
if (workshed !== cabinet || consults >= 5) return null;

const cabinet = $item`cold medicine cabinet`;
const workshed = getWorkshed();
const nextConsult = get("_nextColdMedicineConsult");
const turnsToConsult = nextConsult - totalTurnsPlayed();

const environments = [...get("lastCombatEnvironments").toUpperCase()];
const counts: Record<string, number> = {};
Expand All @@ -67,43 +68,36 @@ const CMCTimeline: FC = () => {
counts[maxEnvironment] >= 11 ? ENV_RESULTS[maxEnvironment] : ENV_RESULTS.X;

return (
workshed === cabinet &&
consults < 5 && (
<Stack spacing={1} align="flex-start">
<Stack flexFlow="row wrap" spacing={0.5} align="center">
{environments.map((c, index) => (
<Badge
key={index}
w="14px"
px={0}
textAlign="center"
fontSize="xs"
color="white"
bgColor={ENV_COLORS[c]}
>
{c}
</Badge>
))}
</Stack>
<Stack flexFlow="row wrap" spacing={1} align="center">
<Text as="b">
{turnsToConsult > 0 ? (
plural(turnsToConsult, "turn")
) : (
<MainLink href="/campground.php?action=workshed">NOW</MainLink>
)}
:
</Text>
<Stack spacing={1} align="flex-start">
<Stack flexFlow="row wrap" spacing={0.5} align="center">
{environments.map((c, index) => (
<Badge
key={index}
w="14px"
px={0}
textAlign="center"
fontSize="xs"
color="white"
bgColor={ENV_COLORS[maxEnvironment]}
bgColor={ENV_COLORS[c]}
>
{result}
{c}
</Badge>
</Stack>
))}
</Stack>
)
<Stack flexFlow="row wrap" spacing={1} align="center">
<Text as="b">
{turnsToConsult > 0 ? (
plural(turnsToConsult, "turn")
) : (
<MainLink href="/campground.php?action=workshed">NOW</MainLink>
)}
:
</Text>
<Badge fontSize="xs" color="white" bgColor={ENV_COLORS[maxEnvironment]}>
{result}
</Badge>
</Stack>
</Stack>
);
};

Expand Down
67 changes: 66 additions & 1 deletion src/sections/misc/Leveling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
effectModifier,
Familiar,
getWorkshed,
haveEquipped,
isUnrestricted,
Item,
myBasestat,
Expand All @@ -28,16 +29,19 @@ import {
getModifier,
have,
MayamCalendar,
questStep,
totalFamiliarWeight,
} from "libram";

import AsyncLink from "../../components/AsyncLink";
import Cold from "../../components/elemental/Cold";
import Line from "../../components/Line";
import LinkBlock from "../../components/LinkBlock";
import MainLink from "../../components/MainLink";
import Tile from "../../components/Tile";
import { haveUnrestricted } from "../../util/available";
import { inventoryLink } from "../../util/links";
import { questStarted } from "../../util/quest";
import { renderSourceList, Source } from "../../util/source";
import { plural } from "../../util/text";

Expand Down Expand Up @@ -119,6 +123,66 @@ const Leveling: React.FC = () => {
</ListItem>
),
},
{
name: "Leaflet",
remaining: () => +!get("leafletCompleted"),
render: () => {
const text = (
<>
1 strange leaflet (Quests menu)
{myLevel() < 9
? " (after level 9)"
: !have($item`strange leaflet`) && " (visit council)"}
.
</>
);
return (
<ListItem>
{myLevel() >= 9 && !have($item`strange leaflet`) ? (
<MainLink href="/council.php">{text}</MainLink>
) : (
text
)}
</ListItem>
);
},
},
{
name: "Enchanted Bean",
remaining: () =>
+(
questStep("questL10Garbage") <= 1 &&
haveUnrestricted($item`spring shoes`)
),
render: () => {
const haveBean = have($item`enchanted bean`);
const verb = haveBean ? "Plant" : "Find and plant";
const text = `${verb} an enchanted bean${myLevel() >= 10 ? "" : " (at level 10)"}.`;
return (
<ListItem>
{myLevel() >= 10 && haveBean ? (
haveEquipped($item`spring shoes`) ? (
<MainLink
href={
questStarted("questL10Garbage")
? inventoryLink($item`enchanted bean`)
: "/council.php"
}
>
{text}
</MainLink>
) : (
<AsyncLink command="equip acc3 spring shoes">
Equip spring shoes, then plant enchanted bean.
</AsyncLink>
)
) : (
text
)}
</ListItem>
);
},
},
];

const { total, rendered } = renderSourceList(levelingSources);
Expand Down Expand Up @@ -209,7 +273,8 @@ const Leveling: React.FC = () => {
const statName = myPrimestat().identifierString;
const substat = $stat`Sub${statName === "none" ? "Muscle" : statName}`;
const currentSubstat = myBasestat(substat);
const endingSubstat = currentSubstat + mouthwashMainstat * potentialMouthwash;
const endingSubstat =
currentSubstat + multiplier * mouthwashMainstat * potentialMouthwash;
const endingStat = Math.sqrt(endingSubstat);
const endingLevel = Math.sqrt(endingStat - 4) + 1;

Expand Down
8 changes: 7 additions & 1 deletion src/sections/quests/Level10.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FC } from "react";
import Line from "../../components/Line";
import QuestTile from "../../components/QuestTile";
import { haveUnrestricted } from "../../util/available";
import { inventoryLink } from "../../util/links";
import { atStep, Step } from "../../util/quest";
import { commaAnd, plural } from "../../util/text";

Expand Down Expand Up @@ -42,7 +43,12 @@ const Level10: FC = () => {
imageUrl="/images/otherimages/sigils/recyctat.gif"
href={atStep(step, [
[Step.UNSTARTED, "/council.php"],
[Step.STARTED, "/place.php?whichplace=plains"],
[
Step.STARTED,
have($item`enchanted bean`)
? inventoryLink($item`enchanted bean`)
: "/place.php?whichplace=plains",
],
[1, "/place.php?whichplace=beanstalk"],
[7, "/place.php?whichplace=giantcastle"],
[10, "/council.php"],
Expand Down
32 changes: 20 additions & 12 deletions src/sections/quests/Level2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Line from "../../components/Line";
import QuestTile from "../../components/QuestTile";
import { turnsToSeeSingleNoncombatCapped } from "../../util/calc";
import { atStep, Step } from "../../util/quest";
import { plural } from "../../util/text";

const Level2: FC = () => {
const forest = $location`The Spooky Forest`;
Expand Down Expand Up @@ -38,18 +39,25 @@ const Level2: FC = () => {
[Step.UNSTARTED, <Line>Visit Council to start quest.</Line>],
[
Step.STARTED,
<>
<Line>Find NC for mosquito larva.</Line>
{progress >= 7 ? (
<Line>NC guaranteed next turn.</Line>
) : progress === 6 ? (
<Line>50% chance of guaranteed NC next turn.</Line>
) : (
<Line>
Expected {expectedTurns.toFixed(1)} turns until next NC.
</Line>
)}
</>,
forest.turnsSpent <= 5 ? (
<Line>
Burn {plural(5 - forest.turnsSpent, "turn")} of delay in the
Spooky Forest.
</Line>
) : (
<>
<Line>Find NC for mosquito larva.</Line>
{progress >= 7 ? (
<Line>NC guaranteed next turn.</Line>
) : progress === 6 ? (
<Line>50% chance of guaranteed NC next turn.</Line>
) : (
<Line>
Expected {expectedTurns.toFixed(1)} turns until next NC.
</Line>
)}
</>
),
],
[1, <Line>Turn in larva to the Council.</Line>],
])}
Expand Down
9 changes: 6 additions & 3 deletions src/sections/resources/2022/CosmicBowlingBall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ const CosmicBowlingBall = () => {
id: "cosmic-bowling-ball-nag",
priority: NagPriority.MID,
imageUrl: "/images/itemimages/cosmicball2.gif",
node: youHaveTheBall && (
node: (youHaveTheBall || returnCombats === 1) && (
<Tile
header="Cosmic Bowling Ball"
id="cosmic-bowling-ball-nag"
imageUrl="/images/itemimages/cosmicball2.gif"
>
<Line>You have it! Throw a curveball for a free run/banish.</Line>
<Line>
{youHaveTheBall ? "You have it!" : "Bowling ball back next combat!"}{" "}
Throw a curveball for a free run/banish.
</Line>
</Tile>
),
}),
[youHaveTheBall],
[returnCombats, youHaveTheBall],
);

if (!youHaveTheBall && returnCombats < 0) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Line from "../../../components/Line";
import Tile from "../../../components/Tile";
import { haveUnrestricted } from "../../../util/available";

const MrStore2002 = () => {
const MrStore2002Catalog = () => {
const spookyVHSTape = $item`Spooky VHS Tape`;
const loathingIdolMicrophone = $item`Loathing Idol Microphone`;
const flashLiquidizerUltraDousingAccessory = $item`Flash Liquidizer Ultra Dousing Accessory`;
Expand All @@ -16,7 +16,9 @@ const MrStore2002 = () => {
const nextVHSTurn = get("spookyVHSTapeMonsterTurn") + 8;
const nextVHSTimer = nextVHSTurn - totalTurnsPlayed();
const imageName = get("spookyVHSTapeMonster");
const mr2002Credits = get("availableMrStore2002Credits");
const mr2002Credits =
get("availableMrStore2002Credits") +
3 * +!get("_2002MrStoreCreditsCollected");
const availableVHSes = availableAmount(spookyVHSTape);
const mcTwistUsed = get("_epicMcTwistUsed");
const fludaDousesLeft = Math.max(3 - get("_douseFoeUses"), 0);
Expand Down Expand Up @@ -156,4 +158,4 @@ const MrStore2002 = () => {
);
};

export default MrStore2002;
export default MrStore2002Catalog;

0 comments on commit 051a419

Please sign in to comment.