narrat 0.9.2 → 0.10.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.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 0.9.2 - June 5, 2022 19:39:28
1
+ // Version: 0.10.0 - June 8, 2022 02:13:08
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -34,7 +34,7 @@ function styleInject(css, ref) {
34
34
  }
35
35
  }
36
36
 
37
- 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}\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@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";
37
+ 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,\n.list-leave-active {\n transition: all 0.3s ease;\n}\n\n/* .list-move {\n transition: transform 0.3s ease;\n} */\n\n.list-enter-from,\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,\n.notification-leave-active {\n transition: all 0.3s ease;\n}\n\n/* .notification-move {\n transition: transform 0.3s ease;\n} */\n\n.notification-enter-from,\n.notification-leave-to {\n opacity: 0;\n transform: translateY(-300px);\n}\n\n.fade-enter-active,\n.fade-leave-active {\n transition: opacity 0.3s ease;\n}\n\n.fade-enter-from,\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,\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,\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,\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,\nh2,\nh3,\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.\nOtherwise hovering choices doesn't change the color of skill check prompts. */\n\n.dialog-choice:not(:hover) > .skill-check-name,\n.passive-skill-check > .skill-check-name {\n color: var(--skill-check-name-color);\n}\n\n.dialog-choice:not(:hover) > .skill-check-difficulty,\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,\n.passive-skill-check > .skill-check-success {\n color: var(--skill-check-success);\n}\n\n.dialog-choice:not(:hover) > .skill-check-failed,\n.passive-skill-check > .skill-check-failed {\n color: var(--skill-check-failed);\n}\n\n.dialog-choice:not(:hover) > .skill-check,\n.passive-skill-check.skill-check {\n color: var(--skill-check-color);\n}\n\n/* Looks ugly */\n\n/* @keyframes strike-anim {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n}\n.strike-anim {\n position: relative;\n}\n.strike-anim::after {\n content: ' ';\n position: absolute;\n top: 50%;\n left: 0;\n width: 100%;\n height: 1px;\n background: var(--text-color);\n animation-name: strike-anim;\n animation-duration: 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\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}\n";
38
38
  styleInject(css_248z);
39
39
 
40
40
  const f=vue.ref([]),v=vue.ref(null),m=vue.ref(null),g=vue.ref(null),h=vue.reactive({current:""}),y=[],b=vue.ref(!1),k=vue.readonly(f),w=vue.readonly(v),M=vue.readonly(m),q=vue.readonly(g),x=vue.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;}};
@@ -139,7 +139,7 @@ var script = vue.defineComponent({
139
139
  dialogBoxStyle() {
140
140
  const style = getCharacterStyle(this.options.styleId);
141
141
  const css = {
142
- opacity: this.options.old ? '0.5' : '1',
142
+ opacity: this.options.old ? '0.7' : '1',
143
143
  };
144
144
  if (!this.options.title) {
145
145
  css.marginTop = '-20px';
@@ -178,6 +178,11 @@ var script = vue.defineComponent({
178
178
  }
179
179
  return style;
180
180
  },
181
+ dialogClass(choice) {
182
+ if (!choice.allowed) {
183
+ return 'strike-anim';
184
+ }
185
+ },
181
186
  },
182
187
  });
183
188
 
@@ -225,10 +230,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
225
230
  return (vue.openBlock(), vue.createElementBlock("p", {
226
231
  key: index,
227
232
  style: vue.normalizeStyle(_ctx.dialogStyle(choice)),
233
+ class: vue.normalizeClass([_ctx.dialogClass(choice), "dialog-choice override"]),
228
234
  onClick: $event => (_ctx.chooseOption(choice)),
229
- class: "dialog-choice override",
230
235
  innerHTML: `${index + 1}. –  ${choice.choice}`
231
- }, null, 12, _hoisted_6))
236
+ }, null, 14, _hoisted_6))
232
237
  }), 128))
233
238
  ]))
234
239
  : (_ctx.canInteract)
@@ -243,7 +248,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
243
248
  ], 4))
244
249
  }
245
250
 
246
- var css_248z$1 = ".dialog-title {\n font-size: 20px;\n font-weight: bold;\n}\n\n.dialog-text {\n font-size: 16px;\n}\n\n.dialog-box {\n /* border-radius: 10px; */\n /* border: 1px solid #a8a8a8; */\n color: var(--text-color);\n /* background-color: #2e2e2e; */\n padding: 10px;\n padding-left: 2em;\n margin-bottom: 10px;\n}\n\n.dialog-choice {\n color: orange;\n}\n\n.dialog-choice:hover {\n color: var(--text-color);\n cursor: pointer;\n}\n\n.buttons-container {\n width: 100%;\n padding: 10px;\n display: flex;\n justify-content: space-evenly;\n align-items: stretch;\n box-sizing: border-box;\n}\n\n.interact-button {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n height: 50px;\n color: var(--text-color);\n border: 1px solid black;\n font-weight: bold;\n font-size: 24px;\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}\r\n";
251
+ var css_248z$1 = ".dialog-title {\n font-size: 20px;\n font-weight: bold;\n}\n\n.dialog-text {\n font-size: 16px;\n}\n\n.dialog-box {\n /* border-radius: 10px; */\n /* border: 1px solid #a8a8a8; */\n color: var(--text-color);\n /* background-color: #2e2e2e; */\n padding: 10px;\n padding-left: 2em;\n margin-bottom: 10px;\n}\n\n.dialog-choice {\n color: var(--dialog-choice-color);\n}\n\n.dialog-choice:hover {\n color: var(--dialog-choice-hover-color);\n cursor: pointer;\n}\n\n.buttons-container {\n width: 100%;\n padding: 10px;\n display: flex;\n justify-content: space-evenly;\n align-items: stretch;\n box-sizing: border-box;\n}\n\n.interact-button {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n height: 50px;\n color: var(--text-color);\n border: 1px solid black;\n font-weight: bold;\n font-size: 24px;\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";
247
252
  styleInject(css_248z$1);
248
253
 
249
254
  script.render = render;
@@ -279,6 +284,9 @@ const defaultConfig = {
279
284
  },
280
285
  buttons: {},
281
286
  skills: {},
287
+ skillOptions: {
288
+ xpPerLevel: 10,
289
+ },
282
290
  skillChecks: {
283
291
  rollRange: 100,
284
292
  skillMultiplier: 10,
@@ -323,6 +331,13 @@ function setConfig(conf) {
323
331
  }
324
332
  function getConfig() {
325
333
  return config$1;
334
+ }
335
+ function getSkillConfig(commit, id) {
336
+ const skill = config$1.skills[id];
337
+ if (!skill) {
338
+ error(commit, `Skill config for skill ${id} doesn't exist`);
339
+ }
340
+ return skill;
326
341
  }
327
342
 
328
343
  var script$1 = vue.defineComponent({
@@ -366,26 +381,25 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
366
381
  ], 4))
367
382
  }
368
383
 
