narrat 1.1.0 → 1.3.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/lib/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 1.1.0 - June 25, 2022 09:56:51
1
+ // Version: 1.3.0 - June 25, 2022 18:05:43
2
2
  import 'es6-promise/auto';
3
3
  import { ref, reactive, readonly, defineComponent, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, Fragment, renderList, normalizeClass, createBlock, Transition, withCtx, renderSlot, createTextVNode, computed, resolveComponent, withDirectives, vModelText, toDisplayString, TransitionGroup, createVNode, createApp } from 'vue';
4
4
  import { defineStore, mapState, createPinia } from 'pinia';
@@ -30,7 +30,7 @@ function styleInject(css, ref) {
30
30
  }
31
31
  }
32
32
 
33
- var css_248z = "/*! @import */\n\n/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */\n\n/*\nDocument\n========\n*/\n\n/**\nUse a better box model (opinionated).\n*/\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/**\nUse a more readable tab size (opinionated).\n*/\n\n:root {\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n}\n\n/**\n1. Correct the line height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n*/\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/*\nSections\n========\n*/\n\n/**\nRemove the margin in all browsers.\n*/\n\nbody {\n margin: 0;\n}\n\n/**\nImprove consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n*/\n\nbody {\n font-family:\n\t\tsystem-ui,\n\t\t-apple-system, /* Firefox supports this but not yet `system-ui` */\n\t\t'Segoe UI',\n\t\tRoboto,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\t'Apple Color Emoji',\n\t\t'Segoe UI Emoji';\n}\n\n/*\nGrouping content\n================\n*/\n\n/**\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n}\n\n/*\nText-level semantics\n====================\n*/\n\n/**\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr[title] {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/**\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n2. Correct the odd 'em' font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family:\n\t\tui-monospace,\n\t\tSFMono-Regular,\n\t\tConsolas,\n\t\t'Liberation Mono',\n\t\tMenlo,\n\t\tmonospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/**\nPrevent 'sub' and 'sup' elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\nTabular data\n============\n*/\n\n/**\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n}\n\n/*\nForms\n=====\n*/\n\n/**\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\nRemove the inheritance of text transform in Edge and Firefox.\n1. Remove the inheritance of text transform in Firefox.\n*/\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\nCorrect the inability to style clickable types in iOS and Safari.\n*/\n\nbutton,\n[type='button'],\n[type='reset'] {\n -webkit-appearance: button;\n}\n\n/**\nRemove the inner border and padding in Firefox.\n*/\n\n/**\nRestore the focus styles unset by the previous rule.\n*/\n\n/**\nRemove the additional ':invalid' styles in Firefox.\nSee: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737\n*/\n\n/**\nRemove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.\n*/\n\nlegend {\n padding: 0;\n}\n\n/**\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n/**\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n/**\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to 'inherit' in Safari.\n*/\n\n/*\nInteractive\n===========\n*/\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/**\n * Manually forked from SUIT CSS Base: https://github.com/suitcss/base\n * A thin layer on top of normalize.css that provides a starting point more\n * suitable for web applications.\n */\n\n/**\n * Removes the default spacing and border for appropriate elements.\n */\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nbutton {\n background-color: transparent;\n background-image: none;\n}\n\n/**\n * Work around a Firefox/IE bug where the transparent `button` background\n * results in a loss of the default `button` focus styles.\n */\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/**\n * Tailwind custom reset styles\n */\n\n/**\n * 1. Use the user's configured `sans` font-family (with Tailwind's default\n * sans-serif font stack as a fallback) as a sane default.\n * 2. Use Tailwind's default \"normal\" line-height so the user isn't forced\n * to override it to ensure consistency even when using the default theme.\n */\n\nhtml {\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 1 */\n line-height: 1.5; /* 2 */\n}\n\n/**\n * Inherit font-family and line-height from `html` so users can set them as\n * a class directly on the `html` element.\n */\n\nbody {\n font-family: inherit;\n line-height: inherit;\n}\n\n/**\n * 1. Prevent padding and border from affecting element width.\n *\n * We used to set this in the html element and inherit from\n * the parent element for everything else. This caused issues\n * in shadow-dom-enhanced elements like <details> where the content\n * is wrapped by a div with box-sizing set to `content-box`.\n *\n * https://github.com/mozdevs/cssremedy/issues/4\n *\n *\n * 2. Allow adding a border to an element by just adding a border-width.\n *\n * By default, the way the browser specifies that an element should have no\n * border is by setting it's border-style to `none` in the user-agent\n * stylesheet.\n *\n * In order to easily add borders to elements by just setting the `border-width`\n * property, we change the default border-style for all elements to `solid`, and\n * use border-width to hide them instead. This way our `border` utilities only\n * need to set the `border-width` property instead of the entire `border`\n * shorthand, making our border utilities much more straightforward to compose.\n *\n * https://github.com/tailwindcss/tailwindcss/pull/116\n */\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n/*\n * Ensure horizontal rules are visible by default\n */\n\nhr {\n border-top-width: 1px;\n}\n\n/**\n * Undo the `border-style: none` reset that Normalize applies to images so that\n * our `border-{width}` utilities have the expected effect.\n *\n * The Normalize reset is unnecessary for us since we default the border-width\n * to 0 on all elements.\n *\n * https://github.com/tailwindcss/tailwindcss/issues/362\n */\n\nimg {\n border-style: solid;\n}\n\ntextarea {\n resize: vertical;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #9ca3af;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #9ca3af;\n}\n\ninput::placeholder,\ntextarea::placeholder {\n color: #9ca3af;\n}\n\nbutton {\n cursor: pointer;\n}\n\ntable {\n border-collapse: collapse;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/**\n * Reset links to optimize for opt-in styling instead of\n * opt-out.\n */\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/**\n * Reset form element properties that are easy to forget to\n * style explicitly so you don't inadvertently introduce\n * styles that deviate from your design system. These styles\n * supplement a partial reset that is already applied by\n * normalize.css.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n}\n\n/**\n * Use the configured 'mono' font family for elements that\n * are expected to be rendered with a monospace font, falling\n * back to the system monospace stack if there is no configured\n * 'mono' font family.\n */\n\npre,\ncode,\nkbd,\nsamp {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n\n/**\n * Make replaced elements `display: block` by default as that's\n * the behavior you want almost all of the time. Inspired by\n * CSS Remedy, with `svg` added as well.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n vertical-align: middle;\n}\n\n/**\n * Constrain images and videos to the parent width and preserve\n * their instrinsic aspect ratio.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n\n.bg-gray-800 {\n --tw-bg-opacity: 1;\n background-color: rgba(31, 41, 55, var(--tw-bg-opacity));\n}\n\n.border {\n border-width: 1px;\n}\n\n.flex {\n display: flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.hidden {\n display: none;\n}\n\n.flex-row {\n flex-direction: row;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.flex-shrink {\n flex-shrink: 1;\n}\n\n.list-disc {\n list-style-type: disc;\n}\n\n.absolute {\n position: absolute;\n}\n\n.resize {\n resize: both;\n}\n\n* {\n --tw-shadow: 0 0 #0000;\n}\n\n* {\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgba(59, 130, 246, 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n}\n\n.table-auto {\n table-layout: auto;\n}\n\n.line-through {\n text-decoration: line-through;\n}\n\n.w-full {\n width: 100%;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.transition {\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n@-webkit-keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@-webkit-keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n\n@keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n\n@-webkit-keyframes pulse {\n 50% {\n opacity: .5;\n }\n}\n\n@keyframes pulse {\n 50% {\n opacity: .5;\n }\n}\n\n@-webkit-keyframes bounce {\n 0%, 100% {\n transform: translateY(-25%);\n -webkit-animation-timing-function: cubic-bezier(0.8,0,1,1);\n animation-timing-function: cubic-bezier(0.8,0,1,1);\n }\n\n 50% {\n transform: none;\n -webkit-animation-timing-function: cubic-bezier(0,0,0.2,1);\n animation-timing-function: cubic-bezier(0,0,0.2,1);\n }\n}\n\n@keyframes bounce {\n 0%, 100% {\n transform: translateY(-25%);\n -webkit-animation-timing-function: cubic-bezier(0.8,0,1,1);\n animation-timing-function: cubic-bezier(0.8,0,1,1);\n }\n\n 50% {\n transform: none;\n -webkit-animation-timing-function: cubic-bezier(0,0,0.2,1);\n animation-timing-function: cubic-bezier(0,0,0.2,1);\n }\n}\n\n:root {\n --bg-color: #131720;\n --text-color: #d9e1f2;\n --primary: hsl(255, 30%, 55%);\n --focus: hsl(210, 90%, 50%);\n --secondary: #42b983;\n --border-color: hsla(0, 0%, 100%, 0.2);\n --light-1: hsl(210, 30%, 40%);\n --light-2: hsl(255, 30%, 50%);\n --light-background: linear-gradient(to right, var(--light-1), var(--light-2));\n --shadow-1: hsla(236, 50%, 50%, 0.3);\n --shadow-2: hsla(236, 50%, 50%, 0.4);\n --hud-background: rgba(0, 0, 0, 0.4);\n --hud-text-color: var(--text-color);\n --notifications-bg: darkslateblue;\n --skills-text-background: rgba(0, 0, 0, 0.5);\n --skills-text-color: var(--text-color);\n --skills-level-background: rgba(0, 0, 0, 0.5);\n --skills-level-color: orange;\n --skills-xp-bar-height: 40px;\n --skill-check-name-color: orange;\n --skill-check-difficulty: orange;\n --skill-check-success: green;\n --skill-check-failed: red;\n --skill-check-color: orange;\n --dialog-choice-color: orange;\n --dialog-choice-hover-color: var(--text-color);\n}\n\n.list-item {\n display: inline-block;\n margin-right: 10px;\n}\n\n.list-enter-active,\r\n.list-leave-active {\n transition: all 0.3s ease;\n}\n\n/* .list-move {\r\n transition: transform 0.3s ease;\r\n} */\n\n.list-enter-from,\r\n.list-leave-to {\n opacity: 0;\n transform: translateX(300px);\n}\n\n.notification-item {\n display: inline-block;\n margin-right: 10px;\n}\n\n.notification-enter-active,\r\n.notification-leave-active {\n transition: all 0.3s ease;\n}\n\n/* .notification-move {\r\n transition: transform 0.3s ease;\r\n} */\n\n.notification-enter-from,\r\n.notification-leave-to {\n opacity: 0;\n transform: translateY(-300px);\n}\n\n.fade-enter-active,\r\n.fade-leave-active {\n transition: opacity 0.3s ease;\n}\n\n.fade-enter-from,\r\n.fade-leave-to {\n opacity: 0;\n}\n\n.fade-in-enter-active {\n transition: opacity 0.1s ease;\n}\n\n.fade-in-enter-from {\n opacity: 0;\n}\n\nbody {\n padding: 0;\n margin: 0;\n font-family: Arial, sans-serif;\n background-color: black;\n}\n\n.select {\n background: var(--light-background);\n padding: 10px;\n}\n\n.option {\n background-color: var(--light-2);\n padding: 5px;\n color: var(--text-color);\n}\n\n.button {\n background: var(--light-background);\n color: var(--text-color);\n box-shadow: 0.4rem 0.4rem 2.4rem 0.2rem var(--shadow-1);\n border-radius: 100px;\n padding: 10px;\n font-weight: 800;\n font-size: 16px;\n margin: 10px;\n transition: 0.2s;\n}\n\n.button:focus,\r\n.button:hover {\n transform: translateY(-0.2rem);\n box-shadow: 0 0 2.4rem 0.2rem var(--shadow-2);\n}\n\n.input {\n background: var(--light-background);\n color: var(--text-color);\n box-shadow: 0.4rem 0.4rem 2.4rem 0.2rem var(--shadow-1);\n border-radius: 100px;\n padding: 10px;\n font-weight: 800;\n font-size: 16px;\n margin: 10px;\n transition: 0.2s;\n}\n\n.input:focus,\r\n.input:hover {\n transform: translateY(-0.2rem);\n box-shadow: 0 0 2.4rem 0.2rem var(--shadow-2);\n}\n\na {\n color: pink;\n text-decoration: underline;\n}\n\nth,\r\ntd {\n padding: 4px;\n border: 1px solid var(--text-color);\n text-align: center;\n}\n\n#game-holder {\n width: 100vw;\n height: 100vh;\n padding: 0;\n margin: 0;\n top: 0;\n left: 0;\n background-color: black;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: -webkit-fill-available;\n}\n\n.title {\n font-size: 30px;\n font-weight: 700;\n text-align: center;\n}\n\n.container {\n padding: 20px;\n}\n\nh1,\r\nh2,\r\nh3,\r\nh4 {\n font-weight: 700;\n}\n\nh1 {\n font-size: 30px;\n}\n\nh2 {\n font-size: 26px;\n}\n\nh3 {\n font-size: 24px;\n}\n\nhr.solid {\n border: 1px solid var(--text-color);\n margin-top: 30px;\n margin-bottom: 30px;\n}\n\n.card-1 {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n.card-1:hover {\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n}\n\n.card-2 {\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);\n}\n\n.card-3 {\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);\n}\n\n.card-4 {\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n}\n\n.card-5 {\n box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);\n}\n\n.dialog-choice {\n transition: 0.2s;\n}\n\n.dialog-choice:hover {\n transform: scale(1.05, 1.05);\n transform-origin: center;\n}\n\n/* Somewhat arcane CSS to force the hover color to override the child style.\r\nOtherwise hovering choices doesn't change the color of skill check prompts. */\n\n.dialog-choice:not(:hover) > .skill-check-name,\r\n.passive-skill-check > .skill-check-name {\n color: var(--skill-check-name-color);\n}\n\n.dialog-choice:not(:hover) > .skill-check-difficulty,\r\n.passive-skill-check > .skill-check-difficulty {\n color: var(--skill-check-difficulty);\n}\n\n.skill-check-difficulty {\n font-weight: 700;\n}\n\n.dialog-choice:not(:hover) > .skill-check-success,\r\n.passive-skill-check > .skill-check-success {\n color: var(--skill-check-success);\n}\n\n.dialog-choice:not(:hover) > .skill-check-failed,\r\n.passive-skill-check > .skill-check-failed {\n color: var(--skill-check-failed);\n}\n\n.dialog-choice:not(:hover) > .skill-check,\r\n.passive-skill-check.skill-check {\n color: var(--skill-check-color);\n}\n\n.narrat-canvas {\n position: absolute;\n height: 100%;\n top: 0;\n left: 0;\n}\n\n/* Looks ugly */\n\n/* @keyframes strike-anim {\r\n 0% {\r\n width: 0;\r\n }\r\n 100% {\r\n width: 100%;\r\n }\r\n}\r\n.strike-anim {\r\n position: relative;\r\n}\r\n.strike-anim::after {\r\n content: ' ';\r\n position: absolute;\r\n top: 50%;\r\n left: 0;\r\n width: 100%;\r\n height: 1px;\r\n background: var(--text-color);\r\n animation-name: strike-anim;\r\n animation-duration: 0.5s;\r\n animation-timing-function: linear;\r\n animation-iteration-count: 1;\r\n animation-fill-mode: forwards;\r\n} */\n\n#touchTrigger {\n pointer-events: none;\n}\n\n@media (min-width: 640px) {\n}\n\n@media (min-width: 768px) {\n}\n\n@media (min-width: 1024px) {\n}\n\n@media (min-width: 1280px) {\n}\n\n@media (min-width: 1536px) {\n}\r\n";
33
+ var css_248z = "/*! @import */\n\n/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */\n\n/*\nDocument\n========\n*/\n\n/**\nUse a better box model (opinionated).\n*/\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/**\nUse a more readable tab size (opinionated).\n*/\n\n:root {\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n}\n\n/**\n1. Correct the line height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n*/\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/*\nSections\n========\n*/\n\n/**\nRemove the margin in all browsers.\n*/\n\nbody {\n margin: 0;\n}\n\n/**\nImprove consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n*/\n\nbody {\n font-family:\n\t\tsystem-ui,\n\t\t-apple-system, /* Firefox supports this but not yet `system-ui` */\n\t\t'Segoe UI',\n\t\tRoboto,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\t'Apple Color Emoji',\n\t\t'Segoe UI Emoji';\n}\n\n/*\nGrouping content\n================\n*/\n\n/**\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n}\n\n/*\nText-level semantics\n====================\n*/\n\n/**\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr[title] {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/**\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n2. Correct the odd 'em' font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family:\n\t\tui-monospace,\n\t\tSFMono-Regular,\n\t\tConsolas,\n\t\t'Liberation Mono',\n\t\tMenlo,\n\t\tmonospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/**\nPrevent 'sub' and 'sup' elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\nTabular data\n============\n*/\n\n/**\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n}\n\n/*\nForms\n=====\n*/\n\n/**\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\nRemove the inheritance of text transform in Edge and Firefox.\n1. Remove the inheritance of text transform in Firefox.\n*/\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\nCorrect the inability to style clickable types in iOS and Safari.\n*/\n\nbutton,\n[type='button'],\n[type='reset'] {\n -webkit-appearance: button;\n}\n\n/**\nRemove the inner border and padding in Firefox.\n*/\n\n/**\nRestore the focus styles unset by the previous rule.\n*/\n\n/**\nRemove the additional ':invalid' styles in Firefox.\nSee: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737\n*/\n\n/**\nRemove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.\n*/\n\nlegend {\n padding: 0;\n}\n\n/**\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n/**\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n/**\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to 'inherit' in Safari.\n*/\n\n/*\nInteractive\n===========\n*/\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/**\n * Manually forked from SUIT CSS Base: https://github.com/suitcss/base\n * A thin layer on top of normalize.css that provides a starting point more\n * suitable for web applications.\n */\n\n/**\n * Removes the default spacing and border for appropriate elements.\n */\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nbutton {\n background-color: transparent;\n background-image: none;\n}\n\n/**\n * Work around a Firefox/IE bug where the transparent `button` background\n * results in a loss of the default `button` focus styles.\n */\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/**\n * Tailwind custom reset styles\n */\n\n/**\n * 1. Use the user's configured `sans` font-family (with Tailwind's default\n * sans-serif font stack as a fallback) as a sane default.\n * 2. Use Tailwind's default \"normal\" line-height so the user isn't forced\n * to override it to ensure consistency even when using the default theme.\n */\n\nhtml {\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 1 */\n line-height: 1.5; /* 2 */\n}\n\n/**\n * Inherit font-family and line-height from `html` so users can set them as\n * a class directly on the `html` element.\n */\n\nbody {\n font-family: inherit;\n line-height: inherit;\n}\n\n/**\n * 1. Prevent padding and border from affecting element width.\n *\n * We used to set this in the html element and inherit from\n * the parent element for everything else. This caused issues\n * in shadow-dom-enhanced elements like <details> where the content\n * is wrapped by a div with box-sizing set to `content-box`.\n *\n * https://github.com/mozdevs/cssremedy/issues/4\n *\n *\n * 2. Allow adding a border to an element by just adding a border-width.\n *\n * By default, the way the browser specifies that an element should have no\n * border is by setting it's border-style to `none` in the user-agent\n * stylesheet.\n *\n * In order to easily add borders to elements by just setting the `border-width`\n * property, we change the default border-style for all elements to `solid`, and\n * use border-width to hide them instead. This way our `border` utilities only\n * need to set the `border-width` property instead of the entire `border`\n * shorthand, making our border utilities much more straightforward to compose.\n *\n * https://github.com/tailwindcss/tailwindcss/pull/116\n */\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n/*\n * Ensure horizontal rules are visible by default\n */\n\nhr {\n border-top-width: 1px;\n}\n\n/**\n * Undo the `border-style: none` reset that Normalize applies to images so that\n * our `border-{width}` utilities have the expected effect.\n *\n * The Normalize reset is unnecessary for us since we default the border-width\n * to 0 on all elements.\n *\n * https://github.com/tailwindcss/tailwindcss/issues/362\n */\n\nimg {\n border-style: solid;\n}\n\ntextarea {\n resize: vertical;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #9ca3af;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #9ca3af;\n}\n\ninput::placeholder,\ntextarea::placeholder {\n color: #9ca3af;\n}\n\nbutton {\n cursor: pointer;\n}\n\ntable {\n border-collapse: collapse;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/**\n * Reset links to optimize for opt-in styling instead of\n * opt-out.\n */\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/**\n * Reset form element properties that are easy to forget to\n * style explicitly so you don't inadvertently introduce\n * styles that deviate from your design system. These styles\n * supplement a partial reset that is already applied by\n * normalize.css.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n}\n\n/**\n * Use the configured 'mono' font family for elements that\n * are expected to be rendered with a monospace font, falling\n * back to the system monospace stack if there is no configured\n * 'mono' font family.\n */\n\npre,\ncode,\nkbd,\nsamp {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n\n/**\n * Make replaced elements `display: block` by default as that's\n * the behavior you want almost all of the time. Inspired by\n * CSS Remedy, with `svg` added as well.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n vertical-align: middle;\n}\n\n/**\n * Constrain images and videos to the parent width and preserve\n * their instrinsic aspect ratio.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n\n.bg-gray-800 {\n --tw-bg-opacity: 1;\n background-color: rgba(31, 41, 55, var(--tw-bg-opacity));\n}\n\n.border {\n border-width: 1px;\n}\n\n.flex {\n display: flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.hidden {\n display: none;\n}\n\n.flex-row {\n flex-direction: row;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.flex-shrink {\n flex-shrink: 1;\n}\n\n.list-disc {\n list-style-type: disc;\n}\n\n.absolute {\n position: absolute;\n}\n\n.resize {\n resize: both;\n}\n\n* {\n --tw-shadow: 0 0 #0000;\n}\n\n* {\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgba(59, 130, 246, 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n}\n\n.table-auto {\n table-layout: auto;\n}\n\n.line-through {\n text-decoration: line-through;\n}\n\n.w-full {\n width: 100%;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.transition {\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n@-webkit-keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@-webkit-keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n\n@keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n\n@-webkit-keyframes pulse {\n 50% {\n opacity: .5;\n }\n}\n\n@keyframes pulse {\n 50% {\n opacity: .5;\n }\n}\n\n@-webkit-keyframes bounce {\n 0%, 100% {\n transform: translateY(-25%);\n -webkit-animation-timing-function: cubic-bezier(0.8,0,1,1);\n animation-timing-function: cubic-bezier(0.8,0,1,1);\n }\n\n 50% {\n transform: none;\n -webkit-animation-timing-function: cubic-bezier(0,0,0.2,1);\n animation-timing-function: cubic-bezier(0,0,0.2,1);\n }\n}\n\n@keyframes bounce {\n 0%, 100% {\n transform: translateY(-25%);\n -webkit-animation-timing-function: cubic-bezier(0.8,0,1,1);\n animation-timing-function: cubic-bezier(0.8,0,1,1);\n }\n\n 50% {\n transform: none;\n -webkit-animation-timing-function: cubic-bezier(0,0,0.2,1);\n animation-timing-function: cubic-bezier(0,0,0.2,1);\n }\n}\n\n:root {\n --bg-color: #131720;\n --text-color: #d9e1f2;\n --primary: hsl(255, 30%, 55%);\n --focus: hsl(210, 90%, 50%);\n --secondary: #42b983;\n --border-color: hsla(0, 0%, 100%, 0.2);\n --light-1: hsl(210, 30%, 40%);\n --light-2: hsl(255, 30%, 50%);\n --light-background: linear-gradient(to right, var(--light-1), var(--light-2));\n --shadow-1: hsla(236, 50%, 50%, 0.3);\n --shadow-2: hsla(236, 50%, 50%, 0.4);\n --hud-background: rgba(0, 0, 0, 0.4);\n --hud-text-color: var(--text-color);\n --notifications-bg: darkslateblue;\n --skills-text-background: rgba(0, 0, 0, 0.5);\n --skills-text-color: var(--text-color);\n --skills-level-background: rgba(0, 0, 0, 0.5);\n --skills-level-color: orange;\n --skills-xp-bar-height: 40px;\n --skill-check-name-color: orange;\n --skill-check-difficulty: orange;\n --skill-check-success: green;\n --skill-check-failed: red;\n --skill-check-color: orange;\n --dialog-choice-color: orange;\n --dialog-choice-hover-color: var(--text-color);\n --inventory-text-background: rgba(0, 0, 0, 0.5);\n --inventory-text-color: var(--text-color);\n --inventory-amount-background: rgba(0, 0, 0, 0.5);\n --inventory-amount-color: orange;\n --quest-title-color: yellow;\n --completed-quest-title-color: grey;\n --objective-in-progress-color: white;\n --objective-completed-color: grey;\n}\n\n.list-item {\n display: inline-block;\n margin-right: 10px;\n}\n\n.list-enter-active,\r\n.list-leave-active {\n transition: all 0.3s ease;\n}\n\n/* .list-move {\r\n transition: transform 0.3s ease;\r\n} */\n\n.list-enter-from,\r\n.list-leave-to {\n opacity: 0;\n transform: translateX(300px);\n}\n\n.notification-item {\n display: inline-block;\n margin-right: 10px;\n}\n\n.notification-enter-active,\r\n.notification-leave-active {\n transition: all 0.3s ease;\n}\n\n/* .notification-move {\r\n transition: transform 0.3s ease;\r\n} */\n\n.notification-enter-from,\r\n.notification-leave-to {\n opacity: 0;\n transform: translateY(-300px);\n}\n\n.fade-enter-active,\r\n.fade-leave-active {\n transition: opacity 0.3s ease;\n}\n\n.fade-enter-from,\r\n.fade-leave-to {\n opacity: 0;\n}\n\n.fade-in-enter-active {\n transition: opacity 0.1s ease;\n}\n\n.fade-in-enter-from {\n opacity: 0;\n}\n\nbody {\n padding: 0;\n margin: 0;\n font-family: Arial, sans-serif;\n background-color: black;\n}\n\n.select {\n background: var(--light-background);\n padding: 10px;\n}\n\n.option {\n background-color: var(--light-2);\n padding: 5px;\n color: var(--text-color);\n}\n\n.button {\n background: var(--light-background);\n color: var(--text-color);\n box-shadow: 0.4rem 0.4rem 2.4rem 0.2rem var(--shadow-1);\n border-radius: 100px;\n padding: 10px;\n font-weight: 800;\n font-size: 16px;\n margin: 10px;\n transition: 0.2s;\n}\n\n.button:focus,\r\n.button:hover {\n transform: translateY(-0.2rem);\n box-shadow: 0 0 2.4rem 0.2rem var(--shadow-2);\n}\n\n.input {\n background: var(--light-background);\n color: var(--text-color);\n box-shadow: 0.4rem 0.4rem 2.4rem 0.2rem var(--shadow-1);\n border-radius: 100px;\n padding: 10px;\n font-weight: 800;\n font-size: 16px;\n margin: 10px;\n transition: 0.2s;\n}\n\n.input:focus,\r\n.input:hover {\n transform: translateY(-0.2rem);\n box-shadow: 0 0 2.4rem 0.2rem var(--shadow-2);\n}\n\na {\n color: pink;\n text-decoration: underline;\n}\n\nth,\r\ntd {\n padding: 4px;\n border: 1px solid var(--text-color);\n text-align: center;\n}\n\n#game-holder {\n width: 100vw;\n height: 100vh;\n padding: 0;\n margin: 0;\n top: 0;\n left: 0;\n background-color: black;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: -webkit-fill-available;\n}\n\n.title {\n font-size: 30px;\n font-weight: 700;\n text-align: center;\n}\n\n.container {\n padding: 20px;\n}\n\nh1,\r\nh2,\r\nh3,\r\nh4 {\n font-weight: 700;\n}\n\nh1 {\n font-size: 30px;\n}\n\nh2 {\n font-size: 26px;\n}\n\nh3 {\n font-size: 24px;\n}\n\nhr.solid {\n border: 1px solid var(--text-color);\n margin-top: 30px;\n margin-bottom: 30px;\n}\n\n.card-1 {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n.card-1:hover {\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n}\n\n.card-2 {\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);\n}\n\n.card-3 {\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);\n}\n\n.card-4 {\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n}\n\n.card-5 {\n box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);\n}\n\n.dialog-choice {\n transition: 0.2s;\n}\n\n.dialog-choice:hover {\n transform: scale(1.05, 1.05);\n transform-origin: center;\n}\n\n/* Somewhat arcane CSS to force the hover color to override the child style.\r\nOtherwise hovering choices doesn't change the color of skill check prompts. */\n\n.dialog-choice:not(:hover) > .skill-check-name,\r\n.passive-skill-check > .skill-check-name {\n color: var(--skill-check-name-color);\n}\n\n.dialog-choice:not(:hover) > .skill-check-difficulty,\r\n.passive-skill-check > .skill-check-difficulty {\n color: var(--skill-check-difficulty);\n}\n\n.skill-check-difficulty {\n font-weight: 700;\n}\n\n.dialog-choice:not(:hover) > .skill-check-success,\r\n.passive-skill-check > .skill-check-success {\n color: var(--skill-check-success);\n}\n\n.dialog-choice:not(:hover) > .skill-check-failed,\r\n.passive-skill-check > .skill-check-failed {\n color: var(--skill-check-failed);\n}\n\n.dialog-choice:not(:hover) > .skill-check,\r\n.passive-skill-check.skill-check {\n color: var(--skill-check-color);\n}\n\n.narrat-canvas {\n position: absolute;\n height: 100%;\n top: 0;\n left: 0;\n}\n\n/* Looks ugly */\n\n/* @keyframes strike-anim {\r\n 0% {\r\n width: 0;\r\n }\r\n 100% {\r\n width: 100%;\r\n }\r\n}\r\n.strike-anim {\r\n position: relative;\r\n}\r\n.strike-anim::after {\r\n content: ' ';\r\n position: absolute;\r\n top: 50%;\r\n left: 0;\r\n width: 100%;\r\n height: 1px;\r\n background: var(--text-color);\r\n animation-name: strike-anim;\r\n animation-duration: 0.5s;\r\n animation-timing-function: linear;\r\n animation-iteration-count: 1;\r\n animation-fill-mode: forwards;\r\n} */\n\n#touchTrigger {\n pointer-events: none;\n}\n\n@media (min-width: 640px) {\n}\n\n@media (min-width: 768px) {\n}\n\n@media (min-width: 1024px) {\n}\n\n@media (min-width: 1280px) {\n}\n\n@media (min-width: 1536px) {\n}\r\n";
34
34
  styleInject(css_248z);
