narrat 0.18.0 → 1.2.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Liana Pigeot
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Liana Pigeot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,30 +1,30 @@
1
- # 🚀 Narrat
2
-
3
- ![example workflow](https://github.com/nialna/narrat/actions/workflows/main.yml/badge.svg)
4
-
5
- A narrative game engine for text-based games. Inspired by renpy syntax, but built to be customisable, extendable and web-focused. See the [website](https://get-narrat.com)
6
-
7
- ![Narrat banner image](https://gblobscdn.gitbook.com/assets%2F-Mh95QNKFZeeRV90-ZSq%2F-MiI7tyjjriQTQI80bhM%2F-MiI83Ys6ED75AlZ_dVT%2Fnarrat-banner.jpg?alt=media&token=9d72e03f-c2ba-4fcb-8579-491b0f8940d8)
8
-
9
- You can [try a little demo](https://get-narrat.com/demo/). It contains a built version of the [narrat demo repo](https://github.com/nialna/narrat-demo).
10
-
11
- Game dialogue info is written in files with a similar syntax to Renpy (.rpy files). Those files get loaded by the game engine which plays through them. This allows us to use [renpy syntax highlighting](https://marketplace.visualstudio.com/items?itemName=LuqueDaniel.languague-renpy) in vs code easily. It is **not renpy** though, just inspired from it. Eventually narrat might have its own language and file extension support.
12
-
13
- ## Usage
14
-
15
- See the [Documentation](https://docs.get-narrat.com/) for more info, or jump directly in the [Getting Started Guide](https://docs.get-narrat.com/getting-started)
16
-
17
- ## Features
18
-
19
- * Flexible dialog writing with branching and conditions
20
- * Multiple script files support with labels and jumps to organise script writing
21
- * Multiple speaking characters support with icons and poses
22
- * Custom variables in scripts to create flags or other data the game needs to track
23
- * Seamless saving and reloading
24
- * UI with buttons that can be used for example to create world maps with clickable locations (the buttons can be controlled in scripts)
25
- * Sound and music support
26
- * Delays between script lines
27
- * Electron build to turn the game into a pc/mac/linux app (template to be updated with example soon)
28
- * Skill checks (Feature still early, needs a UI for viewing skills and creating characters)
29
-
30
-
1
+ # 🚀 Narrat
2
+
3
+ ![example workflow](https://github.com/nialna/narrat/actions/workflows/main.yml/badge.svg)
4
+
5
+ A narrative game engine for text-based games. Inspired by renpy syntax, but built to be customisable, extendable and web-focused. See the [website](https://get-narrat.com)
6
+
7
+ ![Narrat banner image](https://gblobscdn.gitbook.com/assets%2F-Mh95QNKFZeeRV90-ZSq%2F-MiI7tyjjriQTQI80bhM%2F-MiI83Ys6ED75AlZ_dVT%2Fnarrat-banner.jpg?alt=media&token=9d72e03f-c2ba-4fcb-8579-491b0f8940d8)
8
+
9
+ You can [try a little demo](https://get-narrat.com/demo/). It contains a built version of the [narrat demo repo](https://github.com/nialna/narrat-demo).
10
+
11
+ Game dialogue info is written in files with a similar syntax to Renpy (.rpy files). Those files get loaded by the game engine which plays through them. This allows us to use [renpy syntax highlighting](https://marketplace.visualstudio.com/items?itemName=LuqueDaniel.languague-renpy) in vs code easily. It is **not renpy** though, just inspired from it. Eventually narrat might have its own language and file extension support.
12
+
13
+ ## Usage
14
+
15
+ See the [Documentation](https://docs.get-narrat.com/) for more info, or jump directly in the [Getting Started Guide](https://docs.get-narrat.com/getting-started)
16
+
17
+ ## Features
18
+
19
+ * Flexible dialog writing with branching and conditions
20
+ * Multiple script files support with labels and jumps to organise script writing
21
+ * Multiple speaking characters support with icons and poses
22
+ * Custom variables in scripts to create flags or other data the game needs to track
23
+ * Seamless saving and reloading
24
+ * UI with buttons that can be used for example to create world maps with clickable locations (the buttons can be controlled in scripts)
25
+ * Sound and music support
26
+ * Delays between script lines
27
+ * Electron build to turn the game into a pc/mac/linux app (template to be updated with example soon)
28
+ * Skill checks (Feature still early, needs a UI for viewing skills and creating characters)
29
+
30
+
@@ -5,10 +5,12 @@ declare const _default: import("vue").DefineComponent<Readonly<import("vue").Com
5
5
  }, {
6
6
  showSkills(): boolean;
7
7
  showInventory(): boolean;
8
+ showQuests(): boolean;
8
9
  }, {
9
10
  openMenu(): void;
10
11
  openSkills(): void;
11
12
  openInventory(): void;
13
+ openQuests(): void;
12
14
  closeMenu(): void;
13
15
  toggleMenu(): void;
14
16
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, readonly string[] | Readonly<import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
@@ -0,0 +1,25 @@
1
+ import { QuestState, ObjectiveState } from '../stores/quest-log';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ close: any;
4
+ }, {
5
+ quests: import("vue").ComputedRef<{
6
+ [key: string]: QuestState;
7
+ }>;
8
+ }, unknown, {
9
+ questsToDisplay(): {
10
+ [key: string]: QuestState;
11
+ };
12
+ }, {
13
+ getQuestData(questId: string): import("../config").QuestData;
14
+ getObjectiveData(questId: string, objectiveId: string): import("../config").ObjectiveData;
15
+ getDisplayTextForQuestState(quest: QuestState): " Hidden" | "" | " (Completed)" | " Unknown";
16
+ getQuestDescription(quest: QuestState): string;
17
+ getAvailableObjectives(quest: QuestState): {
18
+ [key: string]: ObjectiveState;
19
+ };
20
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
21
+ close: any;
22
+ }>>, {
23
+ close: any;
24
+ }>;
25
+ export default _default;
package/lib/config.d.ts CHANGED
@@ -2,6 +2,8 @@ export declare function setConfig(conf: Config): void;
2
2
  export declare function getConfig(): Config;
3
3
  export declare function getSkillConfig(id: string): SkillData;
4
4
  export declare function getItemConfig(id: string): ItemData;
5
+ export declare function getQuestConfig(questId: string): QuestData;
6
+ export declare function getObjectiveConfig(quest: string, objectiveId: string): ObjectiveData;
5
7
  export interface Config {
6
8
  gameTitle: string;
7
9
  images: {
@@ -69,6 +71,20 @@ export interface Config {
69
71
  items: {
70
72
  [key: string]: ItemData;
71
73
  };
74
+ quests: {
75
+ [key: string]: QuestData;
76
+ };
77
+ }
78
+ export interface QuestData {
79
+ title: string;
80
+ description: string;
81
+ objectives: {
82
+ [key: string]: ObjectiveData;
83
+ };
84
+ }
85
+ export interface ObjectiveData {
86
+ description: string;
87
+ hidden?: boolean;
72
88
  }
73
89
  export interface ItemData {
74
90
  name: string;
@@ -0,0 +1,27 @@
1
+ import { NarratPlugin } from '@/index';
2
+ import { CommandPlugin } from '@/vm/commands/command-plugin';
3
+ import { State } from 'vue';
4
+ import { ActionContext } from 'vuex';
5
+ declare global {
6
+ interface Window {
7
+ defaultFontName: string;
8
+ attachCanvas: (canvas: HTMLCanvasElement) => void;
9
+ loadGame: (gameData: any, defaultFontData: any) => void;
10
+ }
11
+ }
12
+ export declare function bitsyHacks(): void;
13
+ export declare function attachBitsyGameToNarrat(): HTMLCanvasElement;
14
+ export interface BitsyPluginOptions {
15
+ showOnGameStart?: boolean;
16
+ }
17
+ export declare class BitsyPlugin extends NarratPlugin {
18
+ canvas: HTMLCanvasElement;
19
+ customCommands: CommandPlugin[];
20
+ options: BitsyPluginOptions;
21
+ oldInputs: any;
22
+ onGameMounted(): void;
23
+ constructor(options?: BitsyPluginOptions);
24
+ showBitsyCommand({ dispatch, commit }: ActionContext<State, State>): Promise<void>;
25
+ hideBitsyCommand({ dispatch, commit }: ActionContext<State, State>): Promise<any>;
26
+ hideBitsy(): void;
27
+ }
@@ -0,0 +1,2 @@
1
+ import { aspectRatioFit } from './utils/helpers';
2
+ export { aspectRatioFit };