369
- var css_248z$2 = ".dialog-picture {\n position: absolute;\n width: 80px;\n height: 80px;\n border: 2px solid white;\n border-radius: 10px;\n background-color: grey;\n z-index: 99;\n}\n\n.dialog-picture img {\n width: 100%;\n height: 100%;\n}\r\n";
384
+ var css_248z$2 = ".dialog-picture {\n position: absolute;\n width: 80px;\n height: 80px;\n border: 2px solid white;\n border-radius: 10px;\n background-color: grey;\n z-index: 99;\n}\n\n.dialog-picture img {\n width: 100%;\n height: 100%;\n}\n";
370
385
  styleInject(css_248z$2);
371
386
 
372
387
  script$1.render = render$1;
373
388
 
374
- class Logger {
389
+ class LogManager {
375
390
  debug;
376
- constructor(debug) {
377
- this.debug = debug;
378
- }
379
- setDebug(debug) {
391
+ logger = {
392
+ log: () => { },
393
+ };
394
+ setupDebugger(debug) {
380
395
  this.debug = debug;
381
- }
382
- log(...args) {
383
- if (this.debug) {
384
- console.log(...args);
396
+ if (debug) {
397
+ this.logger.log = console.log.bind(window.console);
385
398
  }
386
399
  }
387
400
  }
388
- const logger = new Logger(false);
401
+ const logManager = new LogManager();
402
+ const logger = logManager.logger;
389
403
 
390
404
  function getPlayTime(startedAt, previousTime) {
391
405
  return Date.now() - startedAt + previousTime;
@@ -456,7 +470,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
456
470
  }))
457
471
  }
458
472
 
459
- var css_248z$3 = ".modal-mask {\n position: absolute;\n z-index: 9998;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n transition: opacity 0.3s ease;\n display: flex;\n flex-direction: column;\n flex-shrink: 2 2;\n align-items: center;\n justify-content: center;\n}\n\n.modal-container {\n min-width: 300px;\n max-width: 90vw;\n max-height: 100%;\n overflow-y: hidden;\n margin: 10px auto;\n padding: 20px 30px;\n border-radius: 5px;\n transition: all 0.3s ease;\n font-family: Helvetica, Arial, sans-serif;\n background: linear-gradient(to right, hsl(210, 30%, 20%), hsl(255, 30%, 25%));\n display: flex;\n flex-direction: column;\n}\n\n.modal-header {\n position: relative;\n}\n\n.modal-header h3 {\n flex-shrink: 0;\n margin-top: 0;\n color: var(--secondary);\n}\n\n.modal-body {\n margin: 20px 0;\n overflow-y: auto;\n flex-shrink: 2;\n}\n\n.modal-default-button {\n float: right;\n}\n\n/*\r\n * The following styles are auto-applied to elements with\r\n * transition=\"modal\" when their visibility is toggled\r\n * by Vue.js.\r\n *\r\n * You can easily play with the modal transition by editing\r\n * these styles.\r\n */\n\n.modal-enter {\n opacity: 0;\n}\n\n.modal-leave-active {\n opacity: 0;\n}\n\n.modal-enter .modal-container,\r\n.modal-leave-active .modal-container {\n transform: scale(1.1);\n}\n\n.close-button {\n border: 1px solid var(--text-color);\n border-radius: 50px;\n font-size: 30px;\n font-weight: 700;\n position: absolute;\n right: -20px;\n top: -10px;\n width: 50px;\n height: 50px;\n}\n\n.close-button:hover {\n background-color: var(--focus);\n}\r\n";
473
+ var css_248z$3 = ".modal-mask {\n position: absolute;\n z-index: 9998;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n transition: opacity 0.3s ease;\n display: flex;\n flex-direction: column;\n flex-shrink: 2 2;\n align-items: center;\n justify-content: center;\n}\n\n.modal-container {\n min-width: 300px;\n max-width: 90vw;\n max-height: 100%;\n overflow-y: hidden;\n margin: 10px auto;\n padding: 20px 30px;\n border-radius: 5px;\n transition: all 0.3s ease;\n font-family: Helvetica, Arial, sans-serif;\n background: linear-gradient(to right, hsl(210, 30%, 20%), hsl(255, 30%, 25%));\n display: flex;\n flex-direction: column;\n}\n\n.modal-header {\n position: relative;\n}\n\n.modal-header h3 {\n flex-shrink: 0;\n margin-top: 0;\n color: var(--secondary);\n}\n\n.modal-body {\n margin: 20px 0;\n overflow-y: auto;\n flex-shrink: 2;\n}\n\n.modal-default-button {\n float: right;\n}\n\n/*\n * The following styles are auto-applied to elements with\n * transition=\"modal\" when their visibility is toggled\n * by Vue.js.\n *\n * You can easily play with the modal transition by editing\n * these styles.\n */\n\n.modal-enter {\n opacity: 0;\n}\n\n.modal-leave-active {\n opacity: 0;\n}\n\n.modal-enter .modal-container,\n.modal-leave-active .modal-container {\n transform: scale(1.1);\n}\n\n.close-button {\n border: 1px solid var(--text-color);\n border-radius: 50px;\n font-size: 30px;\n font-weight: 700;\n position: absolute;\n right: -20px;\n top: -10px;\n width: 50px;\n height: 50px;\n}\n\n.close-button:hover {\n background-color: var(--focus);\n}\n";
460
474
  styleInject(css_248z$3);
461
475
 
462
476
  script$2.render = render$2;
@@ -2357,19 +2371,21 @@ var script$3 = vue.defineComponent({
2357
2371
  open() {
2358
2372
  this.showDebug = true;
2359
2373
  this.$nextTick(() => {
2360
- const variablesEditor = new xJ({
2374
+ // eslint-disable-next-line no-unused-vars
2375
+ const _variablesEditor = new xJ({
2361
2376
  target: this.$refs.variablesViewer,
2362
2377
  props: {
2363
2378
  content: {
2364
2379
  text: undefined,
2365
2380
  json: this.variables,
2366
2381
  },
2367
- onChange: (updatedContent, previousContent, patchResult) => {
2382
+ onChange: (updatedContent) => {
2368
2383
  this.$store.commit('overrideData', updatedContent.json);
2369
2384
  },
2370
2385
  },
2371
2386
  });
2372
- const stateEditor = new xJ({
2387
+ // eslint-disable-next-line no-unused-vars
2388
+ const _stateEditor = new xJ({
2373
2389
  target: this.$refs.stateViewer,
2374
2390
  props: {
2375
2391
  content: {
@@ -2600,9 +2616,10 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2600
2616
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.matches, (match, index) => {
2601
2617
  return (vue.openBlock(), vue.createElementBlock("div", {
2602
2618
  class: "search-result",
2603
- style: vue.normalizeStyle(_ctx.getMatchResultStyle(index))
2619
+ style: vue.normalizeStyle(_ctx.getMatchResultStyle(index)),
2620
+ key: index
2604
2621
  }, vue.toDisplayString(match), 5))
2605
- }), 256))
2622
+ }), 128))
2606
2623
  ]))
2607
2624
  : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, _hoisted_10))
2608
2625
  ]),
@@ -2696,7 +2713,7 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2696
2713
  ]))
2697
2714
  }
2698
2715
 