35
35
 
36
36
  const f=ref([]),v=ref(null),m=ref(null),g=ref(null),h=reactive({current:""}),y=[],b=ref(!1),k=readonly(f),w=readonly(v),M=readonly(m),q=readonly(g),x=readonly(h),$=(e=w.value)=>{h.current=e;const t=k.value.findIndex((t=>t.name===e)),n=k.value.map((e=>e.name));for(let a=0;a<n.length;a++){if(a>0&&a<n.length-1){const e=n[a]+"Minus",r=n[a]+"Plus";h[e]=t<=a,h[r]=t>=a;}h[n[a]]=n[a]===e;}},V=(e=M.value)=>{h.orientation=e,h.isLandscape="landscape"===e,h.isPortrait="portrait"===e;},O=(e=q.value||"light")=>{h.theme=e,h.isDark="dark"===e,h.isLight="light"===e;};function j(e,t){if("undefined"==typeof window||!window.matchMedia)return !1;if("undefined"!=typeof window&&!window.matchMedia)return console.error("Vue3 Mq: No MatchMedia support detected in this browser. Responsive breakpoints not available."),!1;{b.value=!0;const n=window.matchMedia(e),a=({matches:e})=>{e&&t();};y.push({mql:n,cb:a});n.addEventListener&&"function"==typeof n.addEventListener?n.addEventListener("change",a):n.addListener(a),a(n);}}var L=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",bootstrap5:{xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},bootstrap4:{xs:0,sm:576,md:768,lg:992,xl:1200},bootstrap3:{xs:0,sm:768,md:992,lg:1200},vuetify:{xs:0,sm:600,md:960,lg:1264,xl:1904},tailwind:{xs:0,sm:640,md:768,lg:1024,xl:1280,xxl:1536},devices:{phone:0,tablet:768,laptop:1370,desktop:1906}});const T=e=>{if(!e||"object"!=typeof e)return !1;const t=[];for(let n in e){const a=parseFloat(e[n]);n&&"string"==typeof n?/^[^a-z]/i.test(n)||/[^a-zA-Z0-9_]/.test(n)?console.warn(`Vue3 Mq: "${n}" is an invalid breakpoint key. Breakpoint keys must start with a letter and contain only alphanumeric characters and underscores. Skipping.`):!a&&0!==a||isNaN(a)||a<0?console.warn(`Vue3 Mq: "${n}: ${e[n]}" is not a valid breakpoint. Breakpoints should be a number of zero or above. Skipping.`):t.push({name:n,min:a}):console.warn(`Vue3 Mq: Invalid or missing breakpoint key (${JSON.stringify(n)}). Skipping.`);}t.some((e=>0===e.min))||console.warn("Vue3 Mq: You have not declared a breakpoint with a minimum value of 0. There may be screen sizes to which Vue3Mq does not respond.");return new Set(t.map((e=>e.min))).size<t.length&&console.warn("Vue3 Mq: Your breakpoint configuration contains duplicate values. Behaviour may be unpredictable."),0!==t.length&&t.sort(((e,t)=>e.min-t.min))};function R({breakpoints:e,preset:t}){const n=(e=>{if("string"==typeof e&&L[e])return L[e];{const t=Object.keys(L);return console.error(`Vue3 Mq: "${e}" is not a valid preset. Available options are: ${t.join(", ")}`),!1}})(t),a=T(e);if(!1===n&&!a)throw new TypeError("Vue3 Mq: You must provide a valid preset, or valid breakpoint settings.");var r;r=a||T(n),f.value=r,function(){for(;y.length>0;){const e=y.shift();if(e&&"object"==typeof e){const{mql:t,cb:n}=e;t.addEventListener&&"function"==typeof t.addEventListener?t.removeEventListener("change",n):t.removeListener(n);}}}(),(()=>{const e=Object.keys(h);for(let t of e)delete h[t];$(),V(),O();})();const o=k.value.reduce(((e,t,n,a)=>{const r=`(min-width: ${t.min}px)`,o=n<a.length-1?`(max-width: ${a[n+1].min-1}px)`:null,i=r+(o?" and "+o:"");return Object.assign(e,{[t.name]:i})}),{});for(const i in o){j(o[i],(()=>{$(i);}));}["portrait","landscape"].forEach((e=>{j(`(orientation: ${e})`,(()=>{V(e);}));})),["light","dark"].forEach((e=>{j(`(prefers-color-scheme: ${e})`,(()=>{O(e);}));}));}var N={install:(e,{preset:t="bootstrap5",breakpoints:n,defaultBreakpoint:a,defaultOrientation:r="landscape",defaultTheme:o}={})=>{try{const l=!1===["landscape","portrait"].includes(s=r)?(console.error(`Vue3 Mq: "${s}" is not a valid default orientation. Reverting to unset value.`),null):s,u=((e=null)=>!1===["dark","light"].includes(e)&&null!==e?(console.error(`Vue3 Mq: "${e}" is not a valid default theme. Reverting to unset value.`),null):e)(o);i=a,v.value=i,(e=>{m.value=e;})(l),(e=>{g.value=e;})(u),e.provide("mq",x),e.provide("updateBreakpoints",R),R({breakpoints:n,preset:t});}catch(l){console.error(l);}var i,s;}};
