narrat 0.6.3 → 0.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Narrat changelog
2
2
 
3
+ ## 0.7.2
4
+
5
+ - Changed the `set` method to access things without caps (`data`, `skills`, `buttons` instead of `DATA`, `SKILLS`, `BUTTONS`) for consistency.
6
+ - Changed string interpolation to have more accessible objects, now values in `data` need to be access with `%{data.something}` instead of just `%{something}`
7
+ - Now possible to access skill levels in string interpolation with `%{skills.someSkill.level}`
8
+ - Improvements to how skill checks are printed to be less awkward
9
+
10
+ ## 0.7.1
11
+
12
+ - Added `stop` and `pause` functions which work similarly to play for stopping or pausing audio.
13
+
14
+ ## 0.6.5
15
+
16
+ - Audio and music options from the config now get passed to howler
17
+ - Renamed `path` to `src` in audio config (to be consistent with howler)
18
+
3
19
  ## 0.6.0
4
20
 
5
21
  Added stats feature for tracking numbers and displaying them in the hud
package/lib/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 0.6.3 - April 25, 2022 16:37:54
1
+ // Version: 0.8.0 - April 26, 2022 13:18:38
2
2
  import 'es6-promise/auto';
3
3
  import { ref, reactive, readonly, defineComponent, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, Fragment, renderList, createBlock, Transition, withCtx, renderSlot, createTextVNode, resolveComponent, toDisplayString, createVNode, TransitionGroup, createApp } from 'vue';
4
4
  import { createLogger, createStore } from 'vuex';
@@ -30,7 +30,7 @@ function styleInject(css, ref) {
30
30
  }
31
31
  }
32
32
 