2699
- var css_248z$4 = ".debug-menu {\n z-index: 9999;\n}\n\n.debug-button {\n position: fixed;\n bottom: 10px;\n right: 10px;\n padding: 5px;\n}\n\n.error-message {\n color: orangered;\n margin-top: 10px;\n margin-bottom: 10px;\n}\n\n.error-filename {\n color: grey;\n text-decoration: underline;\n}\n\n.debug-menu-container {\n width: 100%;\n}\n\n.search-result {\n border: 1px solid var(--text-color);\n padding: 10px;\n font-weight: 700;\n font-size: 20px;\n width: 100;\n}\n\n.jump-menu-container {\n width: 80%;\n}\n\n.debug-info {\n position: fixed;\n background-color: rgba(0, 0, 0, 0.6);\n border: 1px dotted var(--text-color);\n top: 0;\n left: 0;\n padding: 5px;\n}\n\n.variables-viewer {\n height: 100%;\n}\r\n";
2716
+ var css_248z$4 = ".debug-menu {\n z-index: 9999;\n}\n\n.debug-button {\n position: fixed;\n bottom: 10px;\n right: 10px;\n padding: 5px;\n}\n\n.error-message {\n color: orangered;\n margin-top: 10px;\n margin-bottom: 10px;\n}\n\n.error-filename {\n color: grey;\n text-decoration: underline;\n}\n\n.debug-menu-container {\n width: 100%;\n}\n\n.search-result {\n border: 1px solid var(--text-color);\n padding: 10px;\n font-weight: 700;\n font-size: 20px;\n width: 100;\n}\n\n.jump-menu-container {\n width: 80%;\n}\n\n.debug-info {\n position: fixed;\n background-color: rgba(0, 0, 0, 0.6);\n border: 1px dotted var(--text-color);\n top: 0;\n left: 0;\n padding: 5px;\n}\n\n.variables-viewer {\n height: 100%;\n}\n";
2700
2717
  styleInject(css_248z$4);
2701
2718
 
2702
2719
  script$3.render = render$3;
@@ -6000,7 +6017,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
6000
6017
  ]))
6001
6018
  }
6002
6019
 
6003
- var css_248z$5 = ".volume-label {\n /* margin: 5px 20px; */\n margin-right: 10px;\n font-size: 20px;\n font-weight: 700;\n}\n\n.volume-controls {\n font-size: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 20px;\n}\n\n.volume-slider {\n width: 200px;\n background-color: blue;\n}\r\n";
6020
+ var css_248z$5 = ".volume-label {\n /* margin: 5px 20px; */\n margin-right: 10px;\n font-size: 20px;\n font-weight: 700;\n}\n\n.volume-controls {\n font-size: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 20px;\n}\n\n.volume-slider {\n width: 200px;\n background-color: blue;\n}\n";
6004
6021
  styleInject(css_248z$5);
6005
6022
 
6006
6023
  script$4.render = render$4;
@@ -6056,7 +6073,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
6056
6073
  ], 4))
6057
6074
  }
6058
6075
 
6059
- var css_248z$6 = ".hud {\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n flex-direction: row-reverse;\n z-index: 3;\n}\n\n.hud-stat {\n border: 1px dotted white;\n background-color: var(--hud-background);\n color: var(--hud-text-color);\n padding: 5px;\n}\n\n.hud-icon {\n display: inline-block;\n height: 1em;\n}\n\n.hud-text {\n margin-left: 5px;\n}\r\n";
6076
+ var css_248z$6 = ".hud {\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n flex-direction: row-reverse;\n z-index: 3;\n}\n\n.hud-stat {\n border: 1px dotted white;\n background-color: var(--hud-background);\n color: var(--hud-text-color);\n padding: 5px;\n}\n\n.hud-icon {\n display: inline-block;\n height: 1em;\n}\n\n.hud-text {\n margin-left: 5px;\n}\n";
6060
6077
  styleInject(css_248z$6);
6061
6078
 
6062
6079
  script$5.render = render$5;
@@ -6093,7 +6110,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
6093
6110
  ]))
6094
6111
  }
6095
6112
 
6096
- var css_248z$7 = "#loading-bar {\n position: relative;\n width: 40vw;\n height: 100px;\n border-radius: 50px;\n background: black;\n}\n\n#inner-loading-bar {\n height: 100%;\n border-radius: 50px 0px 0px 50px;\n background: var(--light-background);\n}\n\n#loading-text {\n z-index: 99999;\n display: flex;\n align-items: center;\n justify-content: space-around;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n}\r\n";
6113
+ var css_248z$7 = "#loading-bar {\n position: relative;\n width: 40vw;\n height: 100px;\n border-radius: 50px;\n background: black;\n}\n\n#inner-loading-bar {\n height: 100%;\n border-radius: 50px 0px 0px 50px;\n background: var(--light-background);\n}\n\n#loading-text {\n z-index: 99999;\n display: flex;\n align-items: center;\n justify-content: space-around;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n}\n";
6097
6114
  styleInject(css_248z$7);
6098
6115
 
6099
6116
  script$6.render = render$6;
@@ -6128,7 +6145,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
6128
6145
  }))
6129
6146
  }
6130
6147
 
6131
- 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";
6148
+ 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}\n";
6132
6149
  styleInject(css_248z$8);
6133
6150
 
6134
6151
  script$7.render = render$7;