@@ -97,6 +97,8 @@ const defaultConfig = {
97
97
  timeOnScreen: 3,
98
98
  },
99
99
  hudStats: {},
100
+ items: {},
101
+ quests: {},
100
102
  };
101
103
 
102
104
  function parserError(ctx, line, text) {
@@ -123,6 +125,19 @@ function getSkillConfig(id) {
123
125
  error(`Skill config for skill ${id} doesn't exist`);
124
126
  }
125
127
  return skill;
128
+ }
129
+ function getItemConfig(id) {
130
+ const item = config.items[id];
131
+ if (!item) {
132
+ error(`Item config for skill ${id} doesn't exist`);
133
+ }
134
+ return item;
135
+ }
136
+ function getQuestConfig(questId) {
137
+ return config.quests[questId];
138
+ }
139
+ function getObjectiveConfig(quest, objectiveId) {
140
+ return getQuestConfig(quest).objectives[objectiveId];
126
141
  }
127
142
 
128
143
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -3417,6 +3432,9 @@ const useAudio = defineStore('audio', {
3417
3432
  loadSaveData(data) {
3418
3433
  this.currentMusic = data.currentMusic;
3419
3434
  },
3435
+ reset() {
3436
+ this.stopMusic();
3437
+ },
3420
3438
  },
3421
3439
  });
