mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-25 01:41:44 +00:00
Add dowsing help
This commit is contained in:
parent
f2cc6195c7
commit
8595905204
3 changed files with 37 additions and 4 deletions
|
@ -1,6 +1,11 @@
|
|||
import Modal from "components/Modal.vue";
|
||||
import { JSXFunction, jsx } from "features/feature";
|
||||
import { persistent } from "game/persistence";
|
||||
import { Persistent, persistent } from "game/persistence";
|
||||
|
||||
export interface ModalData {
|
||||
modal: JSXFunction;
|
||||
showModal: Persistent<boolean>;
|
||||
}
|
||||
|
||||
function createModal(title: string, body: JSXFunction) {
|
||||
const showModal = persistent<boolean>(false);
|
||||
|
@ -67,3 +72,23 @@ export function getForgeHelp() {
|
|||
))
|
||||
);
|
||||
}
|
||||
|
||||
export function getDowsingHelp() {
|
||||
return createModal(
|
||||
"Dowsing",
|
||||
jsx(() => (
|
||||
<div>
|
||||
<p>
|
||||
You've created the dowsing rod (🥢)! This machine let's you bias the odds of
|
||||
specified resources from mining. It will double the odds of each specified
|
||||
resource, so keep in mind rare resources will still be fairly rare.
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
Specify resources to boost by dragging them to the dowsing rod. You can only
|
||||
select a single resource to start, but that can be increased using an action.
|
||||
</p>
|
||||
</div>
|
||||
))
|
||||
);
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ import {
|
|||
import { GenericPlane, createPlane } from "./planes";
|
||||
import { main } from "./projEntry";
|
||||
import { exponentialFormat } from "util/bignum";
|
||||
import { ModalData } from "./help";
|
||||
|
||||
export const mine = {
|
||||
shape: Shape.Diamond,
|
||||
|
@ -186,6 +187,11 @@ export const factory = {
|
|||
main.board.selectedAction.value = null;
|
||||
main.board.selectedNode.value = null;
|
||||
node.state = undefined;
|
||||
if (tool.type in main.helpModals) {
|
||||
main.helpModals[
|
||||
tool.type as keyof (typeof main)["helpModals"]
|
||||
].showModal.value = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
fillColor: node =>
|
||||
|
@ -335,7 +341,8 @@ export const dowsing = {
|
|||
actions: [
|
||||
deselectAllAction,
|
||||
getIncreaseConnectionsAction(x => x.add(2).pow_base(100), 16),
|
||||
togglePoweredAction
|
||||
togglePoweredAction,
|
||||
showHelpAction("dowsing")
|
||||
],
|
||||
classes: node => ({
|
||||
running: isPowered(node)
|
||||
|
|
|
@ -78,7 +78,7 @@ import {
|
|||
upgrader
|
||||
} from "./nodeTypes";
|
||||
import { GenericPlane, createPlane } from "./planes";
|
||||
import { getForgeHelp, getMineHelp } from "./help";
|
||||
import { getDowsingHelp, getForgeHelp, getMineHelp } from "./help";
|
||||
|
||||
const toast = useToast();
|
||||
|
||||
|
@ -775,7 +775,8 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
|
||||
const helpModals = {
|
||||
mine: getMineHelp(),
|
||||
factory: getForgeHelp()
|
||||
factory: getForgeHelp(),
|
||||
dowsing: getDowsingHelp()
|
||||
};
|
||||
helpModals.mine.showModal[DefaultValue] = true;
|
||||
helpModals.mine.showModal.value = true;
|
||||
|
|
Loading…
Reference in a new issue