@@ -6266,6 +6283,7 @@ howler.Howler.volume(0.5);
6266
6283
  async function loadAudioAssets(config) {
6267
6284
  logger.log(`Loading audio`);
6268
6285
  const loadingPromises = [];
6286
+ howler.Howler.volume(config.audioOptions.volume);
6269
6287
  for (const key in config.music) {
6270
6288
  // Backward compatibility with old music list
6271
6289
  const musicConf = {
@@ -6314,6 +6332,9 @@ async function changeMusic(ctx, newMusic) {
6314
6332
  if (ctx.state.audio.currentMusic) {
6315
6333
  if (oldHowler) {
6316
6334
  oldMusic.fade(oldMusic.volume(), 0, audioOptions.musicFadeOutTime * 1000, oldHowler);
6335
+ setTimeout(() => {
6336
+ oldMusic.stop(oldHowler);
6337
+ }, audioOptions.musicFadeOutTime * 1000);
6317
6338
  }
6318
6339
  }
6319
6340
  if (oldMusic) {
@@ -6346,18 +6367,12 @@ function stopAudio(commit, key) {
6346
6367
  if (sound) {
6347
6368
  sound.stop();
6348
6369
  }
6349
- else {
6350
- error(commit, `Sound effect ${key} not found!`);
6351
- }
6352
6370
  }
6353
6371
  function pauseAudio(commit, key) {
6354
6372
  const sound = getAudio(key);
6355
6373
  if (sound) {
6356
6374
  sound.pause();
6357
6375
  }
6358
- else {
6359
- error(commit, `Sound effect ${key} not found!`);
6360
- }
6361
6376
  }
6362
6377
 
6363
6378
  function debounce(func, waitMilliseconds = 50, options = {}) {
@@ -6472,7 +6487,7 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
6472
6487
  ]))
6473
6488
  }
6474
6489
 
6475
- var css_248z$9 = ".menu-content {\n text-align: center;\n}\n\n.menu-toggle-button {\n margin: 0;\n padding: 2px;\n border-radius: 5px;\n}\n\n.menu-toggle-button:not(:last-child) {\n margin-right: 10px;\n}\n\n.menu-modal {\n width: 500px;\n}\r\n";
6490
+ var css_248z$9 = ".menu-content {\n text-align: center;\n}\n\n.menu-toggle-button {\n margin: 0;\n padding: 2px;\n border-radius: 5px;\n}\n\n.menu-toggle-button:not(:last-child) {\n margin-right: 10px;\n}\n\n.menu-modal {\n width: 500px;\n}\n";
6476
6491
  styleInject(css_248z$9);
6477
6492
 
6478
6493
  script$8.render = render$8;
@@ -6490,9 +6505,13 @@ var script$9 = vue.defineComponent({
6490
6505
  window.close();
6491
6506
  // quit
6492
6507
  },
6508
+ close() {
6509
+ this.$emit('close');
6510
+ },
6493
6511
  mainMenu() {
6494
- this.$store.commit('reset');
6512
+ this.$store.dispatch('menuReturn');
6495
6513
  this.$store.commit('setFlowState', 'menu');
6514
+ this.close();
6496
6515
  },
6497
6516
  getPlayTimeString() {
6498
6517
  const time = getPlayTime(this.$store.state.playTime.start, this.$store.state.playTime.previousPlaytime);
@@ -6511,7 +6530,7 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
6511
6530
 
6512
6531
  return (vue.openBlock(), vue.createBlock(_component_modal, {
6513
6532
  class: "menu",
6514
- onClose: _cache[2] || (_cache[2] = $event => (_ctx.$emit('close'))),
6533
+ onClose: _ctx.close,
6515
6534
  containerCssClass: "menu-modal"
6516
6535
  }, {
6517
6536
  header: vue.withCtx(() => [
@@ -6532,10 +6551,10 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
6532
6551
  ])
6533
6552
  ]),
6534
6553
  _: 1
6535
- }))
6554
+ }, 8, ["onClose"]))
6536
6555
  }
6537
6556
 
6538
- var css_248z$a = ".quit-button {\n margin: 20px;\n text-align: center;\n}\r\n";
6557
+ var css_248z$a = ".quit-button {\n margin: 20px;\n text-align: center;\n}\n";
6539
6558
  styleInject(css_248z$a);
6540
6559
 
6541
6560
  script$9.render = render$9;
@@ -6569,6 +6588,11 @@ var script$a = vue.defineComponent({
6569
6588
  closeSkill() {
6570
6589
  this.chosenSkill = false;
6571
6590
  },
6591
+ xpBarWidth(xp) {
6592
+ return {
6593
+ width: `${Math.floor((xp / this.xpPerLevel) * 100)}%`,
6594
+ };
6595
+ },
6572
6596
  },
6573
6597
  computed: {
6574
6598
  skillsToDisplay() {
@@ -6588,6 +6612,9 @@ var script$a = vue.defineComponent({
6588
6612
  skillConf() {
6589
6613
  return getConfig().skills;
6590
6614
  },
6615
+ xpPerLevel() {
6616
+ return getConfig().skillOptions.xpPerLevel;
6617
+ },
6591
6618
  },
6592
6619
  });
6593
6620
 
@@ -6599,14 +6626,16 @@ const _hoisted_3$4 = {
6599
6626
  };
6600
6627
  const _hoisted_4$3 = ["onClick"];
6601
6628
  const _hoisted_5$3 = { class: "skill-title" };
6602
- const _hoisted_6$3 = { class: "skill-level" };
6603
- const _hoisted_7$2 = {
6629
+ const _hoisted_6$3 = { class: "skill-xp-container" };
6630
+ const _hoisted_7$2 = { class: "skill-xp-text" };
6631
+ const _hoisted_8$1 = { class: "skill-level" };
6632
+ const _hoisted_9$1 = {
6604
6633
  key: 1,
6605
6634
  class: "flex flex-row skill-description-container"
6606
6635
  };
6607
- const _hoisted_8$1 = { class: "flex skill-left" };
6608
- const _hoisted_9$1 = { class: "flex skill-right" };
6609
- const _hoisted_10$1 = /*#__PURE__*/vue.createElementVNode("hr", { class: "hr-solid" }, null, -1);
6636
+ const _hoisted_10$1 = { class: "flex skill-left" };
6637
+ const _hoisted_11$1 = { class: "flex skill-right" };
6638
+ const _hoisted_12$1 = /*#__PURE__*/vue.createElementVNode("hr", { class: "hr-solid" }, null, -1);
6610
6639
 
6611
6640
  function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6612
6641
  const _component_modal = vue.resolveComponent("modal");
@@ -6627,16 +6656,24 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6627
6656
  return (vue.openBlock(), vue.createElementBlock("button", {
6628
6657
  onClick: () => _ctx.clickSkill(key),
6629
6658
  class: "skill-display",
6630
- style: vue.normalizeStyle(_ctx.getSkillStyle(key))
6659
+ style: vue.normalizeStyle(_ctx.getSkillStyle(key)),
6660
+ key: key
6631
6661
  }, [
6632
6662
  vue.createElementVNode("h3", _hoisted_5$3, vue.toDisplayString(_ctx.getSkillName(key)), 1),
6633
- vue.createElementVNode("h3", _hoisted_6$3, vue.toDisplayString(skill.level), 1)
6663
+ vue.createElementVNode("div", _hoisted_6$3, [
6664
+ vue.createElementVNode("div", {
6665
+ class: "skill-xp-bar",
6666
+ style: vue.normalizeStyle(_ctx.xpBarWidth(skill.xp))
6667
+ }, null, 4),
6668
+ vue.createElementVNode("h3", _hoisted_7$2, vue.toDisplayString(skill.xp) + " / " + vue.toDisplayString(_ctx.xpPerLevel) + " XP ", 1)
6669
+ ]),
6670
+ vue.createElementVNode("h3", _hoisted_8$1, vue.toDisplayString(skill.level), 1)
6634
6671
  ], 12, _hoisted_4$3))
6635
- }), 256))
6672
+ }), 128))
6636
6673
  ]))
6637
6674
  : (typeof _ctx.chosenSkill === 'string')
6638
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
6639
- vue.createElementVNode("div", _hoisted_8$1, [
6675
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, [
6676
+ vue.createElementVNode("div", _hoisted_10$1, [
6640
6677
  vue.createElementVNode("button", {
6641
6678
  class: "button",
6642
6679
  onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.closeSkill && _ctx.closeSkill(...args)))
@@ -6646,9 +6683,9 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6646
6683
  style: vue.normalizeStyle(_ctx.getSkillStyle(_ctx.chosenSkill))
6647
6684
  }, null, 4)
6648
6685
  ]),
6649
- vue.createElementVNode("div", _hoisted_9$1, [
6686
+ vue.createElementVNode("div", _hoisted_11$1, [
6650
6687
  vue.createElementVNode("h2", null, vue.toDisplayString(_ctx.getSkillName(_ctx.chosenSkill)), 1),
6651
- _hoisted_10$1,
6688
+ _hoisted_12$1,
6652
6689
  vue.createElementVNode("h3", null, "Level: " + vue.toDisplayString(_ctx.skills[_ctx.chosenSkill].level), 1),
6653
6690
  vue.createElementVNode("p", null, vue.toDisplayString(_ctx.skillConf[_ctx.chosenSkill].description), 1)
6654
6691
  ])
@@ -6660,7 +6697,7 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6660
6697
  }, 8, ["onClose"]))