3422
3440
 
@@ -3542,29 +3560,178 @@ function randomId() {
3542
3560
  return `${Date.now() - Math.floor(Math.random() * 99999999)}`;
3543
3561
  }
3544
3562
 
3545
- // Create a pinia store named dialog with a state using the type DialogState, with actions addDialog and clearDialog
3546
- const useDialogStore = defineStore('dialog', {
3563
+ // Generate a pinia store named notifications with a state using the type NotificationsState, and save type NotificationsSave, with actions:
3564
+ // addNotification(text: string): Adds a new notification to the state, and deletes it after a timeout
3565
+ // deleteNotification(id: string): Deletes a notification from the state
3566
+ const useNotifications = defineStore('notifications', {
3567
+ state: () => ({ notifications: {} }),
3568
+ actions: {
3569
+ async addNotification(text) {
3570
+ const id = `${Date.now()}-${Math.random() * 10000}`;
3571
+ this.notifications[id] = {
3572
+ text,
3573
+ };
3574
+ if (getConfig().notifications.alsoPrintInDialogue) {
3575
+ writeText(`[NOTIFICATION] ${text}`);
3576
+ }
3577
+ await timeout(getConfig().notifications.timeOnScreen * 1000);
3578
+ this.deleteNotification(id);
3579
+ },
3580
+ deleteNotification(id) {
3581
+ delete this.notifications[id];
3582
+ },
3583
+ },
3584
+ });
3585
+
3586
+ // create a pinia store named inventory with a state containing items and actions to add and delete items
3587
+ // create a pinia store named inventory with a state of type ItemState and actions to add and delete items. Adding items should increase the amount of any existing item that matches the id.
3588
+ const useInventory = defineStore('inventory', {
3547
3589
  state: () => ({
3548
- dialog: [],
3590
+ items: {},
3549
3591
  }),
3550
3592
  actions: {
3551
3593
  generateSaveData() {
3552
3594
  return {
3553
- dialog: this.dialog,
3595
+ items: this.items,
3554
3596
  };
3555
3597
  },
3556
- loadSaveData(data) {
3557
- this.dialog = data.dialog;
3598
+ loadSaveData(save) {
3599
+ this.items = { ...this.items, ...save.items };
3558
3600
  },
3559
- addDialog(dialog) {
3560
- this.dialog.push({
3561
- ...dialog,
3562
- interactive: dialog.interactive ?? false,
3563
- id: randomId(),
3601
+ setupItems(items) {
3602
+ Object.keys(items).forEach((key) => {
3603
+ this.items[key] = {
3604
+ amount: 0,
3605
+ id: key,
3606
+ };
3564
3607
  });
3565
3608
  },
3566
- clearDialog() {
3567
- this.dialog.splice(0, this.dialog.length);
3609
+ getExistingItem(id) {
3610
+ return this.items[id];
3611
+ },
3612
+ getItemAmount(id) {
3613
+ return this.getExistingItem(id)?.amount || 0;
3614
+ },
3615
+ add(item) {
3616
+ const existingItem = this.getExistingItem(item.id);
3617
+ if (existingItem) {
3618
+ existingItem.amount += item.amount;
3619
+ }
3620
+ else {
3621
+ this.items[item.id] = { ...item };
3622
+ }
3623
+ useNotifications().addNotification(`Received item: ${getItemConfig(item.id).name} x ${item.amount}`);
3624
+ },
3625
+ remove(item) {
3626
+ const existingItem = this.getExistingItem(item.id);
3627
+ if (existingItem) {
3628
+ existingItem.amount -= item.amount;
3629
+ useNotifications().addNotification(`Lost item: ${getItemConfig(item.id).name} x ${item.amount}`);
3630
+ if (existingItem.amount <= 0) {
3631
+ this.deleteItem(item.id);
3632
+ }
3633
+ }
3634
+ },
3635
+ deleteItem(id) {
3636
+ const existingItem = this.getExistingItem(id);
3637
+ if (existingItem) {
3638
+ this.items[id].amount = 0;
3639
+ }
3640
+ },
3641
+ },
3642
+ });
3643
+
3644
+ const everyObject = (object, predicate) => {
3645
+ for (const key in object) {
3646
+ if (!predicate(object[key])) {
3647
+ return false;
3648
+ }
3649
+ }
3650
+ return true;
3651
+ };
3652
+ const filterObject = (object, predicate) => {
3653
+ const result = {};
3654
+ for (const key in object) {
3655
+ if (predicate(object[key])) {
3656
+ result[key] = object[key];
3657
+ }
3658
+ }
3659
+ return result;
3660
+ };
3661
+
3662
+ const useQuests = defineStore('quests', {
3663
+ state: () => ({
3664
+ quests: {},
3665
+ }),
3666
+ actions: {
3667
+ getQuest(questId) {
3668
+ const quest = this.quests[questId];
3669
+ if (quest) {
3670
+ return quest;
3671
+ }
3672
+ error(`Quest ${questId} doesn't exist!`);
3673
+ },
3674
+ getObjective(quest, objectiveId) {
3675
+ const questObjective = this.getQuest(quest).objectives[objectiveId];
3676
+ if (questObjective) {
3677
+ return questObjective;
3678
+ }
3679
+ error(`Objective ${objectiveId} doesn't exist in quest ${quest}!`);
3680
+ },
3681
+ setupQuests(quests) {
3682
+ // iterate through quests to generate quest states to add to this.quests object
3683
+ for (const key of Object.keys(quests)) {
3684
+ const data = quests[key];
3685
+ this.quests[key] = {
3686
+ id: key,
3687
+ state: 'hidden',
3688
+ objectives: {},
3689
+ };
3690
+ // iterate through data.objectives to populate the objectives array of this.quests[key]
3691
+ for (const objectiveKey of Object.keys(data.objectives)) {
3692
+ const objective = data.objectives[objectiveKey];
3693
+ this.quests[key].objectives[objectiveKey] = {
3694
+ id: objectiveKey,
3695
+ state: objective.hidden ? 'hidden' : 'unlocked',
3696
+ };
3697
+ }
3698
+ }
3699
+ },
3700
+ startQuest(questId) {
3701
+ this.getQuest(questId).state = 'unlocked';
3702
+ useNotifications().addNotification(`Started quest: ${getQuestConfig(questId).title}`);
3703
+ },
3704
+ startObjective(questId, objectiveId) {
3705
+ this.getObjective(questId, objectiveId).state = 'unlocked';
3706
+ useNotifications().addNotification(`New quest objective: ${getObjectiveConfig(questId, objectiveId).description}`);
3707
+ },
3708
+ completeObjective(questId, objectiveId) {
3709
+ this.getObjective(questId, objectiveId).state = 'completed';
3710
+ useNotifications().addNotification(`Objective completed!`);
3711
+ },
3712
+ completeQuest(questId, ending) {
3713
+ this.getQuest(questId).state = 'completed';
3714
+ if (ending) {
3715
+ this.getQuest(questId).ending = ending;
3716
+ }
3717
+ useNotifications().addNotification(`Quest completed: ${getQuestConfig(questId).title}`);
3718
+ },
3719
+ isQuestCompleted(questId) {
3720
+ const quest = this.getQuest(questId);
3721
+ return everyObject(quest.objectives, (objective) => objective.state === 'completed');
3722
+ },
3723
+ removeQuest(id) {
3724
+ delete this.quests[id];
3725
+ },
3726
+ generateSaveData() {
3727
+ return {
3728
+ quests: {
3729
+ ...this.quests,
3730
+ },
3731
+ };
3732
+ },
3733
+ loadSaveData(data) {
3734
+ this.quests = data.quests;
3568
3735
  },
3569
3736
  },
3570
3737
  });
@@ -3701,64 +3868,6 @@ var deepmerge_1 = deepmerge;
3701
3868
 
3702
3869
  var cjs = deepmerge_1;
3703
3870
 
3704
- // Create a pinia store named hud with a state using the type HudState, and save type HudSave, with actions:
3705
- // setupHudStats(stats: { [key: string]: HudStatConfig }): Iterates the stats argument to add new stats to the state
3706
- // setStat(stat: string, value: number): Sets the value of a stat
3707
- // addStat(stat: string, value: number): Adds a value to a stat
3708
- // generateSaveData(): Function that generates a HudSave object from the data in the state
3709
- // loadSaveData(data: HudSave): Function that loads the data into the state
3710
- const useHud = defineStore('hud', {
3711
- state: () => ({
3712
- hudStats: {},
3713
- }),
3714
- actions: {
3715
- setupHudStats(stats) {
3716
- for (const stat in stats) {
3717
- this.hudStats[stat] = {
3718
- value: stats[stat].startingValue,
3719
- };
3720
- }
3721
- },
3722
- setStat(stat, value) {
3723
- this.hudStats[stat].value = value;
3724
- },
3725
- addStat(stat, value) {
3726
- this.hudStats[stat].value += value;
3727
- },
3728
- generateSaveData() {
3729
- return {
3730
- hudStats: this.hudStats,
3731
- };
3732
- },
3733
- loadSaveData(data) {
3734
- this.hudStats = cjs(this.hudStats, data.hudStats);
3735
- },
3736
- },
3737
- });
3738
-
3739
- // Generate a pinia store named notifications with a state using the type NotificationsState, and save type NotificationsSave, with actions:
3740
- // addNotification(text: string): Adds a new notification to the state, and deletes it after a timeout
3741
- // deleteNotification(id: string): Deletes a notification from the state
3742
- const useNotifications = defineStore('notifications', {
3743
- state: () => ({ notifications: {} }),
3744
- actions: {
3745
- async addNotification(text) {
3746
- const id = `${Date.now()}-${Math.random() * 10000}`;
3747
- this.notifications[id] = {
3748
- text,
3749
- };
3750
- if (getConfig().notifications.alsoPrintInDialogue) {
3751
- writeText(`[NOTIFICATION] ${text}`);
3752
- }
3753
- await timeout(getConfig().notifications.timeOnScreen * 1000);
3754
- this.deleteNotification(id);
3755
- },
3756
- deleteNotification(id) {
3757
- delete this.notifications[id];
3758
- },
3759
- },
3760
- });
3761
-
3762
3871
  // Create a pinia store named skills with a state using the type Skills, with actions:
3763
3872
  // setupSkillCheck(skillCheck: SkillCheckState, id: string)
3764
3873
  // passSkillCheck(skillCheckId: string)
@@ -3806,6 +3915,9 @@ const useSkills = defineStore('skills', {
3806
3915
  },
3807
3916
  addXp(skill, xp) {
3808
3917
  const skillData = this.skills[skill];
3918
+ if (!skillData) {
3919
+ error(`Skill ${skill} doesn't exist`);
3920
+ }
3809
3921
  skillData.xp += xp;
3810
3922
  if (skillData.xp >= getConfig().skillOptions.xpPerLevel) {
3811
3923
  skillData.xp = 0;
@@ -3913,10 +4025,13 @@ function getModifiableDataPinia() {
3913
4025
  const vm = useVM();
3914
4026
  const skills = useSkills();
3915
4027
  const screens = useScreens();
4028
+ const inventory = useInventory();
3916
4029
  return {
3917
4030
  data: vm.data,
3918
4031
  skills: skills.skills,
3919
4032
  buttons: screens.buttons,
4033
+ items: inventory.items,
4034
+ quests: useQuests().quests,
3920
4035
  };
3921
4036
  }
3922
4037
 
@@ -4134,6 +4249,7 @@ const useVM = defineStore('vm', {
4134
4249
  data: {},
4135
4250
  lastLabel: 'main',
4136
4251
  script: {},
4252
+ labelStack: ['main'],
4137
4253
  }),
4138
4254
  actions: {
4139
4255
  generateSaveData() {
@@ -4250,6 +4366,19 @@ const useVM = defineStore('vm', {
4250
4366
  const cmd = this.currentLine;
4251
4367
  await runCommand(cmd);
4252
4368
  },
4369
+ async runLabelFunction(label) {
4370
+ const branch = this.script[label];
4371
+ if (!branch) {
4372
+ console.error(`Label ${branch} doesn't exist`);
4373
+ }
4374
+ const stack = {
4375
+ currentIndex: 0,
4376
+ branch: branch,
4377
+ label,
4378
+ };
4379
+ this.addStack(stack);
4380
+ await this.runLine();
4381
+ },
4253
4382
  runLabel(label) {
4254
4383
  const branch = this.script[label];
4255
4384
  if (!branch) {
@@ -4278,6 +4407,88 @@ const useVM = defineStore('vm', {
4278
4407
  },
4279
4408
  });
4280
4409
 
4410
+ function processText(text) {
4411
+ const vmStore = useVM();
4412
+ const skillStore = useSkills();
4413
+ return text.replace(/%{[^}]*}/g, (match) => {
4414
+ const key = match.substr(2, match.length - 3);
4415
+ const searchableState = {
4416
+ data: vmStore.data,
4417
+ skills: skillStore.skills,
4418
+ items: useInventory().items,
4419
+ quests: useQuests().quests,
4420
+ };
4421
+ const [obj, newKey] = findDataHelper(searchableState, key);
4422
+ return obj[newKey];
4423
+ });
4424
+ }
4425
+
4426
+ // Create a pinia store named dialog with a state using the type DialogState, with actions addDialog and clearDialog
4427
+ const useDialogStore = defineStore('dialog', {
4428
+ state: () => ({
4429
+ dialog: [],
4430
+ }),
4431
+ actions: {
4432
+ generateSaveData() {
4433
+ return {
4434
+ dialog: this.dialog,
4435
+ };
4436
+ },
4437
+ loadSaveData(data) {
4438
+ this.dialog = data.dialog;
4439
+ },
4440
+ addDialog(dialog) {
4441
+ this.dialog.push({
4442
+ ...dialog,
4443
+ interactive: dialog.interactive ?? false,
4444
+ id: randomId(),
4445
+ text: processText(dialog.text),
4446
+ });
4447
+ },
4448
+ clearDialog() {
4449
+ this.dialog.splice(0, this.dialog.length);
4450
+ },
4451
+ reset() {
4452
+ this.dialog = [];
4453
+ },
4454
+ },
4455
+ });
4456
+
4457
+ // Create a pinia store named hud with a state using the type HudState, and save type HudSave, with actions:
4458
+ // setupHudStats(stats: { [key: string]: HudStatConfig }): Iterates the stats argument to add new stats to the state
4459
+ // setStat(stat: string, value: number): Sets the value of a stat
4460
+ // addStat(stat: string, value: number): Adds a value to a stat
4461
+ // generateSaveData(): Function that generates a HudSave object from the data in the state
4462
+ // loadSaveData(data: HudSave): Function that loads the data into the state
4463
+ const useHud = defineStore('hud', {
4464
+ state: () => ({
4465
+ hudStats: {},
4466
+ }),
4467
+ actions: {
4468
+ setupHudStats(stats) {
4469
+ for (const stat in stats) {
4470
+ this.hudStats[stat] = {
4471
+ value: stats[stat].startingValue,
4472
+ };
4473
+ }
4474
+ },
4475
+ setStat(stat, value) {
4476
+ this.hudStats[stat].value = value;
4477
+ },
4478
+ addStat(stat, value) {
4479
+ this.hudStats[stat].value += value;
4480
+ },
4481
+ generateSaveData() {
4482
+ return {
4483
+ hudStats: this.hudStats,
4484
+ };
4485
+ },
4486
+ loadSaveData(data) {
4487
+ this.hudStats = cjs(this.hudStats, data.hudStats);
4488
+ },
4489
+ },
4490
+ });
4491
+
4281
4492
  function createSkillCheckState() {
4282
4493
  const skillCheck = {
4283
4494
  passed: false,
@@ -4424,11 +4635,16 @@ function runCondition(condition) {
4424
4635
  function conditionFunction(condition) {
4425
4636
  const skillStore = useSkills();
4426
4637
  const vm = useVM();
4638
+ const inventory = useInventory();
4427
4639
  const context = {
4428
4640
  data: vm.data,
4429
4641
  skills: skillStore.skills,
4430
4642
  skillChecks: skillStore.skillChecks,
4431
4643
  stats: useHud().hudStats,
4644
+ items: inventory.items,
4645
+ itemAmount: (id) => {
4646
+ return useInventory().getItemAmount(id);
4647
+ },
4432
4648
  roll: (checkId, skill, value) => {
4433
4649
  const skillCheckState = getSkillCheckState(checkId);
4434
4650
  if (skillCheckState) {
@@ -4633,6 +4849,10 @@ const useMain = defineStore('main', {
4633
4849
  skillsStore.setupSkills(config.skills);
4634
4850
  const hudStore = useHud();
4635
4851
  hudStore.setupHudStats(config.hudStats);
4852
+ const inventoryStore = useInventory();
4853
+ inventoryStore.setupItems(config.items);
4854
+ const questsStore = useQuests();
4855
+ questsStore.setupQuests(config.quests);
4636
4856
  },
4637
4857
  startMachine() {
4638
4858
  const vmStore = useVM();
@@ -4705,11 +4925,13 @@ const useMain = defineStore('main', {
4705
4925
  },
4706
4926
  reset() {
4707
4927
  this.ready = false;
4708
- this.playing = false;
4709
4928
  this.errors = [];
4710
- this.flowState = 'menu';
4711
4929
  this.modal = false;
4712
4930
  this.paused = false;
4931
+ useVM().reset();
4932
+ useAudio().reset();
4933
+ this.playing = false;
4934
+ this.ready = true;
4713
4935
  },
4714
4936
  generateSaveData() {
4715
4937
  return {
@@ -4727,6 +4949,7 @@ const useMain = defineStore('main', {
4727
4949
  const mainStore = useMain();
4728
4950
  const hudStore = useHud();
4729
4951
  const audioStore = useAudio();
4952
+ const inventoryStore = useInventory();
4730
4953
  const save = {
4731
4954
  version: '1.0.0',
4732
4955
  screen: screensStore.generateSaveData(),
@@ -4736,6 +4959,8 @@ const useMain = defineStore('main', {
4736
4959
  main: mainStore.generateSaveData(),
4737
4960
  hud: hudStore.generateSaveData(),
4738
4961
  audio: audioStore.generateSaveData(),
4962
+ inventory: inventoryStore.generateSaveData(),
4963
+ quests: useQuests().generateSaveData(),
4739
4964
  };
4740
4965
  localStorage.setItem(SAVE_FILE, JSON.stringify(save));
4741
4966
  },
@@ -4747,6 +4972,7 @@ const useMain = defineStore('main', {
4747
4972
  const mainStore = useMain();
4748
4973
  const hudStore = useHud();
4749
4974
  const audioStore = useAudio();
4975
+ const inventoryStore = useInventory();
4750
4976
  screensStore.loadSaveData(save.screen);
4751
4977
  skillsStore.loadSaveData(save.skills);
4752
4978
  dialogStore.loadSaveData(save.dialog);
@@ -4754,6 +4980,8 @@ const useMain = defineStore('main', {
4754
4980
  mainStore.loadSaveData(save.main);
4755
4981
  hudStore.loadSaveData(save.hud);
4756
4982
  audioStore.loadSaveData(save.audio);
4983
+ inventoryStore.loadSaveData(save.inventory);
4984
+ useQuests().loadSaveData(save.quests);
4757
4985
  },
4758
4986
  getAllStates() {
4759
4987
  return {
@@ -4766,6 +4994,8 @@ const useMain = defineStore('main', {
4766
4994
  audio: useAudio(),
4767
4995
  rendering: useRenderingStore(),
4768
4996
  notifications: useNotifications(),
4997
+ inventory: useInventory(),
4998
+ quests: useQuests(),
4769
4999
  };
4770
5000
  },
4771
5001
  overrideStates(override) {
@@ -7513,7 +7743,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
7513
7743
  class: "notification",
7514
7744
  key: id
7515
7745
  }, [
7516
- createElementVNode("h2", null, toDisplayString(notification.text), 1)
7746
+ createElementVNode("h3", null, toDisplayString(notification.text), 1)
7517
7747
  ]))
7518
7748
  }), 128))
7519
7749
  ]),
@@ -7521,25 +7751,11 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
7521
7751
  }))
7522
7752
  }
7523
7753
 
7524
- var css_248z$8 = ".notifications-holder {\n position: fixed;\n top: 0;\n left: 0;\n padding: 10px;\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n pointer-events: none;\n}\n\n.notification {\n margin-top: 10px;\n margin-bottom: 10px;\n border-radius: 10px;\n padding: 15px;\n background: var(--notifications-bg);\n width: 40vh;\n text-align: center;\n}\r\n";
7754
+ var css_248z$8 = ".notifications-holder {\n position: fixed;\n top: 0;\n right: 0;\n padding: 10px;\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n pointer-events: none;\n}\n\n.notification {\n margin-top: 10px;\n margin-bottom: 10px;\n border-radius: 10px;\n padding: 15px;\n background: var(--notifications-bg);\n width: 40vh;\n text-align: center;\n}\r\n";
7525
7755
  styleInject(css_248z$8);
7526
7756
 
7527
7757
  script$7.render = render$7;
7528
7758
 
7529
- function processText(text) {
7530
- const vmStore = useVM();
7531
- const skillStore = useSkills();
7532
- return text.replace(/%{[^}]*}/g, (match) => {
7533
- const key = match.substr(2, match.length - 3);
7534
- const searchableState = {
7535
- data: vmStore.data,
7536
- skills: skillStore.skills,
7537
- };
7538
- const [obj, newKey] = findDataHelper(searchableState, key);
7539
- return obj[newKey];
7540
- });
7541
- }
7542
-
7543
7759
  function aspectRatioFit(screenWidth, screenHeight, gameWidth, gameHeight) {
7544
7760
  const widthRatio = screenWidth / gameWidth;
7545
7761
  const heightRatio = screenHeight / gameHeight;
@@ -7673,6 +7889,12 @@ var script$8 = defineComponent({
7673
7889
  openSkills() {
7674
7890
  useMain().openModal('skills');
7675
7891
  },
7892
+ openInventory() {
7893
+ useMain().openModal('inventory');
7894
+ },
7895
+ openQuests() {
7896
+ useMain().openModal('quests');
7897
+ },
7676
7898
  closeMenu() {
7677
7899
  useMain().closeModal();
7678
7900
  },
@@ -7687,6 +7909,18 @@ var script$8 = defineComponent({
7687
7909
  }
7688
7910
  return false;
7689
7911
  },
7912
+ showInventory() {
7913
+ if (Object.entries(getConfig().items).length > 0) {
7914
+ return true;
7915
+ }
7916
+ return false;
7917
+ },
7918
+ showQuests() {
7919
+ if (Object.entries(getConfig().quests).length > 0) {
7920
+ return true;
7921
+ }
7922
+ return false;
7923
+ },
7690
7924
  },
7691
7925
  });
7692
7926
 
@@ -7706,6 +7940,22 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
7706
7940
  id: "skills-menu-button",
7707
7941
  onClick: _cache[1] || (_cache[1] = (...args) => (_ctx.openSkills && _ctx.openSkills(...args)))
7708
7942
  }, " Skills "))
7943
+ : createCommentVNode("", true),
7944
+ (_ctx.showInventory)
7945
+ ? (openBlock(), createElementBlock("button", {
7946
+ key: 1,
7947
+ class: "button menu-toggle-button",
7948
+ id: "inventory-menu-button",
7949
+ onClick: _cache[2] || (_cache[2] = (...args) => (_ctx.openInventory && _ctx.openInventory(...args)))
7950
+ }, " Items "))
7951
+ : createCommentVNode("", true),
7952
+ (_ctx.showQuests)
7953
+ ? (openBlock(), createElementBlock("button", {
7954
+ key: 2,
7955
+ class: "button menu-toggle-button",
7956
+ id: "quests-menu-button",
7957
+ onClick: _cache[3] || (_cache[3] = (...args) => (_ctx.openQuests && _ctx.openQuests(...args)))
7958
+ }, " Quests "))
7709
7959
  : createCommentVNode("", true)
7710
7960
  ]))
7711
7961
  }
@@ -7929,11 +8179,284 @@ styleInject(css_248z$b);
7929
8179
  script$a.render = render$a;
7930
8180
 
7931
8181
  var script$b = defineComponent({
8182
+ setup() {
8183
+ const store = useInventory();
8184
+ const items = computed(() => store.items);
8185
+ return { items };
8186
+ },
8187
+ components: {
8188
+ Modal: script$2,
8189
+ },
8190
+ props: {
8191
+ close: (() => { }),
8192
+ },
8193
+ data() {
8194
+ return {
8195
+ chosenId: false,
8196
+ };
8197
+ },
8198
+ mounted() { },
8199
+ methods: {
8200
+ getItemStyle(item) {
8201
+ return {
8202
+ backgroundImage: `url(${this.itemConf[item].icon})`,
8203
+ };
8204
+ },
8205
+ getItemName(item) {
8206
+ return this.itemConf[item].name;
8207
+ },
8208
+ clickItem(item) {
8209
+ this.chosenId = item;
8210
+ },
8211
+ closeItem() {
8212
+ this.chosenId = false;
8213
+ },
8214
+ },
8215
+ computed: {
8216
+ itemsToDisplay() {
8217
+ const items = {};
8218
+ for (const key in this.items) {
8219
+ if (this.items[key].amount > 0) {
8220
+ items[key] = this.items[key];
8221
+ }
8222
+ }
8223
+ return items;
8224
+ },
8225
+ chosenItem() {
8226
+ if (this.chosenId) {
8227
+ return this.items[this.chosenId];
8228
+ }
8229
+ return null;
8230
+ },
8231
+ chosenItemConf() {
8232
+ if (this.chosenId) {
8233
+ return this.itemConf[this.chosenId];
8234
+ }
8235
+ return null;
8236
+ },
8237
+ itemConf() {
8238
+ return getConfig().items;
8239
+ },
8240
+ },
8241
+ });
8242
+
8243
+ const _hoisted_1$a = /*#__PURE__*/createElementVNode("h3", { class: "title" }, "Inventory", -1);
8244
+ const _hoisted_2$8 = { class: "menu-content" };
8245
+ const _hoisted_3$5 = {
8246
+ key: 0,
8247
+ class: "inventory-container"
8248
+ };
8249
+ const _hoisted_4$4 = ["onClick"];
8250
+ const _hoisted_5$4 = { class: "item-title" };
8251
+ const _hoisted_6$4 = { class: "item-amount" };
8252
+ const _hoisted_7$3 = {
8253
+ key: 1,
8254
+ class: "flex flex-row item-description-container"
8255
+ };
8256
+ const _hoisted_8$2 = { class: "flex item-left" };
8257
+ const _hoisted_9$2 = { class: "flex item-right" };
8258
+ const _hoisted_10$2 = /*#__PURE__*/createElementVNode("hr", { class: "hr-solid" }, null, -1);
8259
+ const _hoisted_11$2 = { key: 2 };
8260
+ const _hoisted_12$2 = /*#__PURE__*/createElementVNode("h2", null, "The inventory is empty!", -1);
8261
+ const _hoisted_13$1 = [
8262
+ _hoisted_12$2
8263
+ ];
8264
+
8265
+ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8266
+ const _component_modal = resolveComponent("modal");
8267
+
8268
+ return (openBlock(), createBlock(_component_modal, {
8269
+ class: "menu",
8270
+ onClose: _ctx.close,
8271
+ containerCssClass: "inventory-modal"
8272
+ }, {
8273
+ header: withCtx(() => [
8274
+ _hoisted_1$a
8275
+ ]),
8276
+ body: withCtx(() => [
8277
+ createElementVNode("div", _hoisted_2$8, [
8278
+ (!_ctx.chosenItem && Object.keys(_ctx.itemsToDisplay).length > 0)
8279
+ ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
8280
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.itemsToDisplay, (item) => {
8281
+ return (openBlock(), createElementBlock("button", {
8282
+ onClick: () => _ctx.clickItem(item.id),
8283
+ class: "item-display",
8284
+ style: normalizeStyle(_ctx.getItemStyle(item.id)),
8285
+ key: item.id
8286
+ }, [
8287
+ createElementVNode("h3", _hoisted_5$4, toDisplayString(_ctx.getItemName(item.id)), 1),
8288
+ createElementVNode("h3", _hoisted_6$4, toDisplayString(item.amount), 1)
8289
+ ], 12, _hoisted_4$4))
8290
+ }), 128))
8291
+ ]))
8292
+ : (typeof _ctx.chosenId === 'string')
8293
+ ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
8294
+ createElementVNode("div", _hoisted_8$2, [
8295
+ createElementVNode("button", {
8296
+ class: "button",
8297
+ onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.closeItem && _ctx.closeItem(...args)))
8298
+ }, "Back"),
8299
+ createElementVNode("div", {
8300
+ class: "item-display",
8301
+ style: normalizeStyle(_ctx.getItemStyle(_ctx.chosenId))
8302
+ }, null, 4)
8303
+ ]),
8304
+ createElementVNode("div", _hoisted_9$2, [
8305
+ createElementVNode("h2", null, toDisplayString(_ctx.getItemName(_ctx.chosenId)), 1),
8306
+ _hoisted_10$2,
8307
+ createElementVNode("h3", null, "Amount: " + toDisplayString(_ctx.chosenItem.amount), 1),
8308
+ createElementVNode("p", null, toDisplayString(_ctx.chosenItemConf.description), 1)
8309
+ ])
8310
+ ]))
8311
+ : (openBlock(), createElementBlock("div", _hoisted_11$2, _hoisted_13$1))
8312
+ ])
8313
+ ]),
8314
+ _: 1
8315
+ }, 8, ["onClose"]))
8316
+ }
8317
+
8318
+ var css_248z$c = ".inventory-modal {\n width: 800px;\n min-height: 50%;\n}\n\n.inventory-container {\n display: grid;\n grid-auto-rows: auto;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 20px 20px;\n}\n\n.item-display {\n width: 200px;\n height: 300px;\n position: relative;\n background-repeat: no-repeat;\n background-size: contain;\n}\n\n.item-title {\n position: absolute;\n bottom: 0px;\n text-align: center;\n width: 100%;\n color: var(--inventory-text-color);\n background: var(--inventory-text-background);\n}\n\n.item-amount {\n position: absolute;\n top: 0;\n right: 0;\n font-weight: 700;\n font-size: 25px;\n color: var(--inventory-amount-color);\n width: 40px;\n height: 40px;\n background-color: var(--inventory-amount-background);\n}\n\n.item-description-container {\n justify-content: space-between;\n align-items: center;\n}\n\n.item-left {\n flex-direction: column;\n}\n\n.item-right {\n flex-direction: column;\n align-items: baseline;\n}\r\n";
8319
+ styleInject(css_248z$c);
8320
+
8321
+ script$b.render = render$b;
8322
+
8323
+ var script$c = defineComponent({
8324
+ setup() {
8325
+ const questsStore = useQuests();
8326
+ const quests = computed(() => questsStore.quests);
8327
+ return { quests };
8328
+ },
8329
+ computed: {
8330
+ questsToDisplay() {
8331
+ return filterObject(this.quests, (quest) => quest.state !== 'hidden');
8332
+ },
8333
+ },
8334
+ props: {
8335
+ close: (() => { }),
8336
+ },
8337
+ methods: {
8338
+ getQuestData(questId) {
8339
+ return getQuestConfig(questId);
8340
+ },
8341
+ getObjectiveData(questId, objectiveId) {
8342
+ return getObjectiveConfig(questId, objectiveId);
8343
+ },
8344
+ getDisplayTextForQuestState(quest) {
8345
+ switch (quest.state) {
8346
+ case 'hidden':
8347
+ return ' Hidden';
8348
+ case 'unlocked':
8349
+ return '';
8350
+ case 'completed':
8351
+ return ' (Completed)';
8352
+ default:
8353
+ return ' Unknown';
8354
+ }
8355
+ },
8356
+ getQuestDescription(quest) {
8357
+ if (quest.ending) {
8358
+ return quest.ending;
8359
+ }
8360
+ return this.getQuestData(quest.id).description;
8361
+ },
8362
+ getAvailableObjectives(quest) {
8363
+ return filterObject(quest.objectives, (objective) => {
8364
+ return objective.state !== 'hidden';
8365
+ });
8366
+ },
8367
+ },
8368
+ components: {
8369
+ Modal: script$2,
8370
+ VolumeControls: script$4,
8371
+ },
8372
+ });
8373
+
8374
+ const _hoisted_1$b = /*#__PURE__*/createElementVNode("h3", { class: "title" }, "Quests", -1);
8375
+ const _hoisted_2$9 = {
8376
+ key: 0,
8377
+ class: "quests-container"
8378
+ };
8379
+ const _hoisted_3$6 = { class: "quest-title" };
8380
+ const _hoisted_4$5 = { class: "quest-description" };
8381
+ const _hoisted_5$5 = {
8382
+ key: 0,
8383
+ class: "quest-objectives-container list-disc"
8384
+ };
8385
+ const _hoisted_6$5 = {
8386
+ key: 1,
8387
+ class: "menu-container"
8388
+ };
8389
+ const _hoisted_7$4 = /*#__PURE__*/createElementVNode("h2", { class: "title" }, "There are no quests!", -1);
8390
+ const _hoisted_8$3 = [
8391
+ _hoisted_7$4
8392
+ ];
8393
+
8394
+ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
8395
+ const _component_modal = resolveComponent("modal");
8396
+
8397
+ return (openBlock(), createBlock(_component_modal, {
8398
+ class: "quests",
8399
+ onClose: _ctx.close,
8400
+ containerCssClass: "quests-modal"
8401
+ }, {
8402
+ header: withCtx(() => [
8403
+ _hoisted_1$b
8404
+ ]),
8405
+ body: withCtx(() => [
8406
+ (Object.keys(_ctx.questsToDisplay).length > 0)
8407
+ ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
8408
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.questsToDisplay, (quest) => {
8409
+ return (openBlock(), createElementBlock("div", {
8410
+ class: "quest-display",
8411
+ key: quest.id
8412
+ }, [
8413
+ createElementVNode("div", {
8414
+ class: normalizeClass(["quest-header",
8415
+ quest.state === 'completed'
8416
+ ? 'quest-completed'
8417
+ : 'quest-in-progress'
8418
+ ])
8419
+ }, [
8420
+ createElementVNode("h3", _hoisted_3$6, toDisplayString(_ctx.getQuestData(quest.id).title) + " " + toDisplayString(_ctx.getDisplayTextForQuestState(quest)), 1)
8421
+ ], 2),
8422
+ createElementVNode("p", _hoisted_4$5, toDisplayString(_ctx.getQuestDescription(quest)), 1),
8423
+ (quest.state !== 'completed')
8424
+ ? (openBlock(), createElementBlock("ul", _hoisted_5$5, [
8425
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.getAvailableObjectives(quest), (objective) => {
8426
+ return (openBlock(), createElementBlock("li", {
8427
+ class: "quest-objective-display",
8428
+ key: objective.id
8429
+ }, [
8430
+ createElementVNode("p", {
8431
+ class: normalizeClass(["quest-objective-description",
8432
+ objective.state === 'completed'
8433
+ ? 'quest-objective-completed'
8434
+ : 'quest-objctive-in-progress'
8435
+ ])
8436
+ }, toDisplayString(_ctx.getObjectiveData(quest.id, objective.id).description), 3)
8437
+ ]))
8438
+ }), 128))
8439
+ ]))
8440
+ : createCommentVNode("", true)
8441
+ ]))
8442
+ }), 128))
8443
+ ]))
8444
+ : (openBlock(), createElementBlock("div", _hoisted_6$5, _hoisted_8$3))
8445
+ ]),
8446
+ _: 1
8447
+ }, 8, ["onClose"]))
8448
+ }
8449
+
8450
+ var css_248z$d = "/* Write CSS for this vue component */\n\n.quests-modal {\n width: 100%;\n min-height: 50%;\n}\n\n/* CSS for .quest-header with row flex */\n\n.quest-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.quest-display {\n}\n\n.quest-title {\n font-size: 1.5rem;\n font-weight: bold;\n margin-bottom: 0.5rem;\n}\n\n.quest-completed {\n color: var(--completed-quest-title-color);\n}\n\n.quest-in-progress {\n color: var(--quest-title-color);\n}\n\n.quest-state {\n font-size: 1.25rem;\n font-weight: bold;\n margin-bottom: 0.5rem;\n}\n\n.quest-description {\n font-size: 1.1rem;\n text-align: justify;\n font-style: italic;\n margin-bottom: 0.5rem;\n}\n\n.quest-objectives-container {\n margin-left: 10px;\n}\n\n.quest-objective-completed {\n color: var(--objective-completed-color);\n text-decoration: line-through;\n}\n\n.quest-objective-in-progress {\n color: var(--objective-in-progress-color);\n}\n\n.quest-objective-description {\n font-size: 1rem;\n margin-bottom: 0.5rem;\n}\r\n";
8451
+ styleInject(css_248z$d);
8452
+
8453
+ script$c.render = render$c;
8454
+
8455
+ var script$d = defineComponent({
7932
8456
  setup() {
7933
8457
  const dialogStore = useDialogStore();
7934
8458
  const vmStore = useVM();
7935
8459
  const mainStore = useMain();
7936
- const renderingStore = useRenderingStore();
7937
8460
  return {
7938
8461
  dialog: computed(() => dialogStore.dialog),
7939
8462
  stack: computed(() => vmStore.stack),
@@ -7955,6 +8478,8 @@ var script$b = defineComponent({
7955
8478
  Menu: script$8,
7956
8479
  MainMenu: script$9,
7957
8480
  Skills: script$a,
8481
+ Inventory: script$b,
8482
+ Quests: script$c,
7958
8483
  },
7959
8484
  data() {
7960
8485
  return {
@@ -8212,7 +8737,7 @@ var script$b = defineComponent({
8212
8737
  }
8213
8738
  return {
8214
8739
  title,
8215
- text: processText(dialogKey.text),
8740
+ text: dialogKey.text,
8216
8741
  styleId: dialogKey.speaker,
8217
8742
  choices: dialogKey.choices,
8218
8743
  old: index < this.dialog.length - 1,
@@ -8222,22 +8747,24 @@ var script$b = defineComponent({
8222
8747
  },
8223
8748
  });
8224
8749
 
8225
- const _hoisted_1$a = ["width", "height"];
8226
- const _hoisted_2$8 = /*#__PURE__*/createElementVNode("div", { class: "anchor" }, null, -1);
8227
- const _hoisted_3$5 = {
8750
+ const _hoisted_1$c = ["width", "height"];
8751
+ const _hoisted_2$a = /*#__PURE__*/createElementVNode("div", { class: "anchor" }, null, -1);
8752
+ const _hoisted_3$7 = {
8228
8753
  key: 2,
8229
8754
  class: "flex flex-col",
8230
8755
  style: {"height":"100%","padding":"20px"}
8231
8756
  };
8232
- const _hoisted_4$4 = { id: "game-title-container" };
8233
- const _hoisted_5$4 = { id: "game-title-text" };
8234
- const _hoisted_6$4 = { class: "flex flex-col" };
8235
- const _hoisted_7$3 = { key: 3 };
8757
+ const _hoisted_4$6 = { id: "game-title-container" };
8758
+ const _hoisted_5$6 = { id: "game-title-text" };
8759
+ const _hoisted_6$6 = { class: "flex flex-col" };
8760
+ const _hoisted_7$5 = { key: 3 };
8236
8761
 
8237
- function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8762
+ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
8238
8763
  const _component_Hud = resolveComponent("Hud");
8239
8764
  const _component_Menu = resolveComponent("Menu");
8240
8765
  const _component_Skills = resolveComponent("Skills");
8766
+ const _component_Inventory = resolveComponent("Inventory");
8767
+ const _component_Quests = resolveComponent("Quests");
8241
8768
  const _component_MainMenu = resolveComponent("MainMenu");
8242
8769
  const _component_DialogPicture = resolveComponent("DialogPicture");
8243
8770
  const _component_DialogBox = resolveComponent("DialogBox");
@@ -8265,9 +8792,21 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8265
8792
  onClose: _ctx.closeModal
8266
8793
  }, null, 8, ["onClose"]))
8267
8794
  : createCommentVNode("", true),
8795
+ (_ctx.modal === 'inventory')
8796
+ ? (openBlock(), createBlock(_component_Inventory, {
8797
+ key: 1,
8798
+ onClose: _ctx.closeModal
8799
+ }, null, 8, ["onClose"]))
8800
+ : createCommentVNode("", true),
8801
+ (_ctx.modal === 'quests')
8802
+ ? (openBlock(), createBlock(_component_Quests, {
8803
+ key: 2,
8804
+ onClose: _ctx.closeModal
8805
+ }, null, 8, ["onClose"]))
8806
+ : createCommentVNode("", true),
8268
8807
  (_ctx.modal === 'menu')
8269
8808
  ? (openBlock(), createBlock(_component_MainMenu, {
8270
- key: 1,
8809
+ key: 3,
8271
8810
  onClose: _ctx.closeModal
8272
8811
  }, null, 8, ["onClose"]))
8273
8812
  : createCommentVNode("", true),
@@ -8284,7 +8823,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8284
8823
  }),
8285
8824
  (_ctx.inGame)
8286
8825
  ? (openBlock(), createElementBlock("div", {
8287
- key: 2,
8826
+ key: 4,
8288
8827
  class: "background",
8289
8828
  style: normalizeStyle(_ctx.backgroundStyle)
8290
8829
  }, [
@@ -8293,12 +8832,12 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8293
8832
  height: _ctx.layoutHeight,
8294
8833
  id: "background-canvas",
8295
8834
  class: "narrat-canvas"
8296
- }, null, 8, _hoisted_1$a)
8835
+ }, null, 8, _hoisted_1$c)
8297
8836
  ], 4))
