narrat 2.0.4 → 2.0.7

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/dist/narrat.es.js CHANGED
@@ -36695,8 +36695,9 @@ const useAudio = defineStore("audio", {
36695
36695
  actions: {
36696
36696
  stopMusic() {
36697
36697
  if (this.currentMusic) {
36698
- stopAudio(this.currentMusic);
36698
+ const music = this.currentMusic;
36699
36699
  this.currentMusic = void 0;
36700
+ stopAudio(music);
36700
36701
  }
36701
36702
  },
36702
36703
  setMusic(music, soundId) {
@@ -40702,7 +40703,7 @@ const rollPlugin = new CommandPlugin("roll", [
40702
40703
  hideAfterRoll
40703
40704
  };
40704
40705
  const result = runSkillCheck(skillCheck);
40705
- return result;
40706
+ return result.succeeded;
40706
40707
  });
40707
40708
  const addStatPlugin = new CommandPlugin("add_stat", [
40708
40709
  { name: "statKey", type: "string" },
@@ -41252,8 +41253,10 @@ choicePlugin.onPlayerAnswered = async (command, playerChoice) => {
41252
41253
  const { choices } = command.staticOptions;
41253
41254
  const choice = choices[choiceIndex];
41254
41255
  const choicePromptResult = command.options.choiceResults[choiceIndex];
41256
+ let playerText = choicePromptResult.text;
41255
41257
  let newBranch;
41256
41258
  if (choicePromptResult.skillCheck) {
41259
+ playerText = null;
41257
41260
  const result = runSkillCheck({
41258
41261
  skill: choicePromptResult.skillCheck.skillId,
41259
41262
  value: choicePromptResult.skillCheck.difficulty,
@@ -41268,6 +41271,14 @@ choicePlugin.onPlayerAnswered = async (command, playerChoice) => {
41268
41271
  } else {
41269
41272
  newBranch = choice.branch;
41270
41273
  }
41274
+ if (playerText) {
41275
+ const dialog = {
41276
+ speaker: "player",
41277
+ text: playerText,
41278
+ interactive: false
41279
+ };
41280
+ useDialogStore().addDialog(dialog);
41281
+ }
41271
41282
  if (newBranch) {
41272
41283
  const newStack = {
41273
41284
  currentIndex: 0,