6661
6698
  }
6662
6699
 
6663
- var css_248z$b = ".skills-modal {\n width: 800px;\n}\n\n.skills-container {\n display: grid;\n grid-auto-rows: auto;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 20px 20px;\n}\n\n.skill-display {\n width: 200px;\n height: 300px;\n position: relative;\n background-size: cover;\n}\n\n.skill-title {\n position: absolute;\n bottom: 0px;\n text-align: center;\n width: 100%;\n color: var(--skills-text-color);\n background: var(--skills-text-background);\n}\n\n.skill-level {\n position: absolute;\n top: 0;\n right: 0;\n font-weight: 700;\n font-size: 25px;\n color: var(--skills-level-color);\n width: 40px;\n height: 40px;\n background-color: var(--skills-level-background);\n}\n\n.skill-description-container {\n justify-content: space-between;\n align-items: center;\n}\n\n.skill-left {\n flex-direction: column;\n}\n\n.skill-right {\n flex-direction: column;\n align-items: baseline;\n}\r\n";
6700
+ var css_248z$b = ".skills-modal {\n width: 800px;\n}\n\n.skills-container {\n display: grid;\n grid-auto-rows: auto;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 20px 20px;\n}\n\n.skill-display {\n width: 200px;\n height: 300px;\n position: relative;\n background-size: cover;\n}\n\n.skill-title {\n position: absolute;\n bottom: 0px;\n text-align: center;\n width: 100%;\n color: var(--skills-text-color);\n background: var(--skills-text-background);\n}\n\n.skill-level {\n position: absolute;\n top: 0;\n right: 0;\n font-weight: 700;\n font-size: 25px;\n color: var(--skills-level-color);\n width: var(--skills-xp-bar-height);\n height: var(--skills-xp-bar-height);\n background-color: var(--skills-level-background);\n}\n\n.skill-description-container {\n justify-content: space-between;\n align-items: center;\n}\n\n.skill-left {\n flex-direction: column;\n}\n\n.skill-right {\n flex-direction: column;\n align-items: baseline;\n}\n\n.skill-xp-container {\n position: absolute;\n top: 0;\n left: 0;\n height: var(--skills-xp-bar-height);\n width: calc(100% - var(--skills-xp-bar-height));\n background-color: rgba(0, 0, 0, 0.5);\n}\n\n.skill-xp-bar {\n position: absolute;\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n background-color: rgba(0, 0, 250, 0.5);\n}\n\n.skill-xp-text {\n z-index: 2;\n}\n";
6664
6701
  styleInject(css_248z$b);
6665
6702
 
6666
6703
  script$a.render = render$a;
@@ -6688,6 +6725,7 @@ var script$b = vue.defineComponent({
6688
6725
  gameLoaded: false,
6689
6726
  loadingStep: 'Loading',
6690
6727
  loadingPercentage: 0.1,
6728
+ hasSave: false,
6691
6729
  };
6692
6730
  },
6693
6731
  props: {
@@ -6711,6 +6749,10 @@ var script$b = vue.defineComponent({
6711
6749
  await this.setupMachine();
6712
6750
  this.loadingPercentage = 0.1;
6713
6751
  this.gameLoaded = true;
6752
+ const save = this.getSaveFile();
6753
+ if (save) {
6754
+ this.hasSave = true;
6755
+ }
6714
6756
  window.addEventListener('resize', debounce(() => {
6715
6757
  this.updateScreenSize();
6716
6758
  }, 100, {
@@ -6754,10 +6796,6 @@ var script$b = vue.defineComponent({
6754
6796
  }
6755
6797
  return undefined;
6756
6798
  },
6757
- saveFile() {
6758
- const saveString = localStorage.getItem(SAVE_FILE);
6759
- return saveString;
6760
- },
6761
6799
  backgroundStyle() {
6762
6800
  let height;
6763
6801
  if (this.layoutMode === 'vertical') {
@@ -6903,14 +6941,19 @@ var script$b = vue.defineComponent({
6903
6941
  config: getConfig(),
6904
6942
  });
6905
6943
  },
6944
+ getSaveFile() {
6945
+ return localStorage.getItem(SAVE_FILE);
6946
+ },
6906
6947
  async startGame() {
6907
6948
  this.$store.dispatch('startMachine');
6908
6949
  await this.$store.dispatch('runLine');
6909
6950
  this.$store.commit('setFlowState', 'playing');
6951
+ this.hasSave = true;
6952
+ this.$store.dispatch('saveGame');
6910
6953
  },
6911
6954
  async loadGame() {
6912
- this.$store.commit('startMachine');
6913
- await this.$store.dispatch('loadGame', this.saveFile);
6955
+ this.$store.dispatch('startMachine');
6956
+ await this.$store.dispatch('loadGame', this.getSaveFile());
6914
6957
  this.$store.commit('setFlowState', 'playing');
6915
6958
  },
6916
6959
  isDialogActive(i) {
@@ -7073,7 +7116,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
7073
7116
  class: "button menu-button start-button override",
7074
7117
  onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.startGame && _ctx.startGame(...args)))
7075
7118
  }, " Start Game "),
7076
- (_ctx.saveFile)
7119
+ (_ctx.hasSave)
7077
7120
  ? (vue.openBlock(), vue.createElementBlock("button", {
7078
7121
  key: 0,
7079
7122
  class: "button menu-button continue-button override",
@@ -7095,7 +7138,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
7095
7138
  ], 4))
7096
7139
  }
7097
7140
 
7098
- 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";
7141
+ 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}\n";
7099
7142
  styleInject(css_248z$c);
7100
7143
 
7101
7144
  script$b.render = render$b;
@@ -7117,6 +7160,85 @@ function getSkillCheckState(ctx, skillCheckId) {
7117
7160
  });
7118
7161
  }
7119
7162
  return skillCheck;