8298
8837
  : createCommentVNode("", true),
8299
8838
  (_ctx.inGame)
8300
8839
  ? (openBlock(), createElementBlock("div", {
8301
- key: 3,
8840
+ key: 5,
8302
8841
  class: "dialog override",
8303
8842
  ref: "dialog",
8304
8843
  style: normalizeStyle(_ctx.dialogStyle)
@@ -8320,16 +8859,16 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8320
8859
  ]),
8321
8860
  _: 1
8322
8861
  }, 8, ["style"]),
8323
- _hoisted_2$8
8862
+ _hoisted_2$a
8324
8863
  ], 4))
8325
8864
  : createCommentVNode("", true)
8326
8865
  ], 4))
8327
8866
  : (_ctx.gameLoaded)
8328
- ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
8329
- createElementVNode("div", _hoisted_4$4, [
8330
- createElementVNode("h1", _hoisted_5$4, toDisplayString(_ctx.gameTitle), 1)
8867
+ ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
8868
+ createElementVNode("div", _hoisted_4$6, [
8869
+ createElementVNode("h1", _hoisted_5$6, toDisplayString(_ctx.gameTitle), 1)
8331
8870
  ]),
8332
- createElementVNode("div", _hoisted_6$4, [
8871
+ createElementVNode("div", _hoisted_6$6, [
8333
8872
  createElementVNode("button", {
8334
8873
  class: "button menu-button start-button override",
8335
8874
  onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.startGame && _ctx.startGame(...args)))
@@ -8343,7 +8882,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8343
8882
  : createCommentVNode("", true)
8344
8883
  ])
8345
8884
  ]))
8346
- : (openBlock(), createElementBlock("div", _hoisted_7$3, [
8885
+ : (openBlock(), createElementBlock("div", _hoisted_7$5, [
8347
8886
  createVNode(_component_LoadingBar, {
8348
8887
  percentage: _ctx.loadingPercentage,
8349
8888
  step: _ctx.loadingStep
@@ -8356,10 +8895,10 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
8356
8895
  ], 4))
8357
8896
  }
8358
8897
 
8359
- var css_248z$c = "#app {\n background-color: var(--bg-color);\n width: 100%;\n height: 100%;\n position: absolute;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n color: var(--text-color);\n box-sizing: border-box;\n overflow: hidden;\n transform-origin: center center;\n}\n\n.game {\n background-color: var(--bg-color);\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.interact-button {\n height: 50px;\n border: 1px solid black;\n font-weight: bold;\n font-size: 20px;\n text-align: center;\n flex-grow: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.interact-button:not(:last-child) {\n margin-right: 10px;\n}\n\n.dialog-container {\n flex-shrink: 2;\n /* padding: 20px; */\n min-height: 100%;\n width: 100%;\n background-color: (var(--bg-color));\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n align-items: center;\n overflow-x: hidden;\n}\n\n.dialog {\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n}\n\n.dialog::-webkit-scrollbar {\n display: none; /* webkit */\n}\n\n.dialog * {\n overflow-anchor: none;\n}\n\n.background {\n margin: 0;\n}\n\n#background-canvas {\n height: 100%;\n}\n\n.anchor {\n overflow-anchor: auto;\n height: 1px;\n}\n\n.menu-toggle {\n position: fixed;\n bottom: 0px;\n right: 15%;\n z-index: 2;\n}\n\n#game-title-container {\n margin-bottom: 50px;\n}\n\n#game-title-text {\n text-align: center;\n font-size: 50px;\n}\n\n.menu-button {\n font-size: 25px;\n}\r\n";
8360
- styleInject(css_248z$c);
8898
+ var css_248z$e = "#app {\n background-color: var(--bg-color);\n width: 100%;\n height: 100%;\n position: absolute;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n color: var(--text-color);\n box-sizing: border-box;\n overflow: hidden;\n transform-origin: center center;\n}\n\n.game {\n background-color: var(--bg-color);\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.interact-button {\n height: 50px;\n border: 1px solid black;\n font-weight: bold;\n font-size: 20px;\n text-align: center;\n flex-grow: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.interact-button:not(:last-child) {\n margin-right: 10px;\n}\n\n.dialog-container {\n flex-shrink: 2;\n /* padding: 20px; */\n min-height: 100%;\n width: 100%;\n background-color: (var(--bg-color));\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n align-items: center;\n overflow-x: hidden;\n}\n\n.dialog {\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n}\n\n.dialog::-webkit-scrollbar {\n display: none; /* webkit */\n}\n\n.dialog * {\n overflow-anchor: none;\n}\n\n.background {\n margin: 0;\n}\n\n#background-canvas {\n height: 100%;\n}\n\n.anchor {\n overflow-anchor: auto;\n height: 1px;\n}\n\n.menu-toggle {\n position: fixed;\n bottom: 0px;\n right: 15%;\n z-index: 2;\n}\n\n#game-title-container {\n margin-bottom: 50px;\n}\n\n#game-title-text {\n text-align: center;\n font-size: 50px;\n}\n\n.menu-button {\n font-size: 25px;\n}\r\n";
8899
+ styleInject(css_248z$e);
8361
8900
 
8362
- script$b.render = render$b;
8901
+ script$d.render = render$d;
8363
8902
 
8364
8903
  let canvas;
8365
8904
  let ctx;
@@ -8859,7 +9398,76 @@ const waitParser = (ctx) => {
8859
9398
  };
8860
9399
  const waitCommand = new CommandPlugin('wait', wait, waitParser);
8861
9400
 
9401
+ // Write a CommandPlugin for adding items to the inventory store
9402
+ const addItemPlugin = new CommandPlugin('add_item', async (cmd) => {
9403
+ const id = cmd.args[0];
9404
+ const amount = cmd.args[1];
9405
+ const inventory = useInventory();
9406
+ inventory.add({
9407
+ id,
9408
+ amount,
9409
+ });
9410
+ return useVM().nextLine();
9411
+ }, generateParser('add_item'));
9412
+
9413
+ // Write a CommandPlugin for removeing items to the inventory store
9414
+ const removeItemPlugin = new CommandPlugin('remove_item', async (cmd) => {
9415
+ const id = cmd.args[0];
9416
+ const amount = cmd.args[1];
9417
+ const inventory = useInventory();
9418
+ inventory.remove({
9419
+ id,
9420
+ amount,
9421
+ });
9422
+ return useVM().nextLine();
9423
+ }, generateParser('remove_item'));
9424
+
9425
+ // Write a CommandPlugin for starting a quest with the useQuests quests store
9426
+ const startQuestPlugin = new CommandPlugin('start_quest', async (cmd) => {
9427
+ const questId = cmd.args[0];
9428
+ const quests = useQuests();
9429
+ quests.startQuest(questId);
9430
+ return useVM().nextLine();
9431
+ }, generateParser('start_quest'));
9432
+ // Write a CommandPlugin for starting a quest objective with the cmd having arguments questId and objectiveId, using the useQuests store's startObjective method
9433
+ const startObjectivePlugin = new CommandPlugin('start_objective', async (cmd) => {
9434
+ const questId = cmd.args[0];
9435
+ const objectiveId = cmd.args[1];
9436
+ const quests = useQuests();
9437
+ quests.startObjective(questId, objectiveId);
9438
+ return useVM().nextLine();
9439
+ }, generateParser('start_objective'));
9440
+ // Write a CommandPlugin for completing a quest objective with the cmd having arguments questId and objectiveId, using the useQuests store's completeObjective method
9441
+ const completeObjectivePlugin = new CommandPlugin('complete_objective', async (cmd) => {
9442
+ const questId = cmd.args[0];
9443
+ const objectiveId = cmd.args[1];
9444
+ const quests = useQuests();
9445
+ quests.completeObjective(questId, objectiveId);
9446
+ return useVM().nextLine();
9447
+ }, generateParser('complete_objective'));
9448
+ // Write a CommandPlugin for completing a quest with the cmd having arguments questId, using the useQuests store's completeQuest method
9449
+ const completeQuestPlugin = new CommandPlugin('complete_quest', async (cmd) => {
9450
+ const questId = cmd.args[0];
9451
+ let ending;
9452
+ if (cmd.args.length > 1) {
9453
+ ending = cmd.args[1];
9454
+ }
9455
+ const quests = useQuests();
9456
+ quests.completeQuest(questId, ending);
9457
+ return useVM().nextLine();
9458
+ }, generateParser('complete_quest'));
9459
+
9460
+ // Write a CommandPlugin for running a label using the runLabelFunction of the useVM store
9461
+ const runLabelPlugin = new CommandPlugin('run_label', async (cmd) => {
9462
+ const label = cmd.args[0];
9463
+ if (!label) {
9464
+ error(`run_label command needs a label to argument run`);
9465
+ }
9466
+ await useVM().runLabelFunction(label);
9467
+ }, generateParser('run_label'));
9468
+
8862
9469
  function registerBaseCommands(vm) {
9470
+ vm.addCommand(addItemPlugin);
8863
9471
  vm.addCommand(addLevelPlugin);
8864
9472
  vm.addCommand(addStatPlugin);
8865
9473
  vm.addCommand(addXpPlugin);
@@ -8871,6 +9479,7 @@ function registerBaseCommands(vm) {
8871
9479
  vm.addCommand(notifyPlugin);
8872
9480
  vm.addCommand(pauseCommand);
8873
9481
  vm.addCommand(playCommand);
9482
+ vm.addCommand(removeItemPlugin);
8874
9483
  vm.addCommand(setButtonCommand);
8875
9484
  vm.addCommand(setScreenCommand);
8876
9485
  vm.addCommand(setStatCommand);
@@ -8879,6 +9488,14 @@ function registerBaseCommands(vm) {
8879
9488
  vm.addCommand(talkCommand);
8880
9489
  vm.addCommand(textCommandPlugin);
8881
9490
  vm.addCommand(waitCommand);
9491
+ // functions and labels
9492
+ vm.addCommand(jumpCommand);
9493
+ vm.addCommand(runLabelPlugin);
9494
+ // Quests
9495
+ vm.addCommand(startQuestPlugin);
9496
+ vm.addCommand(startObjectivePlugin);
9497
+ vm.addCommand(completeObjectivePlugin);
9498
+ vm.addCommand(completeQuestPlugin);
8882
9499
  }
8883
9500
 
8884
9501
  class NarratPlugin {
@@ -8904,7 +9521,7 @@ vm.callHook('onPageLoaded');
8904
9521
  async function startApp(config, options) {
8905
9522
  const configFile = await getFile('data/config.json');
8906
9523
  setConfig(JSON.parse(configFile));
8907
- app = createApp(script$b, {
9524
+ app = createApp(script$d, {
8908
9525
  config,
8909
9526
  options,
8910
9527
  });
@@ -8921,7 +9538,7 @@ async function startApp(config, options) {
8921
9538
  });
8922
9539
  registerBaseCommands(vm);
8923
9540
  logManager.setupDebugger(options.debug);
8924
- console.log('%c Narrat game engine – 1.1.0 - June 25, 2022 09:56:51', 'background: #222; color: #bada55');
9541
+ console.log('%c Narrat game engine – 1.3.0 - June 25, 2022 18:05:43', 'background: #222; color: #bada55');
8925
9542
  vm.callHook('onNarratSetup');
8926
9543
  app.mount('#game-holder');
8927
9544
  if (options.debug) {
@@ -8945,5 +9562,5 @@ async function startApp(config, options) {
8945
9562
  startGameLoop();
8946
9563
  }
8947
9564
 
8948
- export { CommandPlugin, NarratPlugin, addCommand, aspectRatioFit, generateParser, getConfig, getSkillConfig, registerPlugin, setConfig, startApp };
9565
+ export { CommandPlugin, NarratPlugin, addCommand, aspectRatioFit, generateParser, getConfig, getItemConfig, getObjectiveConfig, getQuestConfig, getSkillConfig, registerPlugin, setConfig, startApp };
8949
9566
  //# sourceMappingURL=index.esm.js.map