33
- var css_248z = "/*! @import */\n\n/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */\n\n/*\nDocument\n========\n*/\n\n/**\nUse a better box model (opinionated).\n*/\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/**\nUse a more readable tab size (opinionated).\n*/\n\n:root {\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n}\n\n/**\n1. Correct the line height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n*/\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/*\nSections\n========\n*/\n\n/**\nRemove the margin in all browsers.\n*/\n\nbody {\n margin: 0;\n}\n\n/**\nImprove consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n*/\n\nbody {\n font-family:\n\t\tsystem-ui,\n\t\t-apple-system, /* Firefox supports this but not yet `system-ui` */\n\t\t'Segoe UI',\n\t\tRoboto,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\t'Apple Color Emoji',\n\t\t'Segoe UI Emoji';\n}\n\n/*\nGrouping content\n================\n*/\n\n/**\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n}\n\n/*\nText-level semantics\n====================\n*/\n\n/**\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr[title] {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/**\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n2. Correct the odd 'em' font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family:\n\t\tui-monospace,\n\t\tSFMono-Regular,\n\t\tConsolas,\n\t\t'Liberation Mono',\n\t\tMenlo,\n\t\tmonospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/**\nPrevent 'sub' and 'sup' elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\nTabular data\n============\n*/\n\n/**\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n}\n\n/*\nForms\n=====\n*/\n\n/**\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\nRemove the inheritance of text transform in Edge and Firefox.\n1. Remove the inheritance of text transform in Firefox.\n*/\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\nCorrect the inability to style clickable types in iOS and Safari.\n*/\n\nbutton,\n[type='button'],\n[type='reset'] {\n -webkit-appearance: button;\n}\n\n/**\nRemove the inner border and padding in Firefox.\n*/\n\n/**\nRestore the focus styles unset by the previous rule.\n*/\n\n/**\nRemove the additional ':invalid' styles in Firefox.\nSee: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737\n*/\n\n/**\nRemove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.\n*/\n\nlegend {\n padding: 0;\n}\n\n/**\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n/**\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n/**\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to 'inherit' in Safari.\n*/\n\n/*\nInteractive\n===========\n*/\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/**\n * Manually forked from SUIT CSS Base: https://github.com/suitcss/base\n * A thin layer on top of normalize.css that provides a starting point more\n * suitable for web applications.\n */\n\n/**\n * Removes the default spacing and border for appropriate elements.\n */\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nbutton {\n background-color: transparent;\n background-image: none;\n}\n\n/**\n * Work around a Firefox/IE bug where the transparent `button` background\n * results in a loss of the default `button` focus styles.\n */\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/**\n * Tailwind custom reset styles\n */\n\n/**\n * 1. Use the user's configured `sans` font-family (with Tailwind's default\n * sans-serif font stack as a fallback) as a sane default.\n * 2. Use Tailwind's default \"normal\" line-height so the user isn't forced\n * to override it to ensure consistency even when using the default theme.\n */\n\nhtml {\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 1 */\n line-height: 1.5; /* 2 */\n}\n\n/**\n * Inherit font-family and line-height from `html` so users can set them as\n * a class directly on the `html` element.\n */\n\nbody {\n font-family: inherit;\n line-height: inherit;\n}\n\n/**\n * 1. Prevent padding and border from affecting element width.\n *\n * We used to set this in the html element and inherit from\n * the parent element for everything else. This caused issues\n * in shadow-dom-enhanced elements like <details> where the content\n * is wrapped by a div with box-sizing set to `content-box`.\n *\n * https://github.com/mozdevs/cssremedy/issues/4\n *\n *\n * 2. Allow adding a border to an element by just adding a border-width.\n *\n * By default, the way the browser specifies that an element should have no\n * border is by setting it's border-style to `none` in the user-agent\n * stylesheet.\n *\n * In order to easily add borders to elements by just setting the `border-width`\n * property, we change the default border-style for all elements to `solid`, and\n * use border-width to hide them instead. This way our `border` utilities only\n * need to set the `border-width` property instead of the entire `border`\n * shorthand, making our border utilities much more straightforward to compose.\n *\n * https://github.com/tailwindcss/tailwindcss/pull/116\n */\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n/*\n * Ensure horizontal rules are visible by default\n */\n\nhr {\n border-top-width: 1px;\n}\n\n/**\n * Undo the `border-style: none` reset that Normalize applies to images so that\n * our `border-{width}` utilities have the expected effect.\n *\n * The Normalize reset is unnecessary for us since we default the border-width\n * to 0 on all elements.\n *\n * https://github.com/tailwindcss/tailwindcss/issues/362\n */\n\nimg {\n border-style: solid;\n}\n\ntextarea {\n resize: vertical;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #9ca3af;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #9ca3af;\n}\n\ninput::placeholder,\ntextarea::placeholder {\n color: #9ca3af;\n}\n\nbutton {\n cursor: pointer;\n}\n\ntable {\n border-collapse: collapse;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/**\n * Reset links to optimize for opt-in styling instead of\n * opt-out.\n */\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/**\n * Reset form element properties that are easy to forget to\n * style explicitly so you don't inadvertently introduce\n * styles that deviate from your design system. These styles\n * supplement a partial reset that is already applied by\n * normalize.css.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n}\n\n/**\n * Use the configured 'mono' font family for elements that\n * are expected to be rendered with a monospace font, falling\n * back to the system monospace stack if there is no configured\n * 'mono' font family.\n */\n\npre,\ncode,\nkbd,\nsamp {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n\n/**\n * Make replaced elements `display: block` by default as that's\n * the behavior you want almost all of the time. Inspired by\n * CSS Remedy, with `svg` added as well.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n vertical-align: middle;\n}\n\n/**\n * Constrain images and videos to the parent width and preserve\n * their instrinsic aspect ratio.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n.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.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.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.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}\n\nselect {\n background-color: grey;\n}\n\nbutton {\n background-color: #72080f;\n color: white;\n border-radius: 30px;\n padding: 5px;\n font-weight: 800;\n font-size: 16px;\n margin: 5px;\n}\n\na {\n color: pink;\n text-decoration: underline;\n}\n\nth,\ntd {\n padding: 4px;\n border: 1px solid white;\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@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";
33
+ var css_248z = "/*! @import */\n\n/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */\n\n/*\nDocument\n========\n*/\n\n/**\nUse a better box model (opinionated).\n*/\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/**\nUse a more readable tab size (opinionated).\n*/\n\n:root {\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n}\n\n/**\n1. Correct the line height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n*/\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/*\nSections\n========\n*/\n\n/**\nRemove the margin in all browsers.\n*/\n\nbody {\n margin: 0;\n}\n\n/**\nImprove consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n*/\n\nbody {\n font-family:\n\t\tsystem-ui,\n\t\t-apple-system, /* Firefox supports this but not yet `system-ui` */\n\t\t'Segoe UI',\n\t\tRoboto,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\t'Apple Color Emoji',\n\t\t'Segoe UI Emoji';\n}\n\n/*\nGrouping content\n================\n*/\n\n/**\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n}\n\n/*\nText-level semantics\n====================\n*/\n\n/**\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr[title] {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/**\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n2. Correct the odd 'em' font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family:\n\t\tui-monospace,\n\t\tSFMono-Regular,\n\t\tConsolas,\n\t\t'Liberation Mono',\n\t\tMenlo,\n\t\tmonospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/**\nPrevent 'sub' and 'sup' elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\nTabular data\n============\n*/\n\n/**\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n}\n\n/*\nForms\n=====\n*/\n\n/**\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\nRemove the inheritance of text transform in Edge and Firefox.\n1. Remove the inheritance of text transform in Firefox.\n*/\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\nCorrect the inability to style clickable types in iOS and Safari.\n*/\n\nbutton,\n[type='button'],\n[type='reset'] {\n -webkit-appearance: button;\n}\n\n/**\nRemove the inner border and padding in Firefox.\n*/\n\n/**\nRestore the focus styles unset by the previous rule.\n*/\n\n/**\nRemove the additional ':invalid' styles in Firefox.\nSee: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737\n*/\n\n/**\nRemove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.\n*/\n\nlegend {\n padding: 0;\n}\n\n/**\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n/**\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n/**\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to 'inherit' in Safari.\n*/\n\n/*\nInteractive\n===========\n*/\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/**\n * Manually forked from SUIT CSS Base: https://github.com/suitcss/base\n * A thin layer on top of normalize.css that provides a starting point more\n * suitable for web applications.\n */\n\n/**\n * Removes the default spacing and border for appropriate elements.\n */\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nbutton {\n background-color: transparent;\n background-image: none;\n}\n\n/**\n * Work around a Firefox/IE bug where the transparent `button` background\n * results in a loss of the default `button` focus styles.\n */\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/**\n * Tailwind custom reset styles\n */\n\n/**\n * 1. Use the user's configured `sans` font-family (with Tailwind's default\n * sans-serif font stack as a fallback) as a sane default.\n * 2. Use Tailwind's default \"normal\" line-height so the user isn't forced\n * to override it to ensure consistency even when using the default theme.\n */\n\nhtml {\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 1 */\n line-height: 1.5; /* 2 */\n}\n\n/**\n * Inherit font-family and line-height from `html` so users can set them as\n * a class directly on the `html` element.\n */\n\nbody {\n font-family: inherit;\n line-height: inherit;\n}\n\n/**\n * 1. Prevent padding and border from affecting element width.\n *\n * We used to set this in the html element and inherit from\n * the parent element for everything else. This caused issues\n * in shadow-dom-enhanced elements like <details> where the content\n * is wrapped by a div with box-sizing set to `content-box`.\n *\n * https://github.com/mozdevs/cssremedy/issues/4\n *\n *\n * 2. Allow adding a border to an element by just adding a border-width.\n *\n * By default, the way the browser specifies that an element should have no\n * border is by setting it's border-style to `none` in the user-agent\n * stylesheet.\n *\n * In order to easily add borders to elements by just setting the `border-width`\n * property, we change the default border-style for all elements to `solid`, and\n * use border-width to hide them instead. This way our `border` utilities only\n * need to set the `border-width` property instead of the entire `border`\n * shorthand, making our border utilities much more straightforward to compose.\n *\n * https://github.com/tailwindcss/tailwindcss/pull/116\n */\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n/*\n * Ensure horizontal rules are visible by default\n */\n\nhr {\n border-top-width: 1px;\n}\n\n/**\n * Undo the `border-style: none` reset that Normalize applies to images so that\n * our `border-{width}` utilities have the expected effect.\n *\n * The Normalize reset is unnecessary for us since we default the border-width\n * to 0 on all elements.\n *\n * https://github.com/tailwindcss/tailwindcss/issues/362\n */\n\nimg {\n border-style: solid;\n}\n\ntextarea {\n resize: vertical;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #9ca3af;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #9ca3af;\n}\n\ninput::placeholder,\ntextarea::placeholder {\n color: #9ca3af;\n}\n\nbutton {\n cursor: pointer;\n}\n\ntable {\n border-collapse: collapse;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/**\n * Reset links to optimize for opt-in styling instead of\n * opt-out.\n */\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/**\n * Reset form element properties that are easy to forget to\n * style explicitly so you don't inadvertently introduce\n * styles that deviate from your design system. These styles\n * supplement a partial reset that is already applied by\n * normalize.css.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n}\n\n/**\n * Use the configured 'mono' font family for elements that\n * are expected to be rendered with a monospace font, falling\n * back to the system monospace stack if there is no configured\n * 'mono' font family.\n */\n\npre,\ncode,\nkbd,\nsamp {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n\n/**\n * Make replaced elements `display: block` by default as that's\n * the behavior you want almost all of the time. Inspired by\n * CSS Remedy, with `svg` added as well.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n vertical-align: middle;\n}\n\n/**\n * Constrain images and videos to the parent width and preserve\n * their instrinsic aspect ratio.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n.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.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.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}\n\nselect {\n background-color: grey;\n}\n\nbutton {\n background-color: #72080f;\n color: white;\n border-radius: 30px;\n padding: 5px;\n font-weight: 800;\n font-size: 16px;\n margin: 5px;\n}\n\na {\n color: pink;\n text-decoration: underline;\n}\n\nth,\ntd {\n padding: 4px;\n border: 1px solid white;\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@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";
34
34
  styleInject(css_248z);
