{"action":"created","issue":{"url":"https://api.github.com/repos/cdqwertz/rpgtest/issues/40","repository_url":"https://api.github.com/repos/cdqwertz/rpgtest","labels_url":"https://api.github.com/repos/cdqwertz/rpgtest/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/cdqwertz/rpgtest/issues/40/comments","events_url":"https://api.github.com/repos/cdqwertz/rpgtest/issues/40/events","html_url":"https://github.com/cdqwertz/rpgtest/pull/40","id":164697341,"number":40,"title":"Quest goals and API","user":{"login":"rubenwardy","id":2122943,"avatar_url":"https://avatars.githubusercontent.com/u/2122943?v=3","gravatar_id":"","url":"https://api.github.com/users/rubenwardy","html_url":"https://github.com/rubenwardy","followers_url":"https://api.github.com/users/rubenwardy/followers","following_url":"https://api.github.com/users/rubenwardy/following{/other_user}","gists_url":"https://api.github.com/users/rubenwardy/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenwardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenwardy/subscriptions","organizations_url":"https://api.github.com/users/rubenwardy/orgs","repos_url":"https://api.github.com/users/rubenwardy/repos","events_url":"https://api.github.com/users/rubenwardy/events{/privacy}","received_events_url":"https://api.github.com/users/rubenwardy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-10T03:30:37Z","updated_at":"2016-09-04T12:09:10Z","closed_at":"2016-07-10T09:09:47Z","pull_request":{"url":"https://api.github.com/repos/cdqwertz/rpgtest/pulls/40","html_url":"https://github.com/cdqwertz/rpgtest/pull/40","diff_url":"https://github.com/cdqwertz/rpgtest/pull/40.diff","patch_url":"https://github.com/cdqwertz/rpgtest/pull/40.patch"},"body":"Adds (IMO) an improved quests API.\r\nNow quests can have multiple criteria - or goals - before being accepted. This is useful if it doesn't particularly matter in what order a player does something, like collecting ingredients.\r\n\r\n## Creating quests\r\n\r\nHere is a basic quest:\r\n\r\n```lua\r\nlocal quest = quests.new(name, \"Preparing a small feast\")\r\nquests.add_dig_goal(quest, \"Harvest wheat\", \"farming:wheat_8\", 5)\r\nquests.add_dig_goal(quest, \"Harvest apples\", \"default:apple\", 3)\r\nquests.add_quest(name, quest)\r\n```\r\n\r\nThis will show up in the quest menu as:\r\n\r\n\t-> Preparing a small feast\r\n\t    [ ] Harvest wheat (0/5)\r\n\t\t[ ] Harvest apples (0/3)\r\n\r\nFor longer quests, certain goals need to be done in an order.\r\nTo do this, use goal.require:\r\n\r\n```lua\r\nlocal quest = quests.new(name, \"Get gem\")\r\nlocal g1 = quests.add_dig_goal(quest, \"Get gem\", \"treasure:raregem\", 1)\r\nlocal g2 = quests.add_give_goal(quest, \"Return to the King\", king, \"treasure:raregem\", 1)\r\ng2.requires = g1\r\nquest.next = quest2\r\n```\r\n\r\nWhen the quest starts:\r\n\r\n\t-> Get gem\r\n\t    [ ] Get gem [0/1]\r\n\r\nAnd when you get the gem:\r\n\r\n\t-> Get gem\r\n\t    [x] Get gem [1/1]\r\n\t\t[ ] Return gem to the King [0/1]\r\n\r\n## Future Improvements\r\n\r\n* Add support for more goals than digging and placing, such as \"give\"\r\n* Multiple goal.requires\r\n* Call backs on quest completion\r\n* Notify player when a new goal is opened\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cdqwertz/rpgtest/issues/comments/244599726","html_url":"https://github.com/cdqwertz/rpgtest/pull/40#issuecomment-244599726","issue_url":"https://api.github.com/repos/cdqwertz/rpgtest/issues/40","id":244599726,"user":{"login":"cdqwertz","id":12814327,"avatar_url":"https://avatars.githubusercontent.com/u/12814327?v=3","gravatar_id":"","url":"https://api.github.com/users/cdqwertz","html_url":"https://github.com/cdqwertz","followers_url":"https://api.github.com/users/cdqwertz/followers","following_url":"https://api.github.com/users/cdqwertz/following{/other_user}","gists_url":"https://api.github.com/users/cdqwertz/gists{/gist_id}","starred_url":"https://api.github.com/users/cdqwertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdqwertz/subscriptions","organizations_url":"https://api.github.com/users/cdqwertz/orgs","repos_url":"https://api.github.com/users/cdqwertz/repos","events_url":"https://api.github.com/users/cdqwertz/events{/privacy}","received_events_url":"https://api.github.com/users/cdqwertz/received_events","type":"User","site_admin":false},"created_at":"2016-09-04T12:09:10Z","updated_at":"2016-09-04T12:09:10Z","body":"https://github.com/cdqwertz/rpgtest/commit/219817235e1a6bfc6ebe992bea0feae94166caaa"}}
{"actor":{"display_login":"cdqwertz"}}