7163
+ }
7164
+ function getSkillCheckDifficultyScore(value, level) {
7165
+ return value - level * getConfig().skillChecks.skillMultiplier;
7166
+ }
7167
+ function getSkillCheckDifficultyText(value, level) {
7168
+ const difficultyScore = getSkillCheckDifficultyScore(value, level);
7169
+ const checks = getConfig().skillChecks;
7170
+ let found = false;
7171
+ let i = 0;
7172
+ let checkText = checks.difficultyText[0][1];
7173
+ while (!found) {
7174
+ if (checks.difficultyText.length > i) {
7175
+ if (difficultyScore >= checks.difficultyText[i][0]) {
7176
+ checkText = checks.difficultyText[i][1];
7177
+ }
7178
+ else {
7179
+ found = true;
7180
+ }
7181
+ }
7182
+ else {
7183
+ found = true;
7184
+ }
7185
+ i++;
7186
+ }
7187
+ return checkText;
7188
+ }
7189
+ function getSkillCheckText({ context, skill, skillCheckId, value, }) {
7190
+ const skillCheckState = getSkillCheckState(context, skillCheckId);
7191
+ const skillConfig = getSkillConfig(context.commit, skill);
7192
+ const level = context.state.skills[skill].level;
7193
+ const difficultyText = getSkillCheckDifficultyText(value, level);
7194
+ let allowed = true;
7195
+ let text = `<span class='skill-check'>[<span class='skill-check-name'>${skillConfig.name}</span> - `;
7196
+ if (skillCheckState.available) {
7197
+ text += ` <span class='skill-check-difficulty'>${difficultyText}</span>]</span>`;
7198
+ }
7199
+ else if (skillCheckState.passed) {
7200
+ text = '';
7201
+ }
7202
+ else {
7203
+ allowed = false;
7204
+ text += ` <span class='skill-check-difficulty'>${difficultyText}</span> - <span class='skill-check-failed'>FAILED</span>]</span>`;
7205
+ }
7206
+ return {
7207
+ difficultyText: text,
7208
+ allowed,
7209
+ };
7210
+ }
7211
+ function getPassiveSkillCheckText(ctx, success, params) {
7212
+ const skillConf = getSkillConfig(ctx.commit, params.skill);
7213
+ const difficultyText = getSkillCheckDifficultyText(params.value, ctx.state.skills[params.skill].level);
7214
+ return `<span class='passive-skill-check skill-check'>[<span class='skill-check-name'>${skillConf.name}</span> - <span class='skill-check-difficulty'>${difficultyText}</span> - ${success
7215
+ ? '<span class="skill-check-success">Success</span>'
7216
+ : '<span class="skill-check-failed">Failure</span>'}]</span>`;
7217
+ }
7218
+ function calculateSkillCheckRoll(state, skill) {
7219
+ const { skillChecks } = getConfig();
7220
+ const unmodifiedRoll = Math.floor(Math.random() * skillChecks.rollRange);
7221
+ const rollModifier = state.skills[skill].level * skillChecks.skillMultiplier;
7222
+ const roll = unmodifiedRoll + rollModifier;
7223
+ logger.log(`[SKILL CHECK] Roll: ${roll}. (Base roll: ${unmodifiedRoll}, modifier: ${rollModifier} - Skill level: ${state.skills[skill].level})`);
7224
+ return {
7225
+ roll,
7226
+ unmodifiedRoll,
7227
+ };
7228
+ }
7229
+ function resolveSkillCheck(state, params) {
7230
+ const { skills, skillChecks } = getConfig();
7231
+ let success = true;
7232
+ const { roll } = calculateSkillCheckRoll(state, params.skill);
7233
+ if (roll <= skillChecks.failureChance - 1) {
7234
+ success = false;
7235
+ }
7236
+ const skill = skills[params.skill];
7237
+ if (roll < params.value) {
7238
+ success = false;
7239
+ }
7240
+ logger.log(`[SKILL CHECK ${skill.name}]: ${success ? '✅' : '❌'}`, `(${params.id}) - ${roll}/${params.value}`);
7241
+ return success;
7120
7242
  }
7121
7243
 