35
35
 
36
36
  const f=ref([]),v=ref(null),m=ref(null),g=ref(null),h=reactive({current:""}),y=[],b=ref(!1),k=readonly(f),w=readonly(v),M=readonly(m),q=readonly(g),x=readonly(h),$=(e=w.value)=>{h.current=e;const t=k.value.findIndex((t=>t.name===e)),n=k.value.map((e=>e.name));for(let a=0;a<n.length;a++){if(a>0&&a<n.length-1){const e=n[a]+"Minus",r=n[a]+"Plus";h[e]=t<=a,h[r]=t>=a;}h[n[a]]=n[a]===e;}},V=(e=M.value)=>{h.orientation=e,h.isLandscape="landscape"===e,h.isPortrait="portrait"===e;},O=(e=q.value||"light")=>{h.theme=e,h.isDark="dark"===e,h.isLight="light"===e;};function j(e,t){if("undefined"==typeof window||!window.matchMedia)return !1;if("undefined"!=typeof window&&!window.matchMedia)return console.error("Vue3 Mq: No MatchMedia support detected in this browser. Responsive breakpoints not available."),!1;{b.value=!0;const n=window.matchMedia(e),a=({matches:e})=>{e&&t();};y.push({mql:n,cb:a});n.addEventListener&&"function"==typeof n.addEventListener?n.addEventListener("change",a):n.addListener(a),a(n);}}var L=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",bootstrap5:{xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},bootstrap4:{xs:0,sm:576,md:768,lg:992,xl:1200},bootstrap3:{xs:0,sm:768,md:992,lg:1200},vuetify:{xs:0,sm:600,md:960,lg:1264,xl:1904},tailwind:{xs:0,sm:640,md:768,lg:1024,xl:1280,xxl:1536},devices:{phone:0,tablet:768,laptop:1370,desktop:1906}});const T=e=>{if(!e||"object"!=typeof e)return !1;const t=[];for(let n in e){const a=parseFloat(e[n]);n&&"string"==typeof n?/^[^a-z]/i.test(n)||/[^a-zA-Z0-9_]/.test(n)?console.warn(`Vue3 Mq: "${n}" is an invalid breakpoint key. Breakpoint keys must start with a letter and contain only alphanumeric characters and underscores. Skipping.`):!a&&0!==a||isNaN(a)||a<0?console.warn(`Vue3 Mq: "${n}: ${e[n]}" is not a valid breakpoint. Breakpoints should be a number of zero or above. Skipping.`):t.push({name:n,min:a}):console.warn(`Vue3 Mq: Invalid or missing breakpoint key (${JSON.stringify(n)}). Skipping.`);}t.some((e=>0===e.min))||console.warn("Vue3 Mq: You have not declared a breakpoint with a minimum value of 0. There may be screen sizes to which Vue3Mq does not respond.");return new Set(t.map((e=>e.min))).size<t.length&&console.warn("Vue3 Mq: Your breakpoint configuration contains duplicate values. Behaviour may be unpredictable."),0!==t.length&&t.sort(((e,t)=>e.min-t.min))};function R({breakpoints:e,preset:t}){const n=(e=>{if("string"==typeof e&&L[e])return L[e];{const t=Object.keys(L);return console.error(`Vue3 Mq: "${e}" is not a valid preset. Available options are: ${t.join(", ")}`),!1}})(t),a=T(e);if(!1===n&&!a)throw new TypeError("Vue3 Mq: You must provide a valid preset, or valid breakpoint settings.");var r;r=a||T(n),f.value=r,function(){for(;y.length>0;){const e=y.shift();if(e&&"object"==typeof e){const{mql:t,cb:n}=e;t.addEventListener&&"function"==typeof t.addEventListener?t.removeEventListener("change",n):t.removeListener(n);}}}(),(()=>{const e=Object.keys(h);for(let t of e)delete h[t];$(),V(),O();})();const o=k.value.reduce(((e,t,n,a)=>{const r=`(min-width: ${t.min}px)`,o=n<a.length-1?`(max-width: ${a[n+1].min-1}px)`:null,i=r+(o?" and "+o:"");return Object.assign(e,{[t.name]:i})}),{});for(const i in o){j(o[i],(()=>{$(i);}));}["portrait","landscape"].forEach((e=>{j(`(orientation: ${e})`,(()=>{V(e);}));})),["light","dark"].forEach((e=>{j(`(prefers-color-scheme: ${e})`,(()=>{O(e);}));}));}var N={install:(e,{preset:t="bootstrap5",breakpoints:n,defaultBreakpoint:a,defaultOrientation:r="landscape",defaultTheme:o}={})=>{try{const l=!1===["landscape","portrait"].includes(s=r)?(console.error(`Vue3 Mq: "${s}" is not a valid default orientation. Reverting to unset value.`),null):s,u=((e=null)=>!1===["dark","light"].includes(e)&&null!==e?(console.error(`Vue3 Mq: "${e}" is not a valid default theme. Reverting to unset value.`),null):e)(o);i=a,v.value=i,(e=>{m.value=e;})(l),(e=>{g.value=e;})(u),e.provide("mq",x),e.provide("updateBreakpoints",R),R({breakpoints:n,preset:t});}catch(l){console.error(l);}var i,s;}};
@@ -4008,7 +4008,7 @@ var script$7 = defineComponent({
4008
4008
 
4009
4009
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
4010
4010
  return (openBlock(), createBlock(TransitionGroup, {
4011
- name: "list",
4011
+ name: "notification",
4012
4012
  tag: "div",
4013
4013
  class: "notifications-holder"
4014
4014
  }, {
@@ -4026,7 +4026,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
4026
4026
  }))
4027
4027
  }
4028
4028
 
4029
- var css_248z$8 = ".notifications-holder {\n position: fixed;\n bottom: 0;\n width: 100vw;\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n}\n\n.notification {\n margin-top: 20px;\n margin-bottom: 20px;\n border-radius: 10px;\n padding: 20px;\n background-color: darkslateblue;\n color: white;\n width: 50vh;\n text-align: center;\n}\n";
4029
+ 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-color: darkslateblue;\n color: white;\n width: 40vh;\n text-align: center;\n}\n";
4030
4030
  styleInject(css_248z$8);
4031
4031
 
4032
4032
  script$7.render = render$7;
@@ -4079,16 +4079,20 @@ function addDataHelper(sourceObj, path, value) {
4079
4079
  }
