diff --git a/src/data/help.tsx b/src/data/help.tsx index 2787ad4..f939556 100644 --- a/src/data/help.tsx +++ b/src/data/help.tsx @@ -1,13 +1,16 @@ import Modal from "components/Modal.vue"; import { JSXFunction, jsx } from "features/feature"; +import { createTab } from "features/tabs/tab"; +import { createTabFamily } from "features/tabs/tabFamily"; import { Persistent, persistent } from "game/persistence"; +import { renderJSX } from "util/vue"; export interface ModalData { modal: JSXFunction; showModal: Persistent; } -function createModal(title: string, body: JSXFunction) { +function createModal(title: string, body: JSXFunction, otherData = {}) { const showModal = persistent(false); const modal = jsx(() => ( )); - return { modal, showModal }; + return { modal, showModal, ...otherData }; } export function getMineHelp() { @@ -132,3 +135,156 @@ export function getEmpowererHelp() { )) ); } + +export function getPortalHelp() { + const tabFamily = createTabFamily({ + general: () => ({ + display: "General", + glowColor(): string { + return tabFamily.activeTab.value === this.tab ? "white" : ""; + }, + tab: createTab(() => ({ + display: jsx(() => ( +
+

+ You've created the Portal Generator (⛩️)! This machine let's you create + portals to other planes, which will have treasures that help you in + various ways! To create a portal you need to specify a tier by dragging + a resource to the generator - higher tier planes cost more energy to + generate portals for, but offer more and better treasures! Keep in mind + time in planes will be paused if the portal is inactive (not selected + nor powered). +

+
+ )) + })) + }), + treasures: () => ({ + display: "Treasures", + glowColor(): string { + return tabFamily.activeTab.value === this.tab ? "white" : ""; + }, + tab: createTab(() => ({ + display: jsx(() => ( +
+ Types of potential treasures: +
    +
  • + Caches: Gain an amount of a + resource based on your current amount. +
  • +
  • + Gen: Passively gain an amount of + a resource while the portal is active (selected or powered). +
  • +
  • + Resource Mult: Increase the + amount gained of a resource from all sources (except caches) while + the portal is active (selected or powered). +
  • +
  • + Energy Mult: Increase the energy + gained per second while the portal is active (selected or powered). +
  • +
  • + Influences: Gain a influence. + See the influences tab for details. You can only have 1 of each + influence. +
  • +
  • + Relic: Gain the relic unique to + this tier of plane. These are powerful passive boosts that can be + empowered. You can only have 1 of each relic. Relics can only appear + with the +relic influence, and will always be the last treasure on a + plane. +
  • +
+
+ )) + })) + }), + influences: () => ({ + display: "Influences", + glowColor(): string { + return tabFamily.activeTab.value === this.tab ? "white" : ""; + }, + tab: createTab(() => ({ + display: jsx(() => ( +
+

+ Some treasures will grant you influences that can help the portal + generator create portals to planes with specified qualities. Each + influence will multiply the energy cost of creating the portal. +

+
+ Influences: +
    +
  • + +resource: Can be connected to + resources and will cause any treasures that reference resources + (caches, gens, and resource mults) to have increased odds of picking + a selected resource. +
  • +
  • + -resource: Can be connected to + resources and will cause any treasures that reference resources + (caches, gens, and resource mults) to have decreased odds of picking + a selected resource. +
  • +
  • + +length: Cause the plane to have + 1 extra treasure than it otherwise would have. +
  • +
  • + +caches: Causes treasures to + have an increased chance to be caches. +
  • +
  • + +gens: Causes treasures to have + an increased chance to be gens. +
  • +
  • + +resource mults: Causes + treasures to have an increased chance to be resource mults. +
  • +
  • + +energy mults: Causes treasures + to have an increased chance to be energy mults. +
  • +
  • + +influences: Causes treasures to + have an increased chance to be influences. +
  • +
  • + +relic: Maximizes length and + difficulty for this tier of plane, and makes the last treasure a + relic (unique per tier of plane). Overrides any other + difficulty-changing influences. +
  • +
  • + +difficulty: Causes the + difficulty and rewards to be in the upper half of what's possible at + this tier. +
  • +
  • + -difficulty: Causes the + difficulty and rewards to be in the lower half of what's possible at + this tier. +
  • +
  • + +rewards: Causes the quality of + treasures to be 1 tier higher. Does not affect influences or relics + treasures. +
  • +
+
+ )) + })) + }) + }); + return createModal( + "Portal Generator", + jsx(() => renderJSX(tabFamily)), + { tabFamily } + ); +} diff --git a/src/data/nodeTypes.tsx b/src/data/nodeTypes.tsx index fe9383b..edadc7f 100644 --- a/src/data/nodeTypes.tsx +++ b/src/data/nodeTypes.tsx @@ -564,7 +564,8 @@ export const portalGenerator = { node.state = { tier: undefined, influences: [] }; }, visibility: node => (node.state as unknown as PortalGeneratorState).tier != null - } + }, + showHelpAction("portalGenerator") ], canAccept(node, otherNode) { return ( diff --git a/src/data/planes.tsx b/src/data/planes.tsx index 597f7d1..772080d 100644 --- a/src/data/planes.tsx +++ b/src/data/planes.tsx @@ -986,7 +986,7 @@ export function createPlane( switch (treasureType) { case "cache": randomResource = getRandomResource(random, influences); - description = `Gain ${format( + description = `Cache: Gain ${format( Decimal.div(rewardsLevel.value, 12) )}x your current ${randomResource} (no modifiers).`; onComplete = () => @@ -1006,28 +1006,32 @@ export function createPlane( const gain = Decimal.div(rewardsLevel.value, 40).times( mineLootTable[randomResource] ); - description = `Gain ${format(gain)} ${randomResource}/s while plane is active.`; + description = `Gen: Gain ${format( + gain + )} ${randomResource}/s while plane is active.`; update = diff => main.grantResource(randomResource, Decimal.times(diff, gain)); link = computed(() => main.resourceNodes.value[randomResource]); break; case "resourceMulti": effectedResource = randomResource = getRandomResource(random, influences); resourceMulti = Decimal.div(rewardsLevel.value, 10).pow_base(2); - description = `Gain ${format( + description = `Resource Mult: Gain ${format( resourceMulti )}x ${randomResource} while plane is active.`; break; case "energyMulti": effectedResource = "energy"; resourceMulti = Decimal.div(rewardsLevel.value, 8).add(1); - description = `Gain ${format(resourceMulti)}x energy while plane is active.`; + description = `Energy Mult: Gain ${format( + resourceMulti + )}x energy while plane is active.`; break; case "influences": const randomInfluence = (Object.keys(influenceTypes) as Influences[])[ Math.floor(random() * Object.keys(influenceTypes).length) ]; influenceTreasures.push(randomInfluence); - description = `Gain a portal influence (${influenceTypes[randomInfluence].display})`; + description = `Influence: Gain a portal influence (${influenceTypes[randomInfluence].display})`; onComplete = () => { if (randomInfluence in main.influenceNodes.value) { toast.warning( @@ -1057,7 +1061,7 @@ export function createPlane( description = tier === "ultimatum" ? "Win the game!" - : `Gain the ${tier}-tier planar relic (${relics[tier]})`; + : `Relic: Gain the ${tier}-tier planar relic (${relics[tier]})`; onComplete = () => { if (tier === "ultimatum") { hasWon.value = true; diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index 60ccd4f..257b4bf 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -58,7 +58,14 @@ import { resourceNames, tools } from "./data"; -import { getDowsingHelp, getEmpowererHelp, getForgeHelp, getMineHelp, getQuarryHelp } from "./help"; +import { + getDowsingHelp, + getEmpowererHelp, + getForgeHelp, + getMineHelp, + getPortalHelp, + getQuarryHelp +} from "./help"; import "./main.css"; import { automator, @@ -778,7 +785,8 @@ export const main = createLayer("main", function (this: BaseLayer) { factory: getForgeHelp(), dowsing: getDowsingHelp(), quarry: getQuarryHelp(), - empowerer: getEmpowererHelp() + empowerer: getEmpowererHelp(), + portalGenerator: getPortalHelp() }; helpModals.mine.showModal[DefaultValue] = true; helpModals.mine.showModal.value = true;