7122
7244
  function processSkillCheck(ctx, skillcheck) {
@@ -7130,25 +7252,13 @@ function processSkillCheck(ctx, skillcheck) {
7130
7252
  }
7131
7253
  function runSkillCheck(ctx, params) {
7132
7254
  const { state } = ctx;
7133
- const { skills, skillChecks } = getConfig();
7134
- let success = true;
7135
- let roll = Math.floor(Math.random() * skillChecks.rollRange);
7136
- if (roll <= skillChecks.failureChance - 1) {
7137
- success = false;
7138
- }
7139
- roll += state.skills[params.skill].level * skillChecks.skillMultiplier;
7140
- const skill = skills[params.skill];
7141
- logger.log(`roll `, roll, params.value);
7142
- if (roll < params.value) {
7143
- success = false;
7144
- }
7255
+ const success = resolveSkillCheck(state, params);
7256
+ writeText(ctx, getPassiveSkillCheckText(ctx, success, params));
7145
7257
  if (success) {
7146
7258
  ctx.commit('passSkillCheck', params.id);
7147
- writeText(ctx, `[${skill.name} - Success] ${params.success || ''}`);
7148
7259
  return true;
7149
7260
  }
7150
7261
  ctx.commit('failSkillCheck', params.id);
7151
- writeText(ctx, `[${skill.name} - Failure] ${params.failure || ''}`);
7152
7262
  return false;
7153
7263
  }
7154
7264
  function runConditionCommand(ctx, command) {
@@ -7323,13 +7433,21 @@ async function runCommand(context, cmd, choices) {
7323
7433
  if (!skillKey || !levelToAdd) {
7324
7434
  error(commit, `add_level command needs a skill id and a value as parameters`);
7325
7435
  }
7326
- commit('incrementSkill', {
7436
+ dispatch('incrementSkill', {
7327
7437
  skill: skillKey,
7328
7438
  amount: levelToAdd,
7329
7439
  });
7330
- const skillName = getConfig().skills[skillKey].name;
7331
- const skillLevel = state.skills[skillKey].level;
7332
- dispatch('addNotification', `Your skill in ${skillName} is now level ${skillLevel}`);
7440
+ return dispatch('nextLine');
7441
+ case 'add_xp':
7442
+ const xpKey = cmd.args[0];
7443
+ const xpToAdd = cmd.args[1];
7444
+ if (!xpKey || !xpToAdd) {
7445
+ error(commit, `add_xp command needs a skill id and a value as parameters`);
7446
+ }
7447
+ dispatch('addXp', {
7448
+ skill: xpKey,
7449
+ amount: xpToAdd,
7450
+ });
7333
7451
  return dispatch('nextLine');
7334
7452
  case 'add_stat':
7335
7453
  const statKey = cmd.args[0];
@@ -7364,9 +7482,9 @@ async function runCommand(context, cmd, choices) {
7364
7482
  catch (err) {
7365
7483
  logger.log(`Error at: `, state.machine.stack[state.machine.stack.length - 1].label);
7366
7484
  console.error(err);
7367
- error(commit, `Narrat script runtime error at <span class="error-filename">${cmd.fileName}:${cmd.line + 1}</span>
7368
- <b>${err}</b>
7369
- Script: ${cmd.code}
7485
+ error(commit, `Narrat script runtime error at <span class="error-filename">${cmd.fileName}:${cmd.line + 1}</span>
7486
+ <b>${err}</b>
7487
+ Script: ${cmd.code}
7370
7488
  Label: ${state.machine.stack[state.machine.stack.length - 1].label}`);
7371
7489
  }
7372
7490
  }
@@ -7430,6 +7548,12 @@ async function runChoice(context, cmd) {
7430
7548
  if (choice.condition) {
7431
7549
  return runCondition(context, choice.condition);
7432
7550
  }
7551
+ if (choice.skillCheck) {
7552
+ if (!getSkillCheckState(context, choice.skillCheck.id).available &&
7553
+ choice.skillCheck.hideAfterRoll) {
7554
+ return false;
7555
+ }
7556
+ }
7433
7557
  return true;
7434
7558
  })
7435
7559
  .map((choice) => {
@@ -7437,35 +7561,14 @@ async function runChoice(context, cmd) {
7437
7561
  let choiceAllowed = true;
7438
7562
  if (choice.skillCheck) {
7439
7563
  const check = choice.skillCheck;
7440
- const config = getConfig();
7441
- const skill = config.skills[check.skill];
7442
- const level = context.state.skills[check.skill].level;
7443
- const difficultyScore = check.value - level * config.skillChecks.skillMultiplier;
7444
- const skillCheckState = getSkillCheckState(context, choice.skillCheck.id);
7445
- let found = false;
7446
- let i = 0;
7447
- let checkText = config.skillChecks.difficultyText[0][1];
7448
- while (!found) {
7449
- if (config.skillChecks.difficultyText.length > i) {
7450
- if (difficultyScore >= config.skillChecks.difficultyText[i][0]) {
7451
- checkText = config.skillChecks.difficultyText[i][1];
7452
- }
7453
- else {
7454
- found = true;
7455
- }
7456
- }
7457
- else {
7458
- found = true;
7459
- }
7460
- i++;
7461
- }
7462
- if (!skillCheckState.available) {
7463
- choiceAllowed = false;
7464
- text = `[${skill.name} - Failed] ${text}`;
7465
- }
7466
- else if (!skillCheckState.passed) {
7467
- text = `[${skill.name} - ${checkText}] ${text}`;
7468
- }
7564
+ const { difficultyText, allowed } = getSkillCheckText({
7565
+ context,
7566
+ skill: check.skill,
7567
+ skillCheckId: check.id,
7568
+ value: check.value,
7569
+ });
7570
+ text = `${difficultyText} ${text}`;
7571
+ choiceAllowed = allowed;
7469
7572
  }
7470
7573
  const result = {
7471
7574
  choice: text,
@@ -7547,6 +7650,10 @@ function add_level(ctx) {
7547
7650
  ctx.command.commandType = 'add_level';
7548
7651
  ctx.currentLine++;
7549
7652
  }
7653
+ function add_xp(ctx) {
7654
+ ctx.command.commandType = 'add_xp';
7655
+ ctx.currentLine++;
7656
+ }
7550
7657
  function set_stat(ctx) {
7551
7658
  ctx.command.commandType = 'set_stat';
7552
7659
  ctx.currentLine++;
@@ -7667,6 +7774,7 @@ const parserFunctions = {
7667
7774
  wait,
7668
7775
  text,
7669
7776
  add_level,
7777
+ add_xp,
7670
7778
  notify,
7671
7779
  set_stat,
7672
7780
  add_stat,
@@ -7684,6 +7792,7 @@ function parseChoiceOption(ctx, choice, index) {
7684
7792
  ctx.parserContext.error(choice.line, `Skillchecks need 4 arguments!`);
7685
7793
  }
7686
7794
  choiceText = choice.args[3];
7795
+ const hideAfterRoll = choice.args.length >= 5;
7687
7796
  const successBranch = choice.branch[0];
7688
7797
  const failureBranch = choice.branch[1];
7689
7798
  const success = {
@@ -7702,6 +7811,7 @@ function parseChoiceOption(ctx, choice, index) {
7702
7811
  id: choice.args[0],
7703
7812
  skill: choice.args[1],
7704
7813
  value: choice.args[2],
7814
+ hideAfterRoll,
7705
7815
  success,
7706
7816
  failure,
7707
7817
  };
@@ -7917,6 +8027,138 @@ function randomId() {
7917
8027
  return `${Date.now() - Math.floor(Math.random() * 99999999)}`;
7918
8028
  }
7919
8029
 
8030
+ var isMergeableObject = function isMergeableObject(value) {
8031
+ return isNonNullObject(value)
8032
+ && !isSpecial(value)
8033
+ };
8034
+
8035
+ function isNonNullObject(value) {
8036
+ return !!value && typeof value === 'object'
8037
+ }
8038
+
8039
+ function isSpecial(value) {
8040
+ var stringValue = Object.prototype.toString.call(value);
8041
+
8042
+ return stringValue === '[object RegExp]'
8043
+ || stringValue === '[object Date]'
8044
+ || isReactElement(value)
8045
+ }
8046
+
8047
+ // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
8048
+ var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
8049
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
8050
+
8051
+ function isReactElement(value) {
8052
+ return value.$$typeof === REACT_ELEMENT_TYPE
8053
+ }
8054
+
8055
+ function emptyTarget(val) {
8056
+ return Array.isArray(val) ? [] : {}
8057
+ }
8058
+
8059
+ function cloneUnlessOtherwiseSpecified(value, options) {
8060
+ return (options.clone !== false && options.isMergeableObject(value))
8061
+ ? deepmerge(emptyTarget(value), value, options)
8062
+ : value
8063
+ }
8064
+
8065
+ function defaultArrayMerge(target, source, options) {
8066
+ return target.concat(source).map(function(element) {
8067
+ return cloneUnlessOtherwiseSpecified(element, options)
8068
+ })
8069
+ }
8070
+
8071
+ function getMergeFunction(key, options) {
8072
+ if (!options.customMerge) {
8073
+ return deepmerge
8074
+ }
8075
+ var customMerge = options.customMerge(key);
8076
+ return typeof customMerge === 'function' ? customMerge : deepmerge
8077
+ }
8078
+
8079
+ function getEnumerableOwnPropertySymbols(target) {
8080
+ return Object.getOwnPropertySymbols
8081
+ ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
8082
+ return target.propertyIsEnumerable(symbol)
8083
+ })
8084
+ : []
8085
+ }
8086
+
8087
+ function getKeys(target) {
8088
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
8089
+ }
8090
+
8091
+ function propertyIsOnObject(object, property) {
8092
+ try {
8093
+ return property in object
8094
+ } catch(_) {
8095
+ return false
8096
+ }
8097
+ }
8098
+
8099
+ // Protects from prototype poisoning and unexpected merging up the prototype chain.
8100
+ function propertyIsUnsafe(target, key) {
8101
+ return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
8102
+ && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
8103
+ && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
8104
+ }
8105
+
8106
+ function mergeObject(target, source, options) {
8107
+ var destination = {};
8108
+ if (options.isMergeableObject(target)) {
8109
+ getKeys(target).forEach(function(key) {
8110
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
8111
+ });
8112
+ }
8113
+ getKeys(source).forEach(function(key) {
8114
+ if (propertyIsUnsafe(target, key)) {
8115
+ return
8116
+ }
8117
+
8118
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
8119
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
8120
+ } else {
8121
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
8122
+ }
8123
+ });
8124
+ return destination
8125
+ }
8126
+
8127
+ function deepmerge(target, source, options) {
8128
+ options = options || {};
8129
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
8130
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
8131
+ // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
8132
+ // implementations can use it. The caller may not replace it.
8133
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
8134
+
8135
+ var sourceIsArray = Array.isArray(source);
8136
+ var targetIsArray = Array.isArray(target);
8137
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
8138
+
8139
+ if (!sourceAndTargetTypesMatch) {
8140
+ return cloneUnlessOtherwiseSpecified(source, options)
8141
+ } else if (sourceIsArray) {
8142
+ return options.arrayMerge(target, source, options)
8143
+ } else {
8144
+ return mergeObject(target, source, options)
8145
+ }
8146
+ }
8147
+
8148
+ deepmerge.all = function deepmergeAll(array, options) {
8149
+ if (!Array.isArray(array)) {
8150
+ throw new Error('first argument should be an array')
8151
+ }
8152
+
8153
+ return array.reduce(function(prev, next) {
8154
+ return deepmerge(prev, next, options)
8155
+ }, {})
8156
+ };
8157
+
8158
+ var deepmerge_1 = deepmerge;
8159
+
8160
+ var cjs = deepmerge_1;
8161
+
7920
8162
  let key = Symbol('Store Injection Key');
7921
8163
  let store;
7922
8164
  function setupStore(options) {
@@ -7927,7 +8169,6 @@ function setupStore(options) {
7927
8169
  }
7928
8170
  // define injection key
7929
8171
  key = Symbol('Store Injection Key');
7930
- logger.setDebug(options.debug);
7931
8172
  logger.log('setup store');
7932
8173
  store = vuex.createStore({
7933
8174
  state: {
@@ -7983,7 +8224,11 @@ function setupStore(options) {
7983
8224
  },
7984
8225
  },
7985
8226
  actions: {
7986
- async setupMachine({ commit, dispatch }, payload) {
8227
+ async setupMachine(ctx, payload) {
8228
+ const { commit } = ctx;
8229
+ if (payload.config.audioOptions.defaultMusic) {
8230
+ changeMusic(ctx, payload.config.audioOptions.defaultMusic);
8231
+ }
7987
8232
  const { scriptPaths } = payload;
7988
8233
  const filePromises = [];
7989
8234
  for (const path of scriptPaths) {
@@ -8004,6 +8249,7 @@ function setupStore(options) {
8004
8249
  commit('setScript', scripts);
8005
8250
  },
8006
8251
  async startMachine({ commit, dispatch, state }) {
8252
+ dispatch('stopMusic');
8007
8253
  const config = getConfig();
8008
8254
  commit('setButtons', config.buttons);
8009
8255
  commit('setupSkills', config.skills);
@@ -8070,26 +8316,59 @@ function setupStore(options) {
8070
8316
  dispatch('runLabel', save.lastLabel);
8071
8317
  }
8072
8318
  },
8073
- async addNotification({ commit }, text) {
8319
+ stopMusic(ctx) {
8320
+ stopAudio(ctx.commit, ctx.state.audio.currentMusic);
8321
+ },
8322
+ menuReturn(ctx) {
8323
+ ctx.commit('reset');
8324
+ ctx.dispatch('stopMusic');
8325
+ ctx.commit('setFlowState', 'menu');
8326
+ if (getConfig().audioOptions.defaultMusic) {
8327
+ changeMusic(ctx, getConfig().audioOptions.defaultMusic);
8328
+ }
8329
+ },
8330
+ async addNotification(ctx, text) {
8331
+ const { commit } = ctx;
8074
8332
  const id = `${Date.now()}-${Math.random() * 10000}`;
8075
8333
  const notification = {
8076
8334
  text,
8077
8335
  };
8078
8336
  commit('addNotification', { id, notification });
8337
+ if (getConfig().notifications.alsoPrintInDialogue) {
8338
+ writeText(ctx, `[NOTIFICATION] ${text}`);
8339
+ }
8079
8340
  await timeout(getConfig().notifications.timeOnScreen * 1000);
8080
8341
  commit('deleteNotification', id);
8081
8342
  },
8343
+ incrementSkill({ dispatch, state }, { skill, amount }) {
8344
+ state.skills[skill].level += amount;
8345
+ dispatch('levelledUp', skill);
8346
+ },
8347
+ levelledUp({ dispatch, state }, skill) {
8348
+ const skillName = getConfig().skills[skill].name;
8349
+ const skillLevel = state.skills[skill].level;
8350
+ dispatch('addNotification', `Your skill in ${skillName} is now level ${skillLevel}`);
8351
+ },
8352
+ addXp({ state, dispatch }, { skill, amount }) {
8353
+ const skillState = state.skills[skill];
8354
+ skillState.xp += amount;
8355
+ if (skillState.xp > getConfig().skillOptions.xpPerLevel) {
8356
+ skillState.level += 1;
8357
+ skillState.xp = 0;
8358
+ dispatch('levelledUp', skill);
8359
+ }
8360
+ },
8082
8361
  },
8083
8362
  mutations: {
8084
8363
  setLoadedData(state, save) {
8085
8364
  state.machine.data = save.data;
8086
- state.skills = save.skills;
8365
+ state.skills = cjs(state.skillChecks, save.skills);
8087
8366
  state.dialog = save.dialog;
8088
- state.buttons = save.buttons;
8367
+ state.buttons = cjs(state.buttons, save.buttons);
8089
8368
  state.lastLabel = save.lastLabel;
8090
- state.skillChecks = save.skillChecks;
8369
+ state.skillChecks = cjs(state.skillChecks, save.skillChecks);
8091
8370
  state.playTime.previousPlaytime = save.playTime;
8092
- state.hudStats = save.hudStats;
8371
+ state.hudStats = cjs(state.hudStats, save.hudStats);
8093
8372
  state.currentScreen = save.currentScreen;
8094
8373
  state.audio.currentMusic = save.audio.currentMusic;
8095
8374
  },
@@ -8127,6 +8406,7 @@ function setupStore(options) {
8127
8406
  for (const skill in skills) {
8128
8407
  state.skills[skill] = {
8129
8408
  level: skills[skill].startingLevel || 0,
8409
+ xp: 0,
8130
8410
  };
8131
8411
  }
8132
8412
  },
@@ -8135,9 +8415,6 @@ function setupStore(options) {
8135
8415
  state.hudStats[stat] = stats[stat].startingValue;
8136
8416
  }
8137
8417
  },
8138
- incrementSkill(state, { skill, amount }) {
8139
- state.skills[skill].level += amount;
8140
- },
8141
8418
  setStat(state, { stat, amount }) {
8142
8419
  state.hudStats[stat] = amount;
8143
8420
  },
@@ -8354,9 +8631,10 @@ function mouseclick(e) {
8354
8631
  let app;
8355
8632
  let store$2;
8356
8633
  async function startApp(config, options) {
8634
+ logManager.setupDebugger(options.debug);
8357
8635
  const configFile = await getFile('data/config.json');
8358
8636
  setConfig(JSON.parse(configFile));
8359
- console.log('%c Narrat game engine – 0.9.2 - June 5, 2022 19:39:28', 'background: #222; color: #bada55');
8637
+ console.log('%c Narrat game engine – 0.10.0 - June 8, 2022 02:13:08', 'background: #222; color: #bada55');
8360
8638
  const storeSetup = setupStore(options);
8361
8639
  store$2 = storeSetup.store;
8362
8640
  app = vue.createApp(script$b, {