4080
4080
  function getModifiableData(state) {
4081
4081
  return {
4082
- DATA: state.machine.data,
4083
- SKILLS: state.skills,
4084
- BUTTONS: state.buttons,
4082
+ data: state.machine.data,
4083
+ skills: state.skills,
4084
+ buttons: state.buttons,
4085
4085
  };
4086
4086
  }
4087
4087
 
4088
4088
  function processText(store, text) {
4089
4089
  return text.replace(/%{[^}]*}/g, (match) => {
4090
4090
  const key = match.substr(2, match.length - 3);
4091
- const [obj, newKey] = findDataHelper(store.state.machine.data, key);
4091
+ const searchableState = {
4092
+ data: store.state.machine.data,
4093
+ skills: store.state.skills,
4094
+ };
4095
+ const [obj, newKey] = findDataHelper(searchableState, key);
4092
4096
  return obj[newKey];
4093
4097
  });
4094
4098
  }
@@ -4149,29 +4153,44 @@ function loadImage(key, path, resolver, rejecter) {
4149
4153
  image.src = path;
4150
4154
  }
4151
4155
 
4152
- const audio = {
4153
- sound: {},
4154
- music: {},
4155
- };
4156
+ const audio = {};
4156
4157
  async function loadAudioAssets(config) {
4157
4158
  console.log(`Loading audio`);
4158
4159
  const loadingPromises = [];
4160
+ for (const key in config.music) {
4161
+ // Backward compatibility with old music list
4162
+ const musicConf = {
4163
+ loop: true,
4164
+ ...config.music[key],
4165
+ };
4166
+ config.audio[key] = musicConf;
4167
+ console.warn(`Music config is deprecated, instead you can now add musics to the \`audio\` config as they behave the same as other sounds!`);
4168
+ }
4159
4169
  for (const key in config.sound) {
4160
- loadingPromises.push(loadAudio(key, { loop: true, html5: true, ...config.sound[key] }, audio.sound));
4170
+ // more backward compatibility
4171
+ config.audio[key] = config.sound[key];
4161
4172
  }
4162
- for (const key in config.music) {
4163
- loadingPromises.push(loadAudio(key, config.music[key], audio.music));
4173
+ for (const key in config.audio) {
4174
+ const sound = config.audio[key];
4175
+ if (!sound.src) {
4176
+ sound.src = sound.path;
4177
+ if (!sound.path) {
4178
+ console.error(`Audio config for ${key} doesn't have any \`src\` value to find the file`);
4179
+ }
4180
+ console.warn('Using `path` for audio and musics is deprecated. Please replace `path` with `src` in your config file!');
4181
+ }
4182
+ loadingPromises.push(loadAudio(key, config.audio[key]));
4164
4183
  }
4165
4184
  return Promise.all(loadingPromises);
4166
4185
  }
4167
- async function loadAudio(key, config, dest) {
4186
+ async function loadAudio(key, config) {
4168
4187
  return new Promise((resolve, reject) => {
4169
4188
  console.log(`Loading audio ${config.src}`);
4170
4189
  const sound = new howler.Howl({
4171
4190
  ...config,
4172
4191
  });
4173
4192
  sound.load();
4174
- dest[key] = sound;
4193
+ audio[key] = sound;
4175
4194
  resolve();
4176
4195
  // sound.once('load', () => {
4177
4196
  // console.log(`Loaded audio ${path}`);
@@ -4181,39 +4200,49 @@ async function loadAudio(key, config, dest) {
4181
4200
  }
4182
4201
  function changeMusic(ctx, newMusic) {
4183
4202
  if (ctx.state.audio.currentMusic) {
4184
- const oldMusic = getMusic(ctx.state.audio.currentMusic);
4203
+ const oldMusic = getAudio(ctx.state.audio.currentMusic);
4204
+ const newMusicHowl = getAudio(newMusic);
4185
4205
  if (oldMusic) {
4186
- oldMusic.stop();
4206
+ if (oldMusic !== newMusicHowl) {
4207
+ // Stop the previous music if it's a different one
4208
+ oldMusic.stop();
4209
+ }
4187
4210
  }
4188
4211
  }
4189
4212
  ctx.commit('setMusic', newMusic);
4190
4213
  if (newMusic) {
4191
- playMusic(ctx.commit, newMusic);
4214
+ playAudio(ctx.commit, newMusic);
4192
4215
  }
4193
4216
  }
4194
- function playMusic(commit, key) {
4195
- const music = getMusic(key);
4196
- if (music) {
4197
- music.play();
4217
+ function playAudio(commit, key) {
4218
+ const sound = getAudio(key);
4219
+ if (sound) {
4220
+ sound.play();
4198
4221
  }
4199
4222
  else {
4200
- error(commit, `Music ${key} not found!`);
4223
+ error(commit, `Sound effect ${key} not found!`);
4201
4224
  }
4202
4225
  }
4203
- function playSound(commit, key) {
4204
- const sound = getSound(key);
4226
+ function getAudio(key) {
4227
+ return audio[key];
4228
+ }
4229
+ function stopAudio(commit, key) {
4230
+ const sound = getAudio(key);
4205
4231
  if (sound) {
4206
- sound.play();
4232
+ sound.stop();
4207
4233
  }
4208
4234
  else {
4209
4235
  error(commit, `Sound effect ${key} not found!`);
4210
4236
  }
4211
4237
  }
4212
- function getMusic(key) {
4213
- return audio.music[key];
4214
- }
4215
- function getSound(key) {
4216
- return audio.sound[key];
4238
+ function pauseAudio(commit, key) {
4239
+ const sound = getAudio(key);
4240
+ if (sound) {
4241
+ sound.pause();
4242
+ }
4243
+ else {
4244
+ error(commit, `Sound effect ${key} not found!`);
4245
+ }
4217
4246
  }
4218
4247
 
4219
4248
  function debounce(func, waitMilliseconds = 50, options = {}) {
@@ -4321,7 +4350,7 @@ var script$8 = defineComponent({
4321
4350
  // this.updateScreenSize();
4322
4351
  setTimeout(() => {
4323
4352
  this.updateScreenSize();
4324
- }, 5000);
4353
+ }, 50);
4325
4354
  },
4326
4355
  watch: {
4327
4356
  dialogLength(newCount, oldCount) {
@@ -4691,6 +4720,8 @@ function processSkillCheck(ctx, skillcheck) {
4691
4720
  skill: skillcheck.skill,
4692
4721
  value: skillcheck.value,
4693
4722
  id: skillcheck.id,
4723
+ success: skillcheck.success.text,
4724
+ failure: skillcheck.failure.text,
4694
4725
  });
4695
4726
  }
4696
4727
  function runSkillCheck(ctx, params) {
@@ -4709,11 +4740,11 @@ function runSkillCheck(ctx, params) {
4709
4740
  }
4710
4741
  if (success) {
4711
4742
  ctx.commit('passSkillCheck', params.id);
4712
- writeText(ctx, `[${skill.name} - Success]`);
4743
+ writeText(ctx, `[${skill.name} - Success] ${params.success || ''}`);
4713
4744
  return true;
4714
4745
  }
4715
4746
  ctx.commit('failSkillCheck', params.id);
4716
- writeText(ctx, `[${skill.name} - Failure]`);
4747
+ writeText(ctx, `[${skill.name} - Failure] ${params.failure || ''}`);
4717
4748
  return false;
4718
4749
  }
4719
4750
  function runConditionCommand(ctx, command) {
@@ -4847,12 +4878,36 @@ async function runCommand(context, cmd, choices) {
4847
4878
  });
4848
4879
  return dispatch('nextLine');
4849
4880
  case 'play':
4850
- const options = cmd.options;
4851
- if (options.mode === 'music') {
4852
- changeMusic(context, options.audio);
4881
+ const playOptions = cmd.options;
4882
+ if (playOptions.mode === 'music') {
4883
+ changeMusic(context, playOptions.audio);
4853
4884
  }
4854
4885
  else {
4855
- playSound(context.commit, options.audio);
4886
+ playAudio(context.commit, playOptions.audio);
4887
+ }
4888
+ return dispatch('nextLine');
4889
+ case 'stop':
4890
+ const stopOptions = cmd.options;
4891
+ if (stopOptions.mode === 'music') {
4892
+ stopAudio(commit, context.state.audio.currentMusic);
4893
+ }
4894
+ else if (stopOptions.mode === 'sound' && stopOptions.audio) {
4895
+ stopAudio(commit, stopOptions.audio);
4896
+ }
4897
+ else {
4898
+ error(commit, `stop option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.`);
4899
+ }
4900
+ return dispatch('nextLine');
4901
+ case 'pause':
4902
+ const pauseOptions = cmd.options;
4903
+ if (pauseOptions.mode === 'music') {
4904
+ pauseAudio(commit, context.state.audio.currentMusic);
4905
+ }
4906
+ else if (stopOptions.mode === 'sound' && stopOptions.audio) {
4907
+ pauseAudio(commit, stopOptions.audio);
4908
+ }
4909
+ else {
4910
+ error(commit, `pause first option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.`);
4856
4911
  }
4857
4912
  return dispatch('nextLine');
4858
4913
  case 'wait':
@@ -4930,18 +4985,21 @@ async function playerAnswered(context, choiceIndex) {
4930
4985
  const result = processSkillCheck(context, skillcheck);
4931
4986
  const winner = result ? skillcheck.success : skillcheck.failure;
4932
4987
  newBranch = winner.branch;
4933
- playerText = `[${result ? 'SUCCESS' : 'FAILURE'}] – ${winner.text}`;
4988
+ playerText = undefined;
4934
4989
  }
4935
4990
  }
4936
4991
  else {
4937
4992
  newBranch = choice.branch;
4938
4993
  }
4939
- const dialog = {
4940
- speaker: 'player',
4941
- text: playerText,
4942
- interactive: true,
4943
- };
4944
- commit('addDialog', { dialog });
4994
+ if (playerText) {
4995
+ // If the choice involves printing a player dialog, show it
4996
+ const dialog = {
4997
+ speaker: 'player',
4998
+ text: playerText,
4999
+ interactive: false,
5000
+ };
5001
+ commit('addDialog', { dialog });
5002
+ }
4945
5003
  if (newBranch) {
4946
5004
  const newStack = {
4947
5005
  currentIndex: 0,
@@ -5019,9 +5077,10 @@ async function textCommand(commit, dialog) {
5019
5077
  dialog,
5020
5078
  });
5021
5079
  }
5022
- async function nextLine({ state, getters, dispatch, commit, }) {
5080
+ async function nextLine(ctx) {
5081
+ const { state, getters, dispatch, commit } = ctx;
5023
5082
  if (state.machine.stack.length === 0) {
5024
- finishGame(commit);
5083
+ finishGame(ctx);
5025
5084
  return;
5026
5085
  }
5027
5086
  const machineHead = getters.machineHead;
@@ -5034,19 +5093,21 @@ async function nextLine({ state, getters, dispatch, commit, }) {
5034
5093
  return dispatch('nextLine');
5035
5094
  }
5036
5095
  if (state.machine.stack.length === 0) {
5037
- finishGame(commit);
5096
+ finishGame(ctx);
5038
5097
  }
5039
5098
  else {
5040
5099
  return dispatch('runLine');
5041
5100
  }
5042
5101
  }
5043
- function finishGame(commit) {
5044
- commit('addDialog', {
5045
- dialog: {
5046
- speaker: 'game',
5047
- text: 'You can interact with the screen on the left',
5048
- },
5049
- });
5102
+ function finishGame({ commit, state }) {
5103
+ if (state.options.debug) {
5104
+ commit('addDialog', {
5105
+ dialog: {
5106
+ speaker: 'game',
5107
+ text: '[DEBUG] Game Script is finished. This is the end of the game flow. This message only appears in debug mode.',
5108
+ },
5109
+ });
5110
+ }
5050
5111
  }
5051
5112
 
5052
5113
  function jump(ctx) {
@@ -5148,6 +5209,24 @@ function play(ctx) {
5148
5209
  };
5149
5210
  ctx.currentLine++;
5150
5211
  }
5212
+ function stop(ctx) {
5213
+ const { command } = ctx;
5214
+ command.commandType = 'stop';
5215
+ command.options = {
5216
+ mode: command.args[0],
5217
+ audio: command.args[1],
5218
+ };
5219
+ ctx.currentLine++;
5220
+ }
5221
+ function pause(ctx) {
5222
+ const { command } = ctx;
5223
+ command.commandType = 'pause';
5224
+ command.options = {
5225
+ mode: command.args[0],
5226
+ audio: command.args[1],
5227
+ };
5228
+ ctx.currentLine++;
5229
+ }
5151
5230
  function wait(ctx) {
5152
5231
  const { command } = ctx;
5153
5232
  command.commandType = 'wait';
@@ -5179,6 +5258,8 @@ const parserFunctions = {
5179
5258
  set_button: setButton,
5180
5259
  clear_dialog: clearDialog,
5181
5260
  play,
5261
+ stop,
5262
+ pause,
5182
5263
  wait,
5183
5264
  text,
5184
5265
  add_level,
@@ -5475,6 +5556,7 @@ function setupStore(options) {
5475
5556
  },
5476
5557
  notifications: {},
5477
5558
  hudStats: {},
5559
+ options,
5478
5560
  },
5479
5561
  getters: {
5480
5562
  machineHead(state) {
@@ -5729,7 +5811,7 @@ async function startApp(config, options) {
5729
5811
  mousePos.x = e.clientX;
5730
5812
  mousePos.y = e.clientY;
5731
5813
  });
5732
- console.log('%c Narrat game engine – 0.6.3 - April 25, 2022 16:37:54', 'background: #222; color: #bada55');
5814
+ console.log('%c Narrat game engine – 0.8.0 - April 26, 2022 13:18:38', 'background: #222; color: #bada55');
5733
5815
  const storeSetup = setupStore(options);
5734
5816
  store$1 = storeSetup.store;
5735
5817
  app = createApp(script$8, {
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 0.6.3 - April 25, 2022 16:37:54
1
+ // Version: 0.8.0 - April 26, 2022 13:18:38
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.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.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.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.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}\n\nselect {\n background-color: grey;\n}\n\nbutton {\n background-color: #72080f;\n color: white;\n border-radius: 30px;\n padding: 5px;\n font-weight: 800;\n font-size: 16px;\n margin: 5px;\n}\n\na {\n color: pink;\n text-decoration: underline;\n}\n\nth,\ntd {\n padding: 4px;\n border: 1px solid white;\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@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";
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.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.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.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}\n\nselect {\n background-color: grey;\n}\n\nbutton {\n background-color: #72080f;\n color: white;\n border-radius: 30px;\n padding: 5px;\n font-weight: 800;\n font-size: 16px;\n margin: 5px;\n}\n\na {\n color: pink;\n text-decoration: underline;\n}\n\nth,\ntd {\n padding: 4px;\n border: 1px solid white;\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@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;}};
@@ -4012,7 +4012,7 @@ var script$7 = vue.defineComponent({
4012
4012
 
4013
4013
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
4014
4014
  return (vue.openBlock(), vue.createBlock(vue.TransitionGroup, {
4015
- name: "list",
4015
+ name: "notification",
4016
4016
  tag: "div",
4017
4017
  class: "notifications-holder"
4018
4018
  }, {
@@ -4030,7 +4030,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
4030
4030
  }))
4031
4031
  }
4032
4032
 
4033
- var css_248z$8 = ".notifications-holder {\n position: fixed;\n bottom: 0;\n width: 100vw;\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n}\n\n.notification {\n margin-top: 20px;\n margin-bottom: 20px;\n border-radius: 10px;\n padding: 20px;\n background-color: darkslateblue;\n color: white;\n width: 50vh;\n text-align: center;\n}\n";
4033
+ 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-color: darkslateblue;\n color: white;\n width: 40vh;\n text-align: center;\n}\n";
4034
4034
  styleInject(css_248z$8);
4035
4035
 
4036
4036
  script$7.render = render$7;
@@ -4083,16 +4083,20 @@ function addDataHelper(sourceObj, path, value) {
4083
4083
  }
4084
4084
  function getModifiableData(state) {
4085
4085
  return {
4086
- DATA: state.machine.data,
4087
- SKILLS: state.skills,
4088
- BUTTONS: state.buttons,
4086
+ data: state.machine.data,
4087
+ skills: state.skills,
4088
+ buttons: state.buttons,
4089
4089
  };
4090
4090
  }
4091
4091
 
4092
4092
  function processText(store, text) {
4093
4093
  return text.replace(/%{[^}]*}/g, (match) => {
4094
4094
  const key = match.substr(2, match.length - 3);
4095
- const [obj, newKey] = findDataHelper(store.state.machine.data, key);
4095
+ const searchableState = {
4096
+ data: store.state.machine.data,
4097
+ skills: store.state.skills,
4098
+ };
4099
+ const [obj, newKey] = findDataHelper(searchableState, key);
4096
4100
  return obj[newKey];
4097
4101
  });
4098
4102
  }
@@ -4153,29 +4157,44 @@ function loadImage(key, path, resolver, rejecter) {
4153
4157
  image.src = path;
4154
4158
  }
4155
4159
 
4156
- const audio = {
4157
- sound: {},
4158
- music: {},
4159
- };
4160
+ const audio = {};
4160
4161
  async function loadAudioAssets(config) {
4161
4162
  console.log(`Loading audio`);
4162
4163
  const loadingPromises = [];
4164
+ for (const key in config.music) {
4165
+ // Backward compatibility with old music list
4166
+ const musicConf = {
4167
+ loop: true,
4168
+ ...config.music[key],
4169
+ };
4170
+ config.audio[key] = musicConf;
4171
+ console.warn(`Music config is deprecated, instead you can now add musics to the \`audio\` config as they behave the same as other sounds!`);
4172
+ }
4163
4173
  for (const key in config.sound) {
4164
- loadingPromises.push(loadAudio(key, { loop: true, html5: true, ...config.sound[key] }, audio.sound));
4174
+ // more backward compatibility
4175
+ config.audio[key] = config.sound[key];
4165
4176
  }
4166
- for (const key in config.music) {
4167
- loadingPromises.push(loadAudio(key, config.music[key], audio.music));
4177
+ for (const key in config.audio) {
4178
+ const sound = config.audio[key];
4179
+ if (!sound.src) {
4180
+ sound.src = sound.path;
4181
+ if (!sound.path) {
4182
+ console.error(`Audio config for ${key} doesn't have any \`src\` value to find the file`);
4183
+ }
4184
+ console.warn('Using `path` for audio and musics is deprecated. Please replace `path` with `src` in your config file!');
4185
+ }
4186
+ loadingPromises.push(loadAudio(key, config.audio[key]));
4168
4187
  }
4169
4188
  return Promise.all(loadingPromises);
4170
4189
  }
4171
- async function loadAudio(key, config, dest) {
4190
+ async function loadAudio(key, config) {
4172
4191
  return new Promise((resolve, reject) => {
4173
4192
  console.log(`Loading audio ${config.src}`);
4174
4193
  const sound = new howler.Howl({
4175
4194
  ...config,
4176
4195
  });
4177
4196
  sound.load();
4178
- dest[key] = sound;
4197
+ audio[key] = sound;
4179
4198
  resolve();
4180
4199
  // sound.once('load', () => {
4181
4200
  // console.log(`Loaded audio ${path}`);
@@ -4185,39 +4204,49 @@ async function loadAudio(key, config, dest) {
4185
4204
  }
4186
4205
  function changeMusic(ctx, newMusic) {
4187
4206
  if (ctx.state.audio.currentMusic) {
4188
- const oldMusic = getMusic(ctx.state.audio.currentMusic);
4207
+ const oldMusic = getAudio(ctx.state.audio.currentMusic);
4208
+ const newMusicHowl = getAudio(newMusic);
4189
4209
  if (oldMusic) {
4190
- oldMusic.stop();
4210
+ if (oldMusic !== newMusicHowl) {
4211
+ // Stop the previous music if it's a different one
4212
+ oldMusic.stop();
4213
+ }
4191
4214
  }
4192
4215
  }
4193
4216
  ctx.commit('setMusic', newMusic);
4194
4217
  if (newMusic) {
4195
- playMusic(ctx.commit, newMusic);
4218
+ playAudio(ctx.commit, newMusic);
4196
4219
  }
4197
4220
  }
4198
- function playMusic(commit, key) {
4199
- const music = getMusic(key);
4200
- if (music) {
4201
- music.play();
4221
+ function playAudio(commit, key) {
4222
+ const sound = getAudio(key);
4223
+ if (sound) {
4224
+ sound.play();
4202
4225
  }
4203
4226
  else {
4204
- error(commit, `Music ${key} not found!`);
4227
+ error(commit, `Sound effect ${key} not found!`);
4205
4228
  }
4206
4229
  }
4207
- function playSound(commit, key) {
4208
- const sound = getSound(key);
4230
+ function getAudio(key) {
4231
+ return audio[key];
4232
+ }
4233
+ function stopAudio(commit, key) {
4234
+ const sound = getAudio(key);
4209
4235
  if (sound) {
4210
- sound.play();
4236
+ sound.stop();
4211
4237
  }
4212
4238
  else {
4213
4239
  error(commit, `Sound effect ${key} not found!`);
4214
4240
  }
4215
4241
  }
4216
- function getMusic(key) {
4217
- return audio.music[key];
4218
- }
4219
- function getSound(key) {
4220
- return audio.sound[key];
4242
+ function pauseAudio(commit, key) {
4243
+ const sound = getAudio(key);
4244
+ if (sound) {
4245
+ sound.pause();
4246
+ }
4247
+ else {
4248
+ error(commit, `Sound effect ${key} not found!`);
4249
+ }
4221
4250
  }
4222
4251
 
4223
4252
  function debounce(func, waitMilliseconds = 50, options = {}) {
@@ -4325,7 +4354,7 @@ var script$8 = vue.defineComponent({
4325
4354
  // this.updateScreenSize();
4326
4355
  setTimeout(() => {
4327
4356
  this.updateScreenSize();
4328
- }, 5000);
4357
+ }, 50);
4329
4358
  },
4330
4359
  watch: {
4331
4360
  dialogLength(newCount, oldCount) {
@@ -4695,6 +4724,8 @@ function processSkillCheck(ctx, skillcheck) {
4695
4724
  skill: skillcheck.skill,
4696
4725
  value: skillcheck.value,
4697
4726
  id: skillcheck.id,
4727
+ success: skillcheck.success.text,
4728
+ failure: skillcheck.failure.text,
4698
4729
  });
4699
4730
  }
4700
4731
  function runSkillCheck(ctx, params) {
@@ -4713,11 +4744,11 @@ function runSkillCheck(ctx, params) {
4713
4744
  }
4714
4745
  if (success) {
4715
4746
  ctx.commit('passSkillCheck', params.id);
4716
- writeText(ctx, `[${skill.name} - Success]`);
4747
+ writeText(ctx, `[${skill.name} - Success] ${params.success || ''}`);
4717
4748
  return true;
4718
4749
  }
4719
4750
  ctx.commit('failSkillCheck', params.id);
4720
- writeText(ctx, `[${skill.name} - Failure]`);
4751
+ writeText(ctx, `[${skill.name} - Failure] ${params.failure || ''}`);
4721
4752
  return false;
4722
4753
  }
4723
4754
  function runConditionCommand(ctx, command) {
@@ -4851,12 +4882,36 @@ async function runCommand(context, cmd, choices) {
4851
4882
  });
4852
4883
  return dispatch('nextLine');
4853
4884
  case 'play':
4854
- const options = cmd.options;
4855
- if (options.mode === 'music') {
4856
- changeMusic(context, options.audio);
4885
+ const playOptions = cmd.options;
4886
+ if (playOptions.mode === 'music') {
4887
+ changeMusic(context, playOptions.audio);
4857
4888
  }
4858
4889
  else {
4859
- playSound(context.commit, options.audio);
4890
+ playAudio(context.commit, playOptions.audio);
4891
+ }
4892
+ return dispatch('nextLine');
4893
+ case 'stop':
4894
+ const stopOptions = cmd.options;
4895
+ if (stopOptions.mode === 'music') {
4896
+ stopAudio(commit, context.state.audio.currentMusic);
4897
+ }
4898
+ else if (stopOptions.mode === 'sound' && stopOptions.audio) {
4899
+ stopAudio(commit, stopOptions.audio);
4900
+ }
4901
+ else {
4902
+ error(commit, `stop option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.`);
4903
+ }
4904
+ return dispatch('nextLine');
4905
+ case 'pause':
4906
+ const pauseOptions = cmd.options;
4907
+ if (pauseOptions.mode === 'music') {
4908
+ pauseAudio(commit, context.state.audio.currentMusic);
4909
+ }
4910
+ else if (stopOptions.mode === 'sound' && stopOptions.audio) {
4911
+ pauseAudio(commit, stopOptions.audio);
4912
+ }
4913
+ else {
4914
+ error(commit, `pause first option needs to either be in music mode, or if stopping a sound needs to have the sound name supplied as second argument.`);
4860
4915
  }
4861
4916
  return dispatch('nextLine');
4862
4917
  case 'wait':
@@ -4934,18 +4989,21 @@ async function playerAnswered(context, choiceIndex) {
4934
4989
  const result = processSkillCheck(context, skillcheck);
4935
4990
  const winner = result ? skillcheck.success : skillcheck.failure;
4936
4991
  newBranch = winner.branch;
4937
- playerText = `[${result ? 'SUCCESS' : 'FAILURE'}] – ${winner.text}`;
4992
+ playerText = undefined;
4938
4993
  }
4939
4994
  }
4940
4995
  else {
4941
4996
  newBranch = choice.branch;
4942
4997
  }
4943
- const dialog = {
4944
- speaker: 'player',
4945
- text: playerText,
4946
- interactive: true,
4947
- };
4948
- commit('addDialog', { dialog });
4998
+ if (playerText) {
4999
+ // If the choice involves printing a player dialog, show it
5000
+ const dialog = {
5001
+ speaker: 'player',
5002
+ text: playerText,
5003
+ interactive: false,
5004
+ };
5005
+ commit('addDialog', { dialog });
5006
+ }
4949
5007
  if (newBranch) {
4950
5008
  const newStack = {
4951
5009
  currentIndex: 0,
@@ -5023,9 +5081,10 @@ async function textCommand(commit, dialog) {
5023
5081
  dialog,
5024
5082
  });
5025
5083
  }
5026
- async function nextLine({ state, getters, dispatch, commit, }) {
5084
+ async function nextLine(ctx) {
5085
+ const { state, getters, dispatch, commit } = ctx;
5027
5086
  if (state.machine.stack.length === 0) {
5028
- finishGame(commit);
5087
+ finishGame(ctx);
5029
5088
  return;
5030
5089
  }
5031
5090
  const machineHead = getters.machineHead;
@@ -5038,19 +5097,21 @@ async function nextLine({ state, getters, dispatch, commit, }) {
5038
5097
  return dispatch('nextLine');
5039
5098
  }
5040
5099
  if (state.machine.stack.length === 0) {
5041
- finishGame(commit);
5100
+ finishGame(ctx);
5042
5101
  }
5043
5102
  else {
5044
5103
  return dispatch('runLine');
5045
5104
  }
5046
5105
  }
5047
- function finishGame(commit) {
5048
- commit('addDialog', {
5049
- dialog: {
5050
- speaker: 'game',
5051
- text: 'You can interact with the screen on the left',
5052
- },
5053
- });
5106
+ function finishGame({ commit, state }) {
5107
+ if (state.options.debug) {
5108
+ commit('addDialog', {
5109
+ dialog: {
5110
+ speaker: 'game',
5111
+ text: '[DEBUG] Game Script is finished. This is the end of the game flow. This message only appears in debug mode.',
5112
+ },
5113
+ });
5114
+ }
5054
5115
  }
5055
5116
 
5056
5117
  function jump(ctx) {
@@ -5152,6 +5213,24 @@ function play(ctx) {
5152
5213
  };
5153
5214
  ctx.currentLine++;
5154
5215
  }
5216
+ function stop(ctx) {
5217
+ const { command } = ctx;
5218
+ command.commandType = 'stop';
5219
+ command.options = {
5220
+ mode: command.args[0],
5221
+ audio: command.args[1],
5222
+ };
5223
+ ctx.currentLine++;
5224
+ }
5225
+ function pause(ctx) {
5226
+ const { command } = ctx;
5227
+ command.commandType = 'pause';
5228
+ command.options = {
5229
+ mode: command.args[0],
5230
+ audio: command.args[1],
5231
+ };
5232
+ ctx.currentLine++;
5233
+ }
5155
5234
  function wait(ctx) {
5156
5235
  const { command } = ctx;
5157
5236
  command.commandType = 'wait';
@@ -5183,6 +5262,8 @@ const parserFunctions = {
5183
5262
  set_button: setButton,
5184
5263
  clear_dialog: clearDialog,
5185
5264
  play,
5265
+ stop,
5266
+ pause,
5186
5267
  wait,
5187
5268
  text,
5188
5269
  add_level,
@@ -5479,6 +5560,7 @@ function setupStore(options) {
5479
5560
  },
5480
5561
  notifications: {},
5481
5562
  hudStats: {},
5563
+ options,
5482
5564
  },
5483
5565
  getters: {
5484
5566
  machineHead(state) {
@@ -5733,7 +5815,7 @@ async function startApp(config, options) {
5733
5815
  mousePos.x = e.clientX;
5734
5816
  mousePos.y = e.clientY;
5735
5817
  });
5736
- console.log('%c Narrat game engine – 0.6.3 - April 25, 2022 16:37:54', 'background: #222; color: #bada55');
5818
+ console.log('%c Narrat game engine – 0.8.0 - April 26, 2022 13:18:38', 'background: #222; color: #bada55');
5737
5819
  const storeSetup = setupStore(options);
5738
5820
  store$1 = storeSetup.store;
5739
5821
  app = vue.createApp(script$8, {
@@ -5,6 +5,8 @@ export interface SkillCheckParams {
5
5
  skill: string;
6
6
  value: number;
7
7
  id: string;
8
+ success?: string;
9
+ failure?: string;
8
10
  }
9
11
  export declare function runSkillCheck(ctx: ActionContext<State, State>, params: SkillCheckParams): boolean;
10
12
  export declare function runConditionCommand(ctx: ActionContext<State, State>, command: Parser.Command): Parser.Branch | undefined;
@@ -1,21 +1,14 @@
1
- import { Config, MusicConfig, SoundConfig } from '@/types/config';
1
+ import { Config, MusicConfig, AudioConfig } from '@/types/config';
2
2
  import { Howl } from 'howler';
3
3
  import { State } from 'vue';
4
4
  import { ActionContext, Commit } from 'vuex';
5
5
  export declare const audio: {
6
- sound: {
7
- [key: string]: Howl;
8
- };
9
- music: {
10
- [key: string]: Howl;
11
- };
6
+ [key: string]: Howl;
12
7
  };
13
8
  export declare function loadAudioAssets(config: Config): Promise<void[]>;
14
- export declare function loadAudio(key: string, config: SoundConfig | MusicConfig, dest: {
15
- [key: string]: Howl;
16
- }): Promise<void>;
9
+ export declare function loadAudio(key: string, config: AudioConfig | MusicConfig): Promise<void>;
17
10
  export declare function changeMusic(ctx: ActionContext<State, State>, newMusic: string): void;
18
- export declare function playMusic(commit: Commit, key: string): void;
19
- export declare function playSound(commit: Commit, key: string): void;
20
- export declare function getMusic(key: string): Howl | undefined;
21
- export declare function getSound(key: string): Howl | undefined;
11
+ export declare function playAudio(commit: Commit, key: string): void;
12
+ export declare function getAudio(key: string): Howl | undefined;
13
+ export declare function stopAudio(commit: Commit, key: string): void;
14
+ export declare function pauseAudio(commit: Commit, key: string): void;
@@ -3,7 +3,7 @@ export declare function findDataHelper<T>(sourceObj: any, path: string): [T, str
3
3
  export declare function setDataHelper<T>(sourceObj: any, path: string, value: T): void;
4
4
  export declare function addDataHelper<T>(sourceObj: any, path: string, value: T): void;
5
5
  export declare function getModifiableData(state: State): {
6
- DATA: import("../types/vuex").DataState;
7
- SKILLS: import("../types/vuex").SkillsState;
8
- BUTTONS: import("vue").ButtonsState;
6
+ data: import("../types/vuex").DataState;
7
+ skills: import("../types/vuex").SkillsState;
8
+ buttons: import("vue").ButtonsState;
9
9
  };
@@ -6,5 +6,5 @@ export declare function runCommand(context: ActionContext<State, State>, cmd: Pa
6
6
  export declare function playerAnswered(context: ActionContext<State, State>, choiceIndex: number): Promise<void>;
7
7
  export declare function runChoice(context: ActionContext<State, State>, cmd: Parser.Command): Promise<void>;
8
8
  export declare function textCommand(commit: Commit, dialog: DialogKey): Promise<void>;
9
- export declare function nextLine({ state, getters, dispatch, commit, }: ActionContext<State, State>): Promise<any>;
10
- export declare function finishGame(commit: Commit): void;
9
+ export declare function nextLine(ctx: ActionContext<State, State>): Promise<any>;
10
+ export declare function finishGame({ commit, state }: ActionContext<State, State>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narrat",
3
- "version": "0.6.3",
3
+ "version": "0.8.0",
4
4
  "description": "narrat narrative engine",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",