[
    {
        "name": "Story",
        "comment": " Main engine API, with functions for you to load your story and build rules.\n\nThe framework takes care of managing all of the state, views, and interaction handling, allowing the client code to focus purely on the story.\n\n# Loading the story\n\n@docs load, Info, StartingState\n\n# Defining your story world\n\n@docs world, World, ItemInfo, LocationInfo, CharacterInfo, itemInfo, locationInfo, characterInfo\n\n# Defining story rules\n\nRules are how you progress the story.  They are made up of conditions to match against and commands to perform if the rule matches.  Rules are grouped into \"scenes\" for better control and organization.  The engine will run through the active scene from the beginning, looking for the first matching rule, then run it.  If no rules match, the framework will perform a default command, which is usually just to narrate the description of what was interacted with.\n\n\nA rule has four parts:\n\n1. A matcher against what interactable story element the user clicked on\n2. A list of conditions that all must match for the rule to match\n3. A list of changes to make if the rule matches\n4. Narration to add to the story line if the rule matches (note that you can use markdown)\n\n\n    scene1 : List (Story.Rule MyItem MyLocation MyCharacter MyKnowledge)\n    scene1 =\n        [ { interaction = withCharacter Harry\n          , conditions = [ inLocation Garden ]\n          , changes = [ moveCharacter Harry Marsh, addInventory NoteFromHarry ]\n          , narration = [ \"He gives you a note, then runs off.\", \"I wonder what he wants?\" ]\n          }\n        , { interaction = withInventory NoteFromHarry\n          , conditions = []\n          , changes = [ addLocation Marsh ]\n          , narration = [ \"It says, \\\"*Meet me in the marsh.*\\\"\" ]\n          }\n        ]\n\nWhen a rule matches multiple times (a player clicks the same story element multiple times), it will run through the list of narrations in order, one per click, repeating the final one when it reaches the end.\n\n@docs Rule\n\n## Interaction matchers\n\nThe following interaction matchers can be used in the `interaction` part of the rule record.\n\n@docs InteractionMatcher, withItem, withLocation, withCharacter, withAnything, withAnyItem, withAnyLocation, withAnyCharacter\n\n\n## Conditions\n\nThe following condition matchers can be used in the `conditions` part of the rule record.\n\n@docs  Condition, withInventory , nearCharacter , nearItem , inLocation , withKnowledge , unless\n\n\n## Changing the story world\n\nYou cannot change the story directly, but you can supply \"commands\" describing how the story state should change.\n\n@docs ChangeWorldCommand, moveTo, addLocation, removeLocation, addInventory, removeInventory, moveCharacter, removeCharacter, placeItem, removeItem, addKnowledge, loadScene, endStory\n\n",
        "unions": [],
        "aliases": [
            {
                "name": "ChangeWorldCommand",
                "comment": " ",
                "args": [
                    "item",
                    "location",
                    "character",
                    "knowledge"
                ],
                "type": "ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "CharacterInfo",
                "comment": " ",
                "args": [],
                "type": "CharacterInfo"
            },
            {
                "name": "Condition",
                "comment": " ",
                "args": [
                    "item",
                    "location",
                    "character",
                    "knowledge"
                ],
                "type": "Condition item location character knowledge"
            },
            {
                "name": "Info",
                "comment": " Basic information about the story, which gets displayed on the \"title page\" before beginning the story.\n\n    info : Info\n    info =\n        { title = \"The Continuing Adventures of Bartholomew Barrymore\"\n        , byline = \"B. Barrymore\"\n        , prologue = \"Mr. Barrymore is at it again, with more shenanigans in this comedy-mystery...\"\n        }\n",
                "args": [],
                "type": "{ title : String, byline : String, prologue : String }"
            },
            {
                "name": "InteractionMatcher",
                "comment": " ",
                "args": [
                    "item",
                    "location",
                    "character"
                ],
                "type": "InteractionMatcher item location character"
            },
            {
                "name": "ItemInfo",
                "comment": " ",
                "args": [],
                "type": "ItemInfo"
            },
            {
                "name": "LocationInfo",
                "comment": " ",
                "args": [],
                "type": "LocationInfo"
            },
            {
                "name": "Rule",
                "comment": " A declarative rule, describing how to advance your story and under what conditions.\n",
                "args": [
                    "item",
                    "location",
                    "character",
                    "knowledge"
                ],
                "type": "Rule item location character knowledge"
            },
            {
                "name": "StartingState",
                "comment": " Information for the starting state of your story.  See the \"Changing the story world\" section for more information on the setupCommands.\n\n    setup : StartingState MyItem MyLocation MyCharacter MyKnowledge\n    setup =\n        { startingScene = beginning\n        , startingLocation = Home\n        , startingNarration = \"Home sweet home...\"\n        , setupCommands =\n            [ addLocation Conservatory\n            , moveCharacter John Conservatory\n            , placeItem Umbrella Home\n            ]\n        }\n",
                "args": [
                    "item",
                    "location",
                    "character",
                    "knowledge"
                ],
                "type": "{ startingScene : List (Rule item location character knowledge), startingLocation : location, startingNarration : String, setupCommands : List (ChangeWorldCommand item location character knowledge) }"
            },
            {
                "name": "World",
                "comment": " A collection of all of the interactable elements in your story, for loading into the engine.\n",
                "args": [
                    "item",
                    "location",
                    "character"
                ],
                "type": "World item location character"
            }
        ],
        "values": [
            {
                "name": "addInventory",
                "comment": " Adds an item to your inventory (if it was previously in a location, it will be removed from there, as items can only be in one place at once).\n",
                "type": "item -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "addKnowledge",
                "comment": " Knowledge is an intangible \"flag\" that you can match against in your rules.  For example if you add knowledge of learning about a suspect, then going back to people you have already interacted with can give you new information about the suspect when you interact with them again.  You can also use this for acquiring skills or bonuses or anything intangible that would not be displayed in the story.  You could track your actions, such as if you were kind or mean to an important character in an earlier scene.\n\nHowever, before turning to this tool, consider if you can use a normal, story interactable instead.  For example, perhaps you get a sketch of the suspect in your inventory, which you can \"show\" to people for more information.  This keeps the story more concrete.\n\n    type MyKnowledge = LearnOfSuspect | WrongSuspect | Amnesia\n\n    addKnowledge LearnOfSuspect\n",
                "type": "knowledge -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "addLocation",
                "comment": " Adds a location to your list of known locations.  Any location on this list is available for the player to click on at any time.  This avoids clunky spatial navigation mechanics, but does mean that you will need to make rules to prevent against going to locations that are inaccessible (with appropriate narration).\n",
                "type": "location -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "characterInfo",
                "comment": " Display information for your characters, including a name and description.  The description allows markdown.\n\n    characterInfo \"Harry\" \"My good friend Harry...\"\n",
                "type": "String -> String -> CharacterInfo"
            },
            {
                "name": "endStory",
                "comment": " Let the framework know the story has ended.  Currently this has no effect, I'm trying to figure out what should happen when stories end.  You may want to make the rule load a special \"storyFinished\" scene that only has one `withAnything` interaction matcher so the player can't do anything else (unless you want to let them \"wander\").\n",
                "type": "ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "inLocation",
                "comment": " Will only match when the supplied location is the current location.\n",
                "type": "location -> Condition item location character knowledge"
            },
            {
                "name": "itemInfo",
                "comment": " Display information for your items, including a name and description.  The description allows markdown.\n\n    itemInfo \"Umbrella\" \"My trusty umbrella, I take it everywhere.\"\n",
                "type": "String -> String -> ItemInfo"
            },
            {
                "name": "load",
                "comment": " This is where you load all of your story details into the framework (from the client's `Main.elm` file).  See https://github.com/jschomay/elm-interactive-story-starter.git for an example of how to define interactables and scenes.\n\n    main : Program Never\n    main =\n        Story.load info world setup\n\n",
                "type": "Info -> World item location character -> StartingState item location character knowledge -> Program Never"
            },
            {
                "name": "loadScene",
                "comment": " Rules are grouped into \"scenes\" for better organization and control.  This is how you switch between scenes when you want a different rule set.  You may want to switch scenes at a \"turning point\" in your story to bring about new rules for the next objective.\n\n    scene1 = [...rules here...]\n    scene2 = [...rules here...]\n\n    -- in the `changes` part of a rule in a scene1:\n    loadScene scene2\n",
                "type": "List (Rule item location character knowledge) -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "locationInfo",
                "comment": " Display information for your locations, including a name, a highlight color, and a description.  The description allows markdown.\n\n    locationInfo \"Home\" Color.Green \"Home sweet home...\"\n",
                "type": "String -> Color -> String -> LocationInfo"
            },
            {
                "name": "moveCharacter",
                "comment": " Adds a character to a location, or moves a character to a different location (characters can only be in one location at a time, or off-screen).  (Use moveTo to move yourself between locations.)\n",
                "type": "character -> location -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "moveTo",
                "comment": " Changes the current location.  The current location will be highlighted in the list of known locations, and will also be displayed at the top of the page, highlighted in the color defined for that location.  Any items or characters that are in the current location will also be shown for the player to interact with.\n",
                "type": "location -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "nearCharacter",
                "comment": " Will only match if the supplied character in in the current location.\n",
                "type": "character -> Condition item location character knowledge"
            },
            {
                "name": "nearItem",
                "comment": " Will only match if the supplied item is in the current location.  Ignores inventory.\n",
                "type": "item -> Condition item location character knowledge"
            },
            {
                "name": "placeItem",
                "comment": " Move an item to a location.  If it was in another location or your inventory before, it will remove it from there, as items can only be in one place at once.\n",
                "type": "item -> location -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "removeCharacter",
                "comment": " Moves a character \"off-screen\".  The character will not show up in any locations until you use `moveCharacter` again.\n",
                "type": "character -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "removeInventory",
                "comment": " Removes an item from your inventory.  The item will not show up anywhere until you add it back to your inventory or to a location.\n",
                "type": "item -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "removeItem",
                "comment": " Moves an item \"off-screen\" (either from a location or the inventory).  The item will not show up in any locations or inventory until you use `placeItem` or `addInventory` again.\n",
                "type": "item -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "removeLocation",
                "comment": " Removes a location from your list of known locations.  You probably don't need this since once you know about a location you would always know about it, and trying to go to a location that is inaccessible for some reason could just give some narration telling why.  But maybe you will find a good reason to use it.\n",
                "type": "location -> ChangeWorldCommand item location character knowledge"
            },
            {
                "name": "unless",
                "comment": " Will only match if the supplied condition does NOT match.\n",
                "type": "Condition item location character knowledge -> Condition item location character knowledge"
            },
            {
                "name": "withAnyCharacter",
                "comment": " Will match the `interaction` part of a story rule if the player interacted with any character (be careful about the the order and conditions of your rules since this matcher is so broad).\n",
                "type": "InteractionMatcher item location character"
            },
            {
                "name": "withAnyItem",
                "comment": " Will match the `interaction` part of a story rule if the player interacted with any item (be careful about the the order and conditions of your rules since this matcher is so broad).\n",
                "type": "InteractionMatcher item location character"
            },
            {
                "name": "withAnyLocation",
                "comment": " Will match the `interaction` part of a story rule if the player interacted with any location (be careful about the the order and conditions of your rules since this matcher is so broad).\n",
                "type": "InteractionMatcher item location character"
            },
            {
                "name": "withAnything",
                "comment": " Will match the `interaction` part of a story rule every time (be careful about the the order and conditions of your rules since this matcher is so broad).\n",
                "type": "InteractionMatcher item location character"
            },
            {
                "name": "withCharacter",
                "comment": " Will only match the `interaction` part of a story rule if the player interacted with the specified character.\n",
                "type": "character -> InteractionMatcher item location character"
            },
            {
                "name": "withInventory",
                "comment": " Will only match if the supplied item is in the inventory.\n",
                "type": "item -> Condition item location character knowledge"
            },
            {
                "name": "withItem",
                "comment": " Will only match the `interaction` part of a story rule if the player interacted with the specified item.\n",
                "type": "item -> InteractionMatcher item location character"
            },
            {
                "name": "withKnowledge",
                "comment": " Will only match if the specified knowledge has been acquired.\n",
                "type": "knowledge -> Condition item location character knowledge"
            },
            {
                "name": "withLocation",
                "comment": " Will only match the `interaction` part of a story rule if the player interacted with the specified location.\n",
                "type": "location -> InteractionMatcher item location character"
            },
            {
                "name": "world",
                "comment": " A means of looking up static information about your story interactables, which gets loaded into `Story.load`.\n",
                "type": "(item -> ItemInfo) -> (location -> LocationInfo) -> (character -> CharacterInfo) -> World item location character"
            }
        ],
        "binops